diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index b361ef1a78..0e02bebb47 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -627,7 +627,7 @@ so as to remain in compliance with the most up-to-date laws." if(NOTIFY_JUMP) var/turf/T = get_turf(target) if(T && isturf(T)) - G.loc = T + G.forceMove(T) if(NOTIFY_ORBIT) G.ManualFollow(target) diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index b0ab260d63..903f3c0790 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -92,7 +92,7 @@ /obj/item/tk_grab/dropped(mob/user) if(focus && user && loc != user && loc != user.loc) // drop_item() gets called when you tk-attack a table/closet with an item if(focus.Adjacent(loc)) - focus.loc = loc + focus.forceMove(loc) . = ..() //stops TK grabs being equipped anywhere but into hands diff --git a/code/datums/antagonists/devil.dm b/code/datums/antagonists/devil.dm index 14c92f3263..f66fc5a3b2 100644 --- a/code/datums/antagonists/devil.dm +++ b/code/datums/antagonists/devil.dm @@ -205,7 +205,7 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master", /datum/antagonist/devil/proc/regress_blood_lizard() var/mob/living/carbon/true_devil/D = owner.current to_chat(D, "Your powers weaken, have more contracts be signed to regain power.") - D.oldform.loc = D.loc + D.oldform.forceMove(D.drop_location()) owner.transfer_to(D.oldform) give_appropriate_spells() qdel(D) @@ -236,7 +236,7 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master", sleep(50) var/mob/living/carbon/true_devil/A = new /mob/living/carbon/true_devil(owner.current.loc) A.faction |= "hell" - owner.current.loc = A + owner.current.forceMove(A) A.oldform = owner.current owner.transfer_to(A) A.set_name() diff --git a/code/datums/diseases/parrotpossession.dm b/code/datums/diseases/parrotpossession.dm index 0df7e0f7d3..a5d87be980 100644 --- a/code/datums/diseases/parrotpossession.dm +++ b/code/datums/diseases/parrotpossession.dm @@ -22,6 +22,6 @@ /datum/disease/parrot_possession/cure() if(parrot && parrot.loc == affected_mob) - parrot.loc = affected_mob.loc + parrot.forceMove(affected_mob.drop_location()) affected_mob.visible_message("[parrot] is violently driven out of [affected_mob]!", "[parrot] bursts out of your chest!") ..() \ No newline at end of file diff --git a/code/datums/diseases/wizarditis.dm b/code/datums/diseases/wizarditis.dm index fbdb107c83..485a5ea2c4 100644 --- a/code/datums/diseases/wizarditis.dm +++ b/code/datums/diseases/wizarditis.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /datum/disease/wizarditis name = "Wizarditis" max_stages = 4 @@ -113,3 +114,120 @@ STI KALY - blind affected_mob.loc = pick(L) return +======= +/datum/disease/wizarditis + name = "Wizarditis" + max_stages = 4 + spread_text = "Airborne" + cure_text = "The Manly Dorf" + cures = list("manlydorf") + cure_chance = 100 + agent = "Rincewindus Vulgaris" + viable_mobtypes = list(/mob/living/carbon/human) + disease_flags = CAN_CARRY|CAN_RESIST|CURABLE + permeability_mod = 0.75 + desc = "Some speculate that this virus is the cause of the Space Wizard Federation's existence. Subjects affected show the signs of mental retardation, yelling obscure sentences or total gibberish. On late stages subjects sometime express the feelings of inner power, and, cite, 'the ability to control the forces of cosmos themselves!' A gulp of strong, manly spirits usually reverts them to normal, humanlike, condition." + severity = HARMFUL + required_organs = list(/obj/item/bodypart/head) + +/* +BIRUZ BENNAR +SCYAR NILA - teleport +NEC CANTIO - dis techno +EI NATH - shocking grasp +AULIE OXIN FIERA - knock +TARCOL MINTI ZHERI - forcewall +STI KALY - blind +*/ + +/datum/disease/wizarditis/stage_act() + ..() + + switch(stage) + if(2) + if(prob(1)&&prob(50)) + affected_mob.say(pick("You shall not pass!", "Expeliarmus!", "By Merlins beard!", "Feel the power of the Dark Side!")) + if(prob(1)&&prob(50)) + to_chat(affected_mob, "You feel [pick("that you don't have enough mana", "that the winds of magic are gone", "an urge to summon familiar")].") + + + if(3) + if(prob(1)&&prob(50)) + affected_mob.say(pick("NEC CANTIO!","AULIE OXIN FIERA!", "STI KALY!", "TARCOL MINTI ZHERI!")) + if(prob(1)&&prob(50)) + to_chat(affected_mob, "You feel [pick("the magic bubbling in your veins","that this location gives you a +1 to INT","an urge to summon familiar")].") + + if(4) + + if(prob(1)) + affected_mob.say(pick("NEC CANTIO!","AULIE OXIN FIERA!","STI KALY!","EI NATH!")) + return + if(prob(1)&&prob(50)) + to_chat(affected_mob, "You feel [pick("the tidal wave of raw power building inside","that this location gives you a +2 to INT and +1 to WIS","an urge to teleport")].") + spawn_wizard_clothes(50) + if(prob(1)&&prob(1)) + teleport() + return + + + +/datum/disease/wizarditis/proc/spawn_wizard_clothes(chance = 0) + if(ishuman(affected_mob)) + var/mob/living/carbon/human/H = affected_mob + if(prob(chance)) + if(!istype(H.head, /obj/item/clothing/head/wizard)) + if(!H.dropItemToGround(H.head)) + qdel(H.head) + H.equip_to_slot_or_del(new /obj/item/clothing/head/wizard(H), slot_head) + return + if(prob(chance)) + if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe)) + if(!H.dropItemToGround(H.wear_suit)) + qdel(H.wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe(H), slot_wear_suit) + return + if(prob(chance)) + if(!istype(H.shoes, /obj/item/clothing/shoes/sandal/magic)) + if(!H.dropItemToGround(H.shoes)) + qdel(H.shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal/magic(H), slot_shoes) + return + else + var/mob/living/carbon/H = affected_mob + if(prob(chance)) + var/obj/item/staff/S = new(H) + if(!H.put_in_hands(S)) + qdel(S) + + +/datum/disease/wizarditis/proc/teleport() + var/list/theareas = get_areas_in_range(80, affected_mob) + for(var/area/space/S in theareas) + theareas -= S + + if(!theareas||!theareas.len) + return + + var/area/thearea = pick(theareas) + + var/list/L = list() + for(var/turf/T in get_area_turfs(thearea.type)) + if(T.z != affected_mob.z) continue + if(T.name == "space") continue + if(!T.density) + var/clear = 1 + for(var/obj/O in T) + if(O.density) + clear = 0 + break + if(clear) + L+=T + + if(!L) + return + + affected_mob.say("SCYAR NILA [uppertext(thearea.name)]!") + affected_mob.forceMove(pick(L)) + + return +>>>>>>> 8b54685... Cleanup to various loc assignments and nearby code (#31069) diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index 95267cf927..b51c020a03 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -134,6 +134,7 @@ /datum/wires/proc/pulse_color(color, mob/living/user) pulse(get_wire(color), user) +<<<<<<< HEAD /datum/wires/proc/pulse_assembly(obj/item/device/assembly/S) for(var/color in assemblies) @@ -177,6 +178,51 @@ /datum/wires/proc/on_cut(wire, mend = FALSE) return +======= + +/datum/wires/proc/pulse_assembly(obj/item/device/assembly/S) + for(var/color in assemblies) + if(S == assemblies[color]) + pulse_color(color) + return TRUE + +/datum/wires/proc/attach_assembly(color, obj/item/device/assembly/S) + if(S && istype(S) && S.attachable && !is_attached(color)) + assemblies[color] = S + S.forceMove(holder) + S.connected = src + return S + +/datum/wires/proc/detach_assembly(color) + var/obj/item/device/assembly/S = get_attached(color) + if(S && istype(S)) + assemblies -= color + S.connected = null + S.forceMove(holder.drop_location()) + return S + +/datum/wires/proc/emp_pulse() + var/list/possible_wires = shuffle(wires) + var/remaining_pulses = MAXIMUM_EMP_WIRES + + for(var/wire in possible_wires) + if(prob(33)) + pulse(wire) + remaining_pulses-- + if(remaining_pulses >= 0) + break + +// Overridable Procs +/datum/wires/proc/interactable(mob/user) + return TRUE + +/datum/wires/proc/get_status() + return list() + +/datum/wires/proc/on_cut(wire, mend = FALSE) + return + +>>>>>>> 8b54685... Cleanup to various loc assignments and nearby code (#31069) /datum/wires/proc/on_pulse(wire, user) return // End Overridable Procs diff --git a/code/game/gamemodes/blob/blob.dm b/code/game/gamemodes/blob/blob.dm index 36a23b2bd1..ddb87e20f6 100644 --- a/code/game/gamemodes/blob/blob.dm +++ b/code/game/gamemodes/blob/blob.dm @@ -78,7 +78,7 @@ GLOBAL_LIST_EMPTY(blobs_legit) //used for win-score calculations, contains only var/mob/camera/blob/B = blob.current.become_overmind(TRUE, round(blob_base_starting_points/blob_overminds.len)) B.mind.name = B.name var/turf/T = pick(GLOB.blobstart) - B.loc = T + B.forceMove(T) B.base_point_rate = blob_point_rate SSshuttle.registerHostileEnvironment(src) diff --git a/code/game/gamemodes/blob/powers.dm b/code/game/gamemodes/blob/powers.dm index 026183d951..865a58fd81 100644 --- a/code/game/gamemodes/blob/powers.dm +++ b/code/game/gamemodes/blob/powers.dm @@ -59,7 +59,7 @@ set name = "Jump to Core" set desc = "Move your camera to your core." if(blob_core) - src.loc = blob_core.loc + forceMove(blob_core.drop_location()) /mob/camera/blob/verb/jump_to_node() set category = "Blob" diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 8443f3d6f1..183ec88b23 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -190,7 +190,7 @@ B.density = TRUE if(T.Enter(B,src)) //NOW we can attempt to move into the tile B.density = initial(B.density) - B.loc = T + B.forceMove(T) B.update_icon() if(B.overmind && expand_reaction) B.overmind.blob_reagent_datum.expand_reaction(src, B, T, controller) diff --git a/code/game/gamemodes/changeling/powers/headcrab.dm b/code/game/gamemodes/changeling/powers/headcrab.dm index 94d83e2520..e7f23bc07b 100644 --- a/code/game/gamemodes/changeling/powers/headcrab.dm +++ b/code/game/gamemodes/changeling/powers/headcrab.dm @@ -30,7 +30,7 @@ sleep(5) // So it's not killed in explosion var/mob/living/simple_animal/hostile/headcrab/crab = new(turf) for(var/obj/item/organ/I in organs) - I.loc = crab + I.forceMove(crab) crab.origin = M if(crab.origin) crab.origin.active = 1 diff --git a/code/game/gamemodes/miniantags/abduction/machinery/dispenser.dm b/code/game/gamemodes/miniantags/abduction/machinery/dispenser.dm index 88bb84fc4a..2b012e5f81 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/dispenser.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/dispenser.dm @@ -60,9 +60,8 @@ /obj/machinery/abductor/gland_dispenser/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/organ/heart/gland)) - if(!user.drop_item()) + if(!user.transferItemToLoc(W, src)) return - W.loc = src for(var/i=1,i<=gland_colors.len,i++) if(gland_types[i] == W.type) amounts[i]++ diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index 8979fb8c78..d919d5d277 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -502,7 +502,7 @@ var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/metal(target.loc) M.amount = 5 for(var/obj/item/I in target.component_parts) - I.loc = M.loc + I.forceMove(M.drop_location()) var/obj/effect/temp_visual/swarmer/disintegration/N = new /obj/effect/temp_visual/swarmer/disintegration(get_turf(target)) N.pixel_x = target.pixel_x N.pixel_y = target.pixel_y @@ -511,7 +511,7 @@ if(istype(target, /obj/machinery/computer)) var/obj/machinery/computer/C = target if(C.circuit) - C.circuit.loc = M.loc + C.circuit.forceMove(M.drop_location()) qdel(target) diff --git a/code/game/gamemodes/miniantags/morph/morph.dm b/code/game/gamemodes/miniantags/morph/morph.dm index f763f742f7..5e1a97675b 100644 --- a/code/game/gamemodes/miniantags/morph/morph.dm +++ b/code/game/gamemodes/miniantags/morph/morph.dm @@ -77,7 +77,7 @@ /mob/living/simple_animal/hostile/morph/proc/eat(atom/movable/A) if(A && A.loc != src) visible_message("[src] swallows [A] whole!") - A.loc = src + A.forceMove(src) return 1 return 0 @@ -153,7 +153,7 @@ /mob/living/simple_animal/hostile/morph/proc/barf_contents() for(var/atom/movable/AM in src) - AM.loc = loc + AM.forceMove(loc) if(prob(90)) step(AM, pick(GLOB.alldirs)) diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index acf55e4036..2179177fc1 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -110,7 +110,7 @@ P.info = "The nuclear authorization code is: [nuke_code]" P.name = "nuclear bomb code" var/mob/living/carbon/human/H = synd_mind.current - P.loc = H.loc + P.forceMove(H.drop_location()) H.put_in_hands_or_del(P) H.update_icons() else diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm index 7a17d54b4c..9d51ff7b36 100644 --- a/code/game/gamemodes/sandbox/h_sandbox.dm +++ b/code/game/gamemodes/sandbox/h_sandbox.dm @@ -30,6 +30,7 @@ GLOBAL_VAR_INIT(hsboxspawn, TRUE) /obj/item/assembly, /obj/item/device/onetankbomb, /obj/item/radio, /obj/item/device/pda/ai, /obj/item/device/uplink, /obj/item/smallDelivery, /obj/item/projectile, /obj/item/borg/sight, /obj/item/borg/stun, /obj/item/robot_module) +<<<<<<< HEAD /datum/hSB/proc/update() var/global/list/hrefs = list( @@ -301,3 +302,276 @@ GLOBAL_VAR_INIT(hsboxspawn, TRUE) if(config.sandbox_autoclose) usr << browse(null,"window=sandbox") +======= + +/datum/hSB/proc/update() + var/global/list/hrefs = list( + "Space Gear", + "Suit Up (Space Travel Gear)" = "hsbsuit", + "Spawn Gas Mask" = "hsbspawn&path=[/obj/item/clothing/mask/gas]", + "Spawn Emergency Air Tank" = "hsbspawn&path=[/obj/item/tank/internals/emergency_oxygen/double]", + + "Standard Tools", + "Spawn Flashlight" = "hsbspawn&path=[/obj/item/device/flashlight]", + "Spawn Toolbox" = "hsbspawn&path=[/obj/item/storage/toolbox/mechanical]", + "Spawn Light Replacer" = "hsbspawn&path=[/obj/item/device/lightreplacer]", + "Spawn Medical Kit" = "hsbspawn&path=[/obj/item/storage/firstaid/regular]", + "Spawn All-Access ID" = "hsbaaid", + + "Building Supplies", + "Spawn 50 Wood" = "hsbwood", + "Spawn 50 Metal" = "hsbmetal", + "Spawn 50 Plasteel" = "hsbplasteel", + "Spawn 50 Reinforced Glass" = "hsbrglass", + "Spawn 50 Glass" = "hsbglass", + "Spawn Full Cable Coil" = "hsbspawn&path=[/obj/item/stack/cable_coil]", + "Spawn Hyper Capacity Power Cell" = "hsbspawn&path=[/obj/item/stock_parts/cell/hyper]", + "Spawn Inf. Capacity Power Cell" = "hsbspawn&path=[/obj/item/stock_parts/cell/infinite]", + "Spawn Rapid Construction Device" = "hsbrcd", + "Spawn RCD Ammo" = "hsb_safespawn&path=[/obj/item/rcd_ammo]", + "Spawn Airlock" = "hsbairlock", + + "Miscellaneous", + "Spawn Air Scrubber" = "hsbscrubber", + "Spawn Welding Fuel Tank" = "hsbspawn&path=[/obj/structure/reagent_dispensers/fueltank]", + "Spawn Water Tank" = "hsbspawn&path=[/obj/structure/reagent_dispensers/watertank]", + + "Bots", + "Spawn Cleanbot" = "hsbspawn&path=[/mob/living/simple_animal/bot/cleanbot]", + "Spawn Floorbot" = "hsbspawn&path=[/mob/living/simple_animal/bot/floorbot]", + "Spawn Medbot" = "hsbspawn&path=[/mob/living/simple_animal/bot/medbot]", + + "Canisters", + "Spawn O2 Canister" = "hsbspawn&path=[/obj/machinery/portable_atmospherics/canister/oxygen]", + "Spawn Air Canister" = "hsbspawn&path=[/obj/machinery/portable_atmospherics/canister/air]") + + + if(!hsbinfo) + hsbinfo = "
Sandbox Panel

" + if(admin) + hsbinfo += "Administration
" + hsbinfo += "- Toggle Object Spawning
" + hsbinfo += "- Toggle Item Spawn Panel Auto-close
" + hsbinfo += "Canister Spawning
" + hsbinfo += "- Spawn Plasma Canister
" + hsbinfo += "- Spawn CO2 Canister
" + hsbinfo += "- Spawn Nitrogen Canister
" + hsbinfo += "- Spawn N2O Canister
" + else + hsbinfo += "Some item spawning may be disabled by the administrators.
" + hsbinfo += "Only administrators may spawn dangerous canisters.
" + for(var/T in hrefs) + var/href = hrefs[T] + if(href) + hsbinfo += "- [T]
" + else + hsbinfo += "
[T]
" + hsbinfo += "
" + hsbinfo += "- Spawn Clothing...
" + hsbinfo += "- Spawn Reagent Container...
" + hsbinfo += "- Spawn Other Item...

" + + usr << browse(hsbinfo, "window=hsbpanel") + +/datum/hSB/Topic(href, href_list) + if(!usr || !src || !(src.owner == usr.ckey)) + if(usr) + usr << browse(null,"window=sandbox") + return + + if(href_list["hsb"]) + switch(href_list["hsb"]) + // + // Admin: toggle spawning + // + if("hsbtobj") + if(!admin) return + if(GLOB.hsboxspawn) + to_chat(world, "Sandbox: \black[usr.key] has disabled object spawning!") + GLOB.hsboxspawn = FALSE + return + else + to_chat(world, "Sandbox: \black[usr.key] has enabled object spawning!") + GLOB.hsboxspawn = TRUE + return + // + // Admin: Toggle auto-close + // + if("hsbtac") + if(!admin) return + var/sbac = CONFIG_GET(flag/sandbox_autoclose) + if(sbac) + to_chat(world, "Sandbox: \black [usr.key] has removed the object spawn limiter.") + else + to_chat(world, "Sandbox: \black [usr.key] has added a limiter to object spawning. The window will now auto-close after use.") + CONFIG_SET(flag/sandbox_autoclose, !sbac) + return + // + // Spacesuit with full air jetpack set as internals + // + if("hsbsuit") + var/mob/living/carbon/human/P = usr + if(!istype(P)) return + if(P.wear_suit) + P.wear_suit.forceMove(P.drop_location()) + P.wear_suit.layer = initial(P.wear_suit.layer) + P.wear_suit.plane = initial(P.wear_suit.plane) + P.wear_suit = null + P.wear_suit = new/obj/item/clothing/suit/space(P) + P.wear_suit.layer = ABOVE_HUD_LAYER + P.wear_suit.plane = ABOVE_HUD_PLANE + P.update_inv_wear_suit() + if(P.head) + P.head.forceMove(P.drop_location()) + P.head.layer = initial(P.head.layer) + P.head.plane = initial(P.head.plane) + P.head = null + P.head = new/obj/item/clothing/head/helmet/space(P) + P.head.layer = ABOVE_HUD_LAYER + P.head.plane = ABOVE_HUD_PLANE + P.update_inv_head() + if(P.wear_mask) + P.wear_mask.forceMove(P.drop_location()) + P.wear_mask.layer = initial(P.wear_mask.layer) + P.wear_mask.plane = initial(P.wear_mask.plane) + P.wear_mask = null + P.wear_mask = new/obj/item/clothing/mask/gas(P) + P.wear_mask.layer = ABOVE_HUD_LAYER + P.wear_mask.plane = ABOVE_HUD_PLANE + P.update_inv_wear_mask() + if(P.back) + P.back.forceMove(P.drop_location()) + P.back.layer = initial(P.back.layer) + P.back.plane = initial(P.back.plane) + P.back = null + P.back = new/obj/item/tank/jetpack/oxygen(P) + P.back.layer = ABOVE_HUD_LAYER + P.back.plane = ABOVE_HUD_PLANE + P.update_inv_back() + P.internal = P.back + P.update_internals_hud_icon(1) + + if("hsbscrubber") // This is beyond its normal capability but this is sandbox and you spawned one, I assume you need it + var/obj/hsb = new/obj/machinery/portable_atmospherics/scrubber{volume_rate=50*ONE_ATMOSPHERE;on=1}(usr.loc) + hsb.update_icon() // hackish but it wasn't meant to be spawned I guess? + + // + // Stacked Materials + // + + if("hsbrglass") + new/obj/item/stack/sheet/rglass{amount=50}(usr.loc) + + if("hsbmetal") + new/obj/item/stack/sheet/metal{amount=50}(usr.loc) + + if("hsbplasteel") + new/obj/item/stack/sheet/plasteel{amount=50}(usr.loc) + + if("hsbglass") + new/obj/item/stack/sheet/glass{amount=50}(usr.loc) + + if("hsbwood") + new/obj/item/stack/sheet/mineral/wood{amount=50}(usr.loc) + + // + // All access ID + // + if("hsbaaid") + var/obj/item/card/id/gold/ID = new(usr.loc) + ID.registered_name = usr.real_name + ID.assignment = "Sandbox" + ID.access = get_all_accesses() + ID.update_label() + + // + // RCD - starts with full clip + // Spawn check due to grief potential (destroying floors, walls, etc) + // + if("hsbrcd") + if(!GLOB.hsboxspawn) return + + new/obj/item/construction/rcd/combat(usr.loc) + + // + // New sandbox airlock maker + // + if("hsbairlock") + new /datum/airlock_maker(usr.loc) + + // + // Object spawn window + // + + // Clothing + if("hsbcloth") + if(!GLOB.hsboxspawn) return + + if(!clothinfo) + clothinfo = "Clothing (Reagent Containers) (Other Items)

" + var/list/all_items = subtypesof(/obj/item/clothing) + for(var/typekey in spawn_forbidden) + all_items -= typesof(typekey) + for(var/O in reverseRange(all_items)) + clothinfo += "[O]
" + + usr << browse(clothinfo,"window=sandbox") + + // Reagent containers + if("hsbreag") + if(!GLOB.hsboxspawn) return + + if(!reaginfo) + reaginfo = "Reagent Containers (Clothing) (Other Items)

" + var/list/all_items = subtypesof(/obj/item/reagent_containers) + for(var/typekey in spawn_forbidden) + all_items -= typesof(typekey) + for(var/O in reverseRange(all_items)) + reaginfo += "[O]
" + + usr << browse(reaginfo,"window=sandbox") + + // Other items + if("hsbobj") + if(!GLOB.hsboxspawn) return + + if(!objinfo) + objinfo = "Other Items (Clothing) (Reagent Containers)

" + var/list/all_items = subtypesof(/obj/item/) - typesof(/obj/item/clothing) - typesof(/obj/item/reagent_containers) + for(var/typekey in spawn_forbidden) + all_items -= typesof(typekey) + + for(var/O in reverseRange(all_items)) + objinfo += "[O]
" + + usr << browse(objinfo,"window=sandbox") + + // + // Safespawn checks to see if spawning is disabled. + // + if("hsb_safespawn") + if(!GLOB.hsboxspawn) + usr << browse(null,"window=sandbox") + return + + var/typepath = text2path(href_list["path"]) + if(!typepath) + to_chat(usr, "Bad path: \"[href_list["path"]]\"") + return + new typepath(usr.loc) + + if(CONFIG_GET(flag/sandbox_autoclose)) + usr << browse(null,"window=sandbox") + // + // For everything else in the href list + // + if("hsbspawn") + var/typepath = text2path(href_list["path"]) + if(!typepath) + to_chat(usr, "Bad path: \"[href_list["path"]]\"") + return + new typepath(usr.loc) + + if(CONFIG_GET(flag/sandbox_autoclose)) + usr << browse(null,"window=sandbox") +>>>>>>> 8b54685... Cleanup to various loc assignments and nearby code (#31069) diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index f4847e30a7..42d676c29b 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -234,11 +234,10 @@ if(!link) if(I.loc == user && istype(I) && I.w_class <= WEIGHT_CLASS_SMALL) - user.drop_item() - I.loc = src - link = I - to_chat(user, "You attach [I] to the doll.") - update_targets() + if (user.transferItemToLoc(I,src)) + link = I + to_chat(user, "You attach [I] to the doll.") + update_targets() /obj/item/voodoo/check_eye(mob/user) if(loc != user) diff --git a/code/game/gamemodes/wizard/soulstone.dm b/code/game/gamemodes/wizard/soulstone.dm index aae0261320..df57ded774 100644 --- a/code/game/gamemodes/wizard/soulstone.dm +++ b/code/game/gamemodes/wizard/soulstone.dm @@ -164,7 +164,7 @@ if(contents.len) to_chat(user, "Capture failed!: The soulstone is full! Free an existing soul to make room.") else - T.loc = src //put shade in stone + T.forceMove(src) //put shade in stone T.status_flags |= GODMODE T.canmove = 0 T.health = T.maxHealth diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index eea7afcb4b..69528b686c 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -30,7 +30,7 @@ to_chat(wizard.current, "A starting location for you could not be found, please report this bug!") return 0 for(var/datum/mind/wiz in wizards) - wiz.current.loc = pick(GLOB.wizardstart) + wiz.current.forceMove(pick(GLOB.wizardstart)) return 1 diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm index 80400fee05..48eafce3c5 100644 --- a/code/game/machinery/Beacon.dm +++ b/code/game/machinery/Beacon.dm @@ -44,10 +44,10 @@ var/turf/T = loc Beacon = new /obj/item/device/radio/beacon Beacon.invisibility = INVISIBILITY_MAXIMUM - Beacon.loc = T + Beacon.forceMove(T) if(Beacon) if(Beacon.loc != loc) - Beacon.loc = loc + Beacon.forceMove(loc) updateicon() diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index b070de1b1c..054bf07f70 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -429,7 +429,7 @@ Class Procs: W.handle_item_insertion(A, 1) component_parts -= A component_parts += B - B.loc = null + B.moveToNullspace() to_chat(user, "[A.name] replaced with [B.name].") shouldplaysound = 1 //Only play the sound when parts are actually replaced! break diff --git a/code/game/machinery/bank_machine.dm b/code/game/machinery/bank_machine.dm index de07fc9c2d..9d446aa77c 100644 --- a/code/game/machinery/bank_machine.dm +++ b/code/game/machinery/bank_machine.dm @@ -43,7 +43,7 @@ say("Station funds depleted. Halting siphon.") siphoning = FALSE else - new /obj/item/stack/spacecash/c200(get_turf(src)) // will autostack + new /obj/item/stack/spacecash/c200(drop_location()) // will autostack playsound(src.loc, 'sound/items/poster_being_created.ogg', 100, 1) SSshuttle.points -= 200 if(next_warning < world.time && prob(15)) diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm index 7c1904d2fe..8a118b8d08 100644 --- a/code/game/machinery/buttons.dm +++ b/code/game/machinery/buttons.dm @@ -127,10 +127,10 @@ if(panel_open) if(device || board) if(device) - device.loc = get_turf(src) + device.forceMove(drop_location()) device = null if(board) - board.loc = get_turf(src) + board.forceMove(drop_location()) req_access = list() req_one_access = list() board = null diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index d7832622c5..7d3c40a0d9 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -246,7 +246,7 @@ if(disassembled) if(!assembly) assembly = new() - assembly.loc = src.loc + assembly.forceMove(drop_location()) assembly.state = 1 assembly.setDir(dir) assembly = null diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 340277b441..b5343aa3ad 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -80,6 +80,7 @@ playsound(src.loc, W.usesound, 50, 1) var/input = stripped_input(user, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Set Network", "SS13") +<<<<<<< HEAD if(!input) to_chat(user, "No input found, please hang up and try your call again!") return @@ -140,6 +141,68 @@ return 0 /obj/structure/camera_assembly/deconstruct(disassembled = TRUE) +======= + if(!input) + to_chat(user, "No input found, please hang up and try your call again!") + return + + var/list/tempnetwork = splittext(input, ",") + if(tempnetwork.len < 1) + to_chat(user, "No network found, please hang up and try your call again!") + return + + state = 4 + var/obj/machinery/camera/C = new(src.loc) + forceMove(C) + C.assembly = src + C.setDir(src.dir) + + C.network = tempnetwork + var/area/A = get_area(src) + C.c_tag = "[A.name] ([rand(1, 999)])" + + + else if(istype(W, /obj/item/wirecutters)) + new/obj/item/stack/cable_coil(get_turf(src), 2) + playsound(src.loc, W.usesound, 50, 1) + to_chat(user, "You cut the wires from the circuits.") + state = 2 + return + + // Upgrades! + if(is_type_in_typecache(W, possible_upgrades) && !is_type_in_list(W, upgrades)) // Is a possible upgrade and isn't in the camera already. + if(!user.drop_item(W)) + return + to_chat(user, "You attach \the [W] into the assembly inner circuits.") + upgrades += W + W.forceMove(src) + return + + // Taking out upgrades + else if(istype(W, /obj/item/crowbar) && upgrades.len) + var/obj/U = locate(/obj) in upgrades + if(U) + to_chat(user, "You unattach an upgrade from the assembly.") + playsound(src.loc, W.usesound, 50, 1) + U.forceMove(drop_location()) + upgrades -= U + return + + return ..() + +/obj/structure/camera_assembly/proc/weld(obj/item/weldingtool/WT, mob/living/user) + if(!WT.remove_fuel(0, user)) + return 0 + to_chat(user, "You start to weld \the [src]...") + playsound(src.loc, WT.usesound, 50, 1) + if(do_after(user, 20*WT.toolspeed, target = src)) + if(WT.isOn()) + playsound(loc, 'sound/items/welder2.ogg', 50, 1) + return 1 + return 0 + +/obj/structure/camera_assembly/deconstruct(disassembled = TRUE) +>>>>>>> 8b54685... Cleanup to various loc assignments and nearby code (#31069) if(!(flags_1 & NODECONSTRUCT_1)) new /obj/item/stack/sheet/metal(loc) qdel(src) diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index 3f95d2a780..63c63ce120 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -45,14 +45,13 @@ if(!isarea(a)) return if(a.power_equip == 0) // There's no APC in this area, don't try to cheat power! - to_chat(user, "The [name] blinks red as you try to insert the cell!") + to_chat(user, "The [src] blinks red as you try to insert the cell!") return - if(!user.drop_item()) + if(!user.transferItemToLoc(W,src)) return - W.loc = src charging = W - user.visible_message("[user] inserts a cell into the charger.", "You insert a cell into the charger.") + user.visible_message("[user] inserts a cell into [src].", "You insert a cell into [src].") chargelevel = -1 updateicon() else if(istype(W, /obj/item/wrench)) @@ -61,7 +60,7 @@ return anchored = !anchored - to_chat(user, "You [anchored ? "attach" : "detach"] the cell charger [anchored ? "to" : "from"] the ground") + to_chat(user, "You [anchored ? "attach" : "detach"] [src] [anchored ? "to" : "from"] the ground") playsound(src.loc, W.usesound, 75, 1) else return ..() @@ -80,7 +79,7 @@ user.put_in_hands(charging) charging.add_fingerprint(user) - user.visible_message("[user] removes the cell from the charger.", "You remove the cell from the charger.") + user.visible_message("[user] removes [charging] from [src].", "You remove [charging] from [src].") removecell() diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index d9371d5678..485d56ced2 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /obj/machinery/computer/aifixer name = "\improper AI system integrity restorer" desc = "Used with intelliCards containing nonfunctioning AIs to restore them to working order." @@ -144,3 +145,151 @@ to_chat(user, "ERROR: Reconstruction in progress.") else if (!occupier) to_chat(user, "ERROR: Unable to locate artificial intelligence.") +======= +/obj/machinery/computer/aifixer + name = "\improper AI system integrity restorer" + desc = "Used with intelliCards containing nonfunctioning AIs to restore them to working order." + req_access = list(ACCESS_CAPTAIN, ACCESS_ROBOTICS, ACCESS_HEADS) + var/mob/living/silicon/ai/occupier = null + var/active = 0 + circuit = /obj/item/circuitboard/computer/aifixer + icon_keyboard = "tech_key" + icon_screen = "ai-fixer" + light_color = LIGHT_COLOR_PINK + +/obj/machinery/computer/aifixer/attackby(obj/I, mob/user, params) + if(occupier && istype(I, /obj/item/screwdriver)) + if(stat & (NOPOWER|BROKEN)) + to_chat(user, "The screws on [name]'s screen won't budge.") + else + to_chat(user, "The screws on [name]'s screen won't budge and it emits a warning beep.") + else + return ..() + +/obj/machinery/computer/aifixer/attack_hand(mob/user) + if(..()) + return + interact(user) + +/obj/machinery/computer/aifixer/interact(mob/user) + + var/dat = "" + + if (src.occupier) + var/laws + dat += "

Stored AI: [src.occupier.name]

" + dat += "System integrity: [(src.occupier.health+100)/2]%
" + + if (src.occupier.laws.zeroth) + laws += "0: [src.occupier.laws.zeroth]
" + + for (var/index = 1, index <= src.occupier.laws.ion.len, index++) + var/law = src.occupier.laws.ion[index] + if (length(law) > 0) + var/num = ionnum() + laws += "[num]: [law]
" + + var/number = 1 + for (var/index = 1, index <= src.occupier.laws.inherent.len, index++) + var/law = src.occupier.laws.inherent[index] + if (length(law) > 0) + laws += "[number]: [law]
" + number++ + + for (var/index = 1, index <= src.occupier.laws.supplied.len, index++) + var/law = src.occupier.laws.supplied[index] + if (length(law) > 0) + laws += "[number]: [law]
" + number++ + + dat += "Laws:
[laws]
" + + if (src.occupier.stat == DEAD) + dat += "AI non-functional" + else + dat += "AI functional" + if (!src.active) + dat += {"

Begin Reconstruction"} + else + dat += "

Reconstruction in process, please wait.
" + dat += {"
Close"} + var/datum/browser/popup = new(user, "computer", "AI System Integrity Restorer", 400, 500) + popup.set_content(dat) + popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) + popup.open() + return + +/obj/machinery/computer/aifixer/proc/Fix() + use_power(1000) + occupier.adjustOxyLoss(-1, 0) + occupier.adjustFireLoss(-1, 0) + occupier.adjustToxLoss(-1, 0) + occupier.adjustBruteLoss(-1, 0) + occupier.updatehealth() + occupier.updatehealth() + if(occupier.health >= 0 && occupier.stat == DEAD) + occupier.revive() + return occupier.health < 100 + +/obj/machinery/computer/aifixer/process() + if(..()) + if(active) + active = Fix() + updateDialog() + update_icon() + +/obj/machinery/computer/aifixer/Topic(href, href_list) + if(..()) + return + if(href_list["fix"]) + to_chat(usr, "Reconstruction in progress. This will take several minutes.") + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 25, 0) + active = TRUE + add_fingerprint(usr) + +/obj/machinery/computer/aifixer/update_icon() + ..() + if(stat & (NOPOWER|BROKEN)) + return + else + if(active) + add_overlay("ai-fixer-on") + if (occupier) + switch (occupier.stat) + if (0) + add_overlay("ai-fixer-full") + if (2) + add_overlay("ai-fixer-404") + else + add_overlay("ai-fixer-empty") + +/obj/machinery/computer/aifixer/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/device/aicard/card) + if(!..()) + return + //Downloading AI from card to terminal. + if(interaction == AI_TRANS_FROM_CARD) + if(stat & (NOPOWER|BROKEN)) + to_chat(user, "[src] is offline and cannot take an AI at this time!") + return + AI.forceMove(src) + occupier = AI + AI.control_disabled = 1 + AI.radio_enabled = 0 + to_chat(AI, "You have been uploaded to a stationary terminal. Sadly, there is no remote access from here.") + to_chat(user, "Transfer successful: [AI.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed.") + card.AI = null + update_icon() + + else //Uploading AI from terminal to card + if(occupier && !active) + to_chat(occupier, "You have been downloaded to a mobile storage device. Still no remote access.") + to_chat(user, "Transfer successful: [occupier.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory.") + occupier.forceMove(card) + card.AI = occupier + occupier = null + update_icon() + else if (active) + to_chat(user, "ERROR: Reconstruction in progress.") + else if (!occupier) + to_chat(user, "ERROR: Unable to locate artificial intelligence.") +>>>>>>> 8b54685... Cleanup to various loc assignments and nearby code (#31069) diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index db2bfedd7c..209bf5e47f 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -19,7 +19,7 @@ var/obj/item/weldingtool/WT = P if(!WT.remove_fuel(0, user)) if(!WT.isOn()) - to_chat(user, "The welding tool must be on to complete this task!") + to_chat(user, "[WT] must be on to complete this task!") return playsound(src.loc, P.usesound, 50, 1) to_chat(user, "You start deconstructing the frame...") @@ -40,14 +40,13 @@ state = 0 return if(istype(P, /obj/item/circuitboard/computer) && !circuit) - if(!user.drop_item()) + if(!user.transferItemToLoc(P, null)) return playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1) - to_chat(user, "You place the circuit board inside the frame.") + to_chat(user, "You place [P] inside the frame.") icon_state = "1" circuit = P circuit.add_fingerprint(user) - P.loc = null return else if(istype(P, /obj/item/circuitboard) && !circuit) @@ -55,16 +54,16 @@ return if(istype(P, /obj/item/screwdriver) && circuit) playsound(src.loc, P.usesound, 50, 1) - to_chat(user, "You screw the circuit board into place.") + to_chat(user, "You screw [circuit] into place.") state = 2 icon_state = "2" return if(istype(P, /obj/item/crowbar) && circuit) playsound(src.loc, P.usesound, 50, 1) - to_chat(user, "You remove the circuit board.") + to_chat(user, "You remove [circuit].") state = 1 icon_state = "0" - circuit.loc = src.loc + circuit.forceMove(drop_location()) circuit.add_fingerprint(user) circuit = null return diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 0548d94f3d..8a54bf3d86 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -54,22 +54,19 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) var/obj/item/card/id/idcard = O if(check_access(idcard)) if(!scan) - if(!usr.drop_item()) + if (!user.transferItemToLoc(idcard,src)) return - idcard.loc = src scan = idcard playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) else if(!modify) - if(!usr.drop_item()) + if (!user.transferItemToLoc(idcard,src)) return - idcard.loc = src modify = idcard playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) else if(!modify) - if(!usr.drop_item()) + if (!user.transferItemToLoc(idcard,src)) return - idcard.loc = src modify = idcard playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) else @@ -95,10 +92,10 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) /obj/machinery/computer/card/on_deconstruction() if(scan) - scan.forceMove(loc) + scan.forceMove(drop_location()) scan = null if(modify) - modify.forceMove(loc) + modify.forceMove(drop_location()) modify = null //Check if you can't open a new position for a certain job @@ -355,7 +352,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) if (modify) GLOB.data_core.manifest_modify(modify.registered_name, modify.assignment) modify.update_label() - modify.loc = loc + modify.forceMove(drop_location()) modify.verb_pickup() playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) modify = null @@ -364,26 +361,24 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) else var/obj/item/I = usr.get_active_held_item() if (istype(I, /obj/item/card/id)) - if(!usr.drop_item()) + if (!usr.transferItemToLoc(I,src)) return playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - I.loc = src modify = I authenticated = 0 if ("scan") if (scan) - scan.loc = src.loc + scan.forceMove(drop_location()) scan.verb_pickup() playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) scan = null else var/obj/item/I = usr.get_active_held_item() if (istype(I, /obj/item/card/id)) - if(!usr.drop_item()) + if (!usr.transferItemToLoc(I,src)) return playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - I.loc = src scan = I authenticated = 0 if ("auth") diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index ab7a639818..755a030565 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -21,6 +21,7 @@ /obj/machinery/computer/cloning/Initialize() . = ..() +<<<<<<< HEAD updatemodules(TRUE) /obj/machinery/computer/cloning/Destroy() @@ -124,6 +125,110 @@ to_chat(user, "You insert [W].") playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) src.updateUsrDialog() +======= + updatemodules(TRUE) + +/obj/machinery/computer/cloning/Destroy() + if(pods) + for(var/P in pods) + DetachCloner(P) + pods = null + return ..() + +/obj/machinery/computer/cloning/proc/GetAvailablePod(mind = null) + if(pods) + for(var/P in pods) + var/obj/machinery/clonepod/pod = P + if(pod.occupant && pod.clonemind == mind) + return null + if(pod.is_operational() && !(pod.occupant || pod.mess)) + return pod + +/obj/machinery/computer/cloning/proc/HasEfficientPod() + if(pods) + for(var/P in pods) + var/obj/machinery/clonepod/pod = P + if(pod.is_operational() && pod.efficiency > 5) + return TRUE + +/obj/machinery/computer/cloning/proc/GetAvailableEfficientPod(mind = null) + if(pods) + for(var/P in pods) + var/obj/machinery/clonepod/pod = P + if(pod.occupant && pod.clonemind == mind) + return pod + else if(!. && pod.is_operational() && !(pod.occupant || pod.mess) && pod.efficiency > 5) + . = pod + +/obj/machinery/computer/cloning/process() + if(!(scanner && LAZYLEN(pods) && autoprocess)) + return + + if(scanner.occupant && scanner.scan_level > 2) + scan_occupant(scanner.occupant) + + for(var/datum/data/record/R in records) + var/obj/machinery/clonepod/pod = GetAvailableEfficientPod(R.fields["mind"]) + + if(!pod) + return + + if(pod.occupant) + continue //how though? + + if(pod.growclone(R.fields["ckey"], R.fields["name"], R.fields["UI"], R.fields["SE"], R.fields["mind"], R.fields["mrace"], R.fields["features"], R.fields["factions"])) + records -= R + +/obj/machinery/computer/cloning/proc/updatemodules(findfirstcloner) + src.scanner = findscanner() + if(findfirstcloner && !LAZYLEN(pods)) + findcloner() + +/obj/machinery/computer/cloning/proc/findscanner() + var/obj/machinery/dna_scannernew/scannerf = null + + // Loop through every direction + for(dir in list(NORTH,EAST,SOUTH,WEST)) + + // Try to find a scanner in that direction + scannerf = locate(/obj/machinery/dna_scannernew, get_step(src, dir)) + + // If found and operational, return the scanner + if (!isnull(scannerf) && scannerf.is_operational()) + return scannerf + + // If no scanner was found, it will return null + return null + +/obj/machinery/computer/cloning/proc/findcloner() + var/obj/machinery/clonepod/podf = null + + for(dir in list(NORTH,EAST,SOUTH,WEST)) + + podf = locate(/obj/machinery/clonepod, get_step(src, dir)) + + if (!isnull(podf) && podf.is_operational()) + AttachCloner(podf) + +/obj/machinery/computer/cloning/proc/AttachCloner(obj/machinery/clonepod/pod) + if(!pod.connected) + pod.connected = src + LAZYADD(pods, pod) + +/obj/machinery/computer/cloning/proc/DetachCloner(obj/machinery/clonepod/pod) + pod.connected = null + LAZYREMOVE(pods, pod) + +/obj/machinery/computer/cloning/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/disk/data)) //INSERT SOME DISKETTES + if (!src.diskette) + if (!user.transferItemToLoc(W,src)) + return + src.diskette = W + to_chat(user, "You insert [W].") + playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) + src.updateUsrDialog() +>>>>>>> 8b54685... Cleanup to various loc assignments and nearby code (#31069) else if(istype(W, /obj/item/device/multitool)) var/obj/item/device/multitool/P = W @@ -315,6 +420,7 @@ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) else scanner.locked = FALSE +<<<<<<< HEAD playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) else if(href_list["view_rec"]) @@ -500,3 +606,190 @@ src.records += R scantemp = "Subject successfully scanned." playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) +======= + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + + else if(href_list["view_rec"]) + playsound(src, "terminal_type", 25, 0) + src.active_record = find_record("id", href_list["view_rec"], records) + if(active_record) + if(!active_record.fields["ckey"]) + records -= active_record + active_record = null + src.temp = "Record Corrupt" + else + src.menu = 3 + else + src.temp = "Record missing." + + else if (href_list["del_rec"]) + if ((!src.active_record) || (src.menu < 3)) + return + if (src.menu == 3) //If we are viewing a record, confirm deletion + src.temp = "Delete record?" + src.menu = 4 + playsound(src, 'sound/machines/terminal_prompt.ogg', 50, 0) + + else if (src.menu == 4) + var/obj/item/card/id/C = usr.get_active_held_item() + if (istype(C)||istype(C, /obj/item/device/pda)) + if(src.check_access(C)) + src.temp = "[src.active_record.fields["name"]] => Record deleted." + src.records.Remove(active_record) + active_record = null + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + src.menu = 2 + else + src.temp = "Access Denied." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + + else if (href_list["disk"]) //Load or eject. + switch(href_list["disk"]) + if("load") + if (!diskette || !istype(diskette.fields) || !diskette.fields["name"] || !diskette.fields) + src.temp = "Load error." + src.updateUsrDialog() + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + if (!src.active_record) + src.temp = "Record error." + src.menu = 1 + src.updateUsrDialog() + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + + for(var/key in diskette.fields) + src.active_record.fields[key] = diskette.fields[key] + src.temp = "Load successful." + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + + if("eject") + if(src.diskette) + src.diskette.forceMove(drop_location()) + src.diskette = null + playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) + if("save") + if(!diskette || diskette.read_only || !active_record || !active_record.fields) + src.temp = "Save error." + src.updateUsrDialog() + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + + diskette.fields = active_record.fields.Copy() + diskette.name = "data disk - '[src.diskette.fields["name"]]'" + src.temp = "Save successful." + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + + else if (href_list["refresh"]) + src.updateUsrDialog() + playsound(src, "terminal_type", 25, 0) + + else if (href_list["clone"]) + var/datum/data/record/C = find_record("id", href_list["clone"], records) + //Look for that player! They better be dead! + if(C) + var/obj/machinery/clonepod/pod = GetAvailablePod() + //Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs. + if(!LAZYLEN(pods)) + temp = "No Clonepods detected." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + else if(!pod) + temp = "No Clonepods available." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + else if(!CONFIG_GET(flag/revival_cloning)) + temp = "Unable to initiate cloning cycle." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + else if(pod.occupant) + temp = "Cloning cycle already in progress." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + else if(pod.growclone(C.fields["ckey"], C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["features"], C.fields["factions"])) + temp = "[C.fields["name"]] => Cloning cycle in progress..." + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + records.Remove(C) + if(active_record == C) + active_record = null + menu = 1 + else + temp = "[C.fields["name"]] => Initialisation failure." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + + else + temp = "Data corruption." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + + else if (href_list["menu"]) + src.menu = text2num(href_list["menu"]) + playsound(src, "terminal_type", 25, 0) + + src.add_fingerprint(usr) + src.updateUsrDialog() + return + +/obj/machinery/computer/cloning/proc/scan_occupant(occupant) + var/mob/living/mob_occupant = get_mob_or_brainmob(occupant) + var/datum/dna/dna + if(iscarbon(mob_occupant)) + var/mob/living/carbon/C = mob_occupant + dna = C.has_dna() + if(isbrain(mob_occupant)) + var/mob/living/brain/B = mob_occupant + dna = B.stored_dna + + if(!istype(dna)) + scantemp = "Unable to locate valid genetic data." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + if(mob_occupant.suiciding || mob_occupant.hellbound) + scantemp = "Subject's brain is not responding to scanning stimuli." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + if((mob_occupant.disabilities & NOCLONE) && (src.scanner.scan_level < 2)) + scantemp = "Subject no longer contains the fundamental materials required to create a living clone." + playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0) + return + if ((!mob_occupant.ckey) || (!mob_occupant.client)) + scantemp = "Mental interface failure." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + if (find_record("ckey", mob_occupant.ckey, records)) + scantemp = "Subject already in database." + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + return + + var/datum/data/record/R = new() + if(dna.species) + // We store the instance rather than the path, because some + // species (abductors, slimepeople) store state in their + // species datums + R.fields["mrace"] = dna.species + else + var/datum/species/rando_race = pick(CONFIG_GET(keyed_flag_list/roundstart_races)) + R.fields["mrace"] = rando_race.type + + R.fields["ckey"] = mob_occupant.ckey + R.fields["name"] = mob_occupant.real_name + R.fields["id"] = copytext(md5(mob_occupant.real_name), 2, 6) + R.fields["UE"] = dna.unique_enzymes + R.fields["UI"] = dna.uni_identity + R.fields["SE"] = dna.struc_enzymes + R.fields["blood_type"] = dna.blood_type + R.fields["features"] = dna.features + R.fields["factions"] = mob_occupant.faction + + if (!isnull(mob_occupant.mind)) //Save that mind so traitors can continue traitoring after cloning. + R.fields["mind"] = "\ref[mob_occupant.mind]" + + //Add an implant if needed + var/obj/item/implant/health/imp + for(var/obj/item/implant/health/HI in mob_occupant.implants) + imp = HI + break + if(!imp) + imp = new /obj/item/implant/health(mob_occupant) + imp.implant(mob_occupant) + R.fields["imp"] = "\ref[imp]" + + src.records += R + scantemp = "Subject successfully scanned." + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) +>>>>>>> 8b54685... Cleanup to various loc assignments and nearby code (#31069) diff --git a/code/game/machinery/computer/dna_console.dm b/code/game/machinery/computer/dna_console.dm index 105fb64042..5f2324f236 100644 --- a/code/game/machinery/computer/dna_console.dm +++ b/code/game/machinery/computer/dna_console.dm @@ -43,9 +43,8 @@ /obj/machinery/computer/scan_consolenew/attackby(obj/item/I, mob/user, params) if (istype(I, /obj/item/disk/data)) //INSERT SOME DISKETTES if (!src.diskette) - if(!user.drop_item()) + if (!user.transferItemToLoc(I,src)) return - I.loc = src src.diskette = I to_chat(user, "You insert [I].") src.updateUsrDialog() @@ -448,7 +447,7 @@ diskette.fields = buffer_slot.Copy() if("ejectdisk") if(diskette) - diskette.loc = get_turf(src) + diskette.forceMove(drop_location()) diskette = null if("setdelayed") if(num) diff --git a/code/game/machinery/computer/gulag_teleporter.dm b/code/game/machinery/computer/gulag_teleporter.dm index c416d93e58..d80dc73f15 100644 --- a/code/game/machinery/computer/gulag_teleporter.dm +++ b/code/game/machinery/computer/gulag_teleporter.dm @@ -27,9 +27,8 @@ /obj/machinery/computer/gulag_teleporter_computer/attackby(obj/item/W, mob/user) if(istype(W, /obj/item/card/id/prisoner)) if(!id) - if(!user.drop_item()) + if (!user.transferItemToLoc(W,src)) return - W.forceMove(src) id = W to_chat(user, "You insert [W].") return