diff --git a/Code/!atoms.dm b/Code/!atoms.dm index 45e0aba..99933e9 100644 --- a/Code/!atoms.dm +++ b/Code/!atoms.dm @@ -32,8 +32,7 @@ #define ONBELT 128 // can be put in belt slot #define FPRINT 256 // takes a fingerprint #define WINDOW 512 // window or window/door (or injector) - - + // channel numbers for power #define EQUIP 1 @@ -47,8 +46,6 @@ #define POWEROFF 4 // tbd #define MAINT 8 // under maintaince - - /atom layer = 2.0 var/level = 2.0 @@ -161,6 +158,7 @@ var/mode = "random" var/event_time = null var/event = 0 + var/burningo2 = 0 /datum/control/poll //name = "poll" @@ -217,13 +215,19 @@ var/votenodefault = 0 // vote does not default to nochange/norestart (tbi) var/votenodead = 0 // dead people can't vote (tbi) var/list/modes = list("extended", "traitor", "meteor", "monkey", "blob", "nuclear") // modes to choose between - var/list/pickprob = list() // relative probability of each mode + var/list/pickprob = list() // relative probability of each mode var/allowai = 1 // allow ai job var/bombtemp_determines_range = 0 var/crowbars_close_depowered_doors = 0 var/ai_can_call_shuttle = 0 var/ai_can_uncall_shuttle = 0 var/alternate_ai_laws = 0 + var/air_pressure_flow = 0 + var/min_gas_for_fire = 900000 // This sets the amount of gas needed for a fire in a tile to keep going, or for it to spread to another tile. The default is 900,000 units. + var/meteorchance = 0.1 + var/enable_drones = 0 + var/humans_can_use_drones = 0 + var/walkable_not_pullable_drones = 0 /datum/vote var/voting = 0 // true if currently voting @@ -346,7 +350,11 @@ var/start = null var/disable_one_click = 0 var/favorite_hud = 0 - + var/currentDrone = null + var/droneTransitioning = 0 + var/cameraFollow = null + var/now_pushing = null + var/list/organs = list( ) var/list/grabbed_by = list( ) var/list/requests = list( ) @@ -397,7 +405,6 @@ var/obj/item/weapon/l_store = null var/icon/stand_icon = null var/icon/lying_icon = null - var/now_pushing = null var/t_plasma = 0.0 var/t_oxygen = 0.0 var/last_b_state = 1.0 @@ -405,8 +412,7 @@ var/image/face2 = null var/h_style_r = "hair_a" weight = 2500000.0 - var/cameraFollow = null - + var/list/body_standing = list( ) var/list/body_lying = list( ) @@ -419,9 +425,7 @@ var/t_oxygen = null var/t_sl_gas = null var/t_n2 = null - var/now_pushing = null flags = 258.0 - var/cameraFollow = null /mob/megamonkey name = "mutant monkey" diff --git a/Code/Item/Weapon/aimodules.dm b/Code/Item/Weapon/aimodules.dm index d54cc05..323d66e 100644 --- a/Code/Item/Weapon/aimodules.dm +++ b/Code/Item/Weapon/aimodules.dm @@ -25,18 +25,18 @@ /obj/item/weapon/aiModule/proc/install(var/obj/machinery/computer/aiupload/comp) if(comp.stat & NOPOWER) - usr << "The upload computer has no power!" + usr.client_mob() << "The upload computer has no power!" return if(comp.stat & BROKEN) - usr << "The upload computer is broken!" + usr.client_mob() << "The upload computer is broken!" return var/found=0 for(var/mob/ai/M in world) if (M.stat == 2) - usr << "Upload failed. No signal is being detected from the AI." + usr.client_mob() << "Upload failed. No signal is being detected from the AI." else if (M.see_in_dark == 0) - usr << "Upload failed. Only a faint signal is being detected from the AI, and it is not responding to our requests. It may be low on power." + usr.client_mob() << "Upload failed. Only a faint signal is being detected from the AI, and it is not responding to our requests. It may be low on power." else src.transmitInstructions(M, usr) if (M != ticker.killer) @@ -45,7 +45,7 @@ usr << "Upload complete. The AI's laws have been modified." found=1 if (!found) - usr << "Upload failed. No signal is being detected from the AI." + usr.client_mob() << "Upload failed. No signal is being detected from the AI." /obj/item/weapon/aiModule/proc/transmitInstructions(var/mob/ai/target, var/mob/sender) if (ticker.killer == target) diff --git a/Code/Machinery/Atmoalter/canister.dm b/Code/Machinery/Atmoalter/canister.dm index 3f34ddd..9fd7047 100644 --- a/Code/Machinery/Atmoalter/canister.dm +++ b/Code/Machinery/Atmoalter/canister.dm @@ -245,13 +245,15 @@ Pipe Valve Status: [ct]
Close
"} - user << browse(dat, "window=canister;size=600x300") + user.client_mob() << browse(dat, "window=canister;size=600x300") return // Process topic link from interaction window Topic(href, href_list) + usr.client_mob() << "Topic on canister, usr is [usr], src is [src], usr.client_mob() is [usr.client_mob()], href is ([href]), href_list is ([href_list])." + ..() if (usr.stat || usr.restrained()) return @@ -306,7 +308,7 @@ Pipe Valve Status: [ct]
update_icon() else - usr << browse(null, "window=canister") + usr.client_mob() << browse(null, "window=canister") // Attack by an object diff --git a/Code/Machinery/Atmoalter/heater.dm b/Code/Machinery/Atmoalter/heater.dm index 501bb77..a09387b 100644 --- a/Code/Machinery/Atmoalter/heater.dm +++ b/Code/Machinery/Atmoalter/heater.dm @@ -151,7 +151,7 @@ obj/machinery/atmoalter/heater ct = "Disconnected" var/dat = text("Canister Valves
\nContains/Capacity [] / []
\nUpper Valve Status: [][]
\n\tM - - - - [] + + + + M
\nHeater Status: [] - []
\n\tTrg Tmp: - - - [] + + +
\n
\nPipe Valve Status: []
\n\tM - - - - [] + + + + M
\n
\nClose
\n
", src.gas.tot_gas(), src.maximum, tt, (src.holding ? text("
Tank ([])", src, src.holding.gas.tot_gas()) : null), src, num2text(1000000.0, 7), src, src, src, src, src.t_per, src, src, src, src, src, num2text(1000000.0, 7), ht, (src.gas.tot_gas() ? (src.gas.temperature-T0C) : 20), src, src, src, src.h_tar, src, src, src, ct, src, num2text(1000000.0, 7), src, src, src, src, src.c_per, src, src, src, src, src, num2text(1000000.0, 7), user) - user << browse(dat, "window=canister;size=600x300") + user.client_mob() << browse(dat, "window=canister;size=600x300") return @@ -215,7 +215,7 @@ obj/machinery/atmoalter/heater src.updateDialog() src.add_fingerprint(usr) else - usr << browse(null, "window=canister") + usr.client_mob() << browse(null, "window=canister") return return diff --git a/Code/Machinery/Atmoalter/siphs.dm b/Code/Machinery/Atmoalter/siphs.dm index f98d4a6..fd354eb 100644 --- a/Code/Machinery/Atmoalter/siphs.dm +++ b/Code/Machinery/Atmoalter/siphs.dm @@ -36,8 +36,8 @@ obj/machinery/atmoalter/siphs * fullairsiphon/air_vent - Air Regulator - Vent on floor, same as fullairsiphon but cannot hold a tank. * * scrubbers - Scrubber - Can hold a tank. Starts empty. Automatic process removes toxins from air and stores in gas content. - * scubbers/port - Portable Scrubber - same as scrubbers but pushable. - * scubbers/air_filter - Air Filter - Vent on floor, same as scrubbers but cannot hold a tank. + * scrubbers/port - Portable Scrubber - same as scrubbers but pushable. + * scrubbers/air_filter - Air Filter - Vent on floor, same as scrubbers but cannot hold a tank. */ // new siphon object, create the gas content and set maximum capacity @@ -212,7 +212,7 @@ obj/machinery/atmoalter/siphs use_power(50, ENVIRON) if (T) - if (T.firelevel > 900000.0) + if (T.firelevel > config.min_gas_for_fire) src.f_time = world.time + 300 // shut off automatic operation for 30 seconds if fire present else if (world.time > src.f_time) @@ -273,7 +273,7 @@ obj/machinery/atmoalter/siphs if (src.t_status == 4) at = "Automatic On Stop" var/dat = text("Canister Valves []
\n\tContains/Capacity [] / []
\n\tUpper Valve Status: [] []
\n\t\tM - - - - [] + + + + M
\n\tPipe Valve Status: []
\n\t\tM - - - - [] + + + + M
\n
\n\nClose
\n\t
", (!( src.alterable ) ? "Valves are locked. Unlock with wrench!" : "You can lock this interface with a wrench."), num2text(src.gas.tot_gas(), 10), num2text(src.maximum, 10), (src.t_status == 4 ? text("[]", at) : text("[]", tt)), (src.holding ? text("
(Tank ([])", src, src.holding.gas.tot_gas()) : null), src, num2text(max_valve, 7), src, src, src, src, src.t_per, src, src, src, src, src, num2text(max_valve, 7), ct, src, num2text(max_valve, 7), src, src, src, src, src.c_per, src, src, src, src, src, num2text(max_valve, 7), user) - user << browse(dat, "window=siphon;size=600x300") + user.client_mob() << browse(dat, "window=siphon;size=600x300") return @@ -332,7 +332,7 @@ obj/machinery/atmoalter/siphs src.updateDialog() src.add_fingerprint(usr) else - usr << browse(null, "window=canister") + usr.client_mob() << browse(null, "window=canister") return return @@ -373,9 +373,9 @@ obj/machinery/atmoalter/siphs else if (istype(W, /obj/item/weapon/wrench)) // lock/unlock the interface src.alterable = !( src.alterable ) if (src.alterable) - user << "\blue You unlock the interface!" + user.client_mob() << "\blue You unlock the interface!" else - user << "\blue You lock the interface!" + user.client_mob() << "\blue You lock the interface!" /* @@ -509,7 +509,7 @@ obj/machinery/atmoalter/siphs if (istype(T, /turf)) if (locate(/obj/move, T)) T = locate(/obj/move, T) - if (T.firelevel < 900000.0) + if (T.firelevel < config.min_gas_for_fire) src.gas.turf_add_all_oxy(T) else @@ -555,7 +555,7 @@ obj/machinery/atmoalter/siphs if(4.0) // 4 = automatic mode if( !portable() ) use_power(50, ENVIRON) if (T) - if (T.firelevel > 900000.0) + if (T.firelevel > config.min_gas_for_fire) src.f_time = world.time + 300 // disable automatic mode for 30 seconds if a fire present else if (world.time > src.f_time) @@ -568,10 +568,7 @@ obj/machinery/atmoalter/siphs // Pipe valve status handled by /obj/machinery/connector/process() src.setstate() - for(var/mob/M in viewers(1, src)) - if ((M.client && M.machine == src)) - src.attack_hand(M) - //Foreach goto(654) + src.updateDialog() return diff --git a/Code/Machinery/Computer/airtunnel.dm b/Code/Machinery/Computer/airtunnel.dm index 51fee05..e7e7d82 100644 --- a/Code/Machinery/Computer/airtunnel.dm +++ b/Code/Machinery/Computer/airtunnel.dm @@ -112,7 +112,7 @@ obj/machinery/computer/airtunnel dat += "RELEASE (Siphons only) Siphon (Siphons only) Stop Regulate
" dat += "

Close" - user << browse(dat, "window=computer;size=400x500") + user.client_mob() << browse(dat, "window=computer;size=400x500") // Handle topic links from interaction window @@ -123,8 +123,9 @@ obj/machinery/computer/airtunnel if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" - return + if (!istype(usr, /mob/drone)) + usr.client_mob() << "\red You don't have the dexterity to do this!" + return if ((usr.stat || usr.restrained())) if (!istype(usr, /mob/ai)) return diff --git a/Code/Machinery/Computer/atmosphere.dm b/Code/Machinery/Computer/atmosphere.dm index 7abc2d0..73c2096 100644 --- a/Code/Machinery/Computer/atmosphere.dm +++ b/Code/Machinery/Computer/atmosphere.dm @@ -59,7 +59,7 @@ obj/machinery/computer/atmosphere if(stat & NOPOWER) return if (usr.stat) return - usr << "Starting all siphon systems." + usr.client_mob() << "Starting all siphon systems." for(var/obj/machinery/atmoalter/siphs/S in src.returnarea()) S.reset(1, 0) src.add_fingerprint(usr) @@ -72,7 +72,7 @@ obj/machinery/computer/atmosphere if(stat & NOPOWER) return if (usr.stat) return - usr << "Stopping all siphon systems." + usr.client_mob() << "Stopping all siphon systems." for(var/obj/machinery/atmoalter/siphs/S in src.returnarea()) S.reset(0, 0) src.add_fingerprint(usr) @@ -85,7 +85,7 @@ obj/machinery/computer/atmosphere if(stat & NOPOWER) return if (usr.stat) return - usr << "Starting automatic air control systems." + usr.client_mob() << "Starting automatic air control systems." for(var/obj/machinery/atmoalter/siphs/S in src.returnarea()) S.reset(0, 1) src.add_fingerprint(usr) @@ -99,7 +99,7 @@ obj/machinery/computer/atmosphere if(stat & NOPOWER) return if (usr.stat) return - usr << "Releasing all scrubber toxins." + usr.client_mob() << "Releasing all scrubber toxins." for(var/obj/machinery/atmoalter/siphs/scrubbers/S in src.returnarea()) S.reset(-1.0, 0) src.add_fingerprint(usr) @@ -112,7 +112,7 @@ obj/machinery/computer/atmosphere if(stat & NOPOWER) return if (usr.stat) return - usr << "Releasing all stored air." + usr.client_mob() << "Releasing all stored air." for(var/obj/machinery/atmoalter/siphs/S in src.returnarea()) S.reset(-1.0, 0) src.add_fingerprint(usr) diff --git a/Code/Machinery/Computer/card.dm b/Code/Machinery/Computer/card.dm index 0ca73fd..236a49b 100644 --- a/Code/Machinery/Computer/card.dm +++ b/Code/Machinery/Computer/card.dm @@ -146,7 +146,7 @@ obj/machinery/computer/card dat = text("Identification Card Modifier
\nPlease Insert the cards into the slots
\nTarget: []
\nConfirm Identity: []
\n-----------------
\n[]
\n
\n
\nAccess Crew Manifest
\n
", src, (src.modify ? text("[]", src.modify.name) : "----------"), src, (src.scan ? text("[]", src.scan.name) : "----------"), d1, src) else dat = text("[]
\n[]
\n[] []
\n[] []
\n-----------------
\n[]
\n
\n
\n[]
\n
", stars("Identification Card Modifier"), stars("Please Insert the cards into the slots"), stars("Target:"), src, (src.modify ? text("[]", stars(src.modify.name)) : "----------"), stars("Confirm Identity:"), src, (src.scan ? text("[]", stars(src.scan.name)) : "----------"), d1, src, stars("Access Crew Manifest")) - user << browse(dat, "window=id_com;size=400x500") + user.client_mob() << browse(dat, "window=id_com;size=400x500") // Handle topic links from interaction window @@ -155,7 +155,7 @@ obj/machinery/computer/card ..() if(stat & (NOPOWER|BROKEN)) - usr << browse(null, "window=id_com") + usr.client_mob() << browse(null, "window=id_com") return if(usr.restrained() || usr.lying) @@ -164,7 +164,7 @@ obj/machinery/computer/card if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" + usr.client_mob() << "\red You don't have the dexterity to do this!" return if ((usr.stat || usr.restrained())) if (!istype(usr, /mob/ai)) @@ -206,7 +206,7 @@ obj/machinery/computer/card src.authenticated = 1 else if (!href_list["print"]) if ((!( src.authenticated ) && (istype(usr, /mob/ai))) && (!src.modify)) - usr << "You can't modify an ID without an ID inserted to modify. Once one is in the modify slot on the computer, you can log in." + usr.client_mob() << "You can't modify an ID without an ID inserted to modify. Once one is in the modify slot on the computer, you can log in." if (href_list["vo"]) if (src.authenticated) @@ -274,13 +274,11 @@ obj/machinery/computer/card if (src.modify) src.modify.name = "[src.modify.registered]'s ID Card ([src.modify.access_level]>[src.modify.lab_access]-[src.modify.engine_access]-[src.modify.air_access])" - for(var/mob/M in viewers(1, src)) - if ((M.client && M.machine == src)) - src.attack_hand(M) + src.updateDialog() src.add_fingerprint(usr) else - usr << browse(null, "window=id_com") + usr.client_mob() << browse(null, "window=id_com") // Called when area power state changes diff --git a/Code/Machinery/Computer/data.dm b/Code/Machinery/Computer/data.dm index a2207a2..9b695cd 100644 --- a/Code/Machinery/Computer/data.dm +++ b/Code/Machinery/Computer/data.dm @@ -21,9 +21,9 @@ obj/machinery/computer/data set src in oview(1) for(var/x in src.topics) - usr << "[x], \..." + usr.client_mob() << "[x], \..." - usr << "" + usr.client_mob() << "" src.add_fingerprint(usr) return @@ -34,9 +34,9 @@ obj/machinery/computer/data set src in oview(1) if (src.topics[text("[]", topic)]) - usr << "[topic]\n\t [src.topics["[topic]"]]" + usr.client_mob() << "[topic]\n\t [src.topics["[topic]"]]" else - usr << "Unable to find- [topic]" + usr.client_mob() << "Unable to find- [topic]" src.add_fingerprint(usr) return @@ -81,7 +81,7 @@ obj/machinery/computer/data display() set src in oview(1) - usr << "Research Information:" + usr.client_mob() << "Research Information:" ..() return @@ -108,7 +108,7 @@ obj/machinery/computer/data display() set src in oview(1) - usr << "Research Log:" + usr.client_mob() << "Research Log:" ..() return diff --git a/Code/Machinery/Computer/drone_control.dm b/Code/Machinery/Computer/drone_control.dm new file mode 100644 index 0000000..ef1c694 --- /dev/null +++ b/Code/Machinery/Computer/drone_control.dm @@ -0,0 +1,58 @@ +/obj/machinery/computer/drone_control + name = "Drone Control Station" + icon = 'stationobjs.dmi' + icon_state = "drone_control" + var/mob/user = null + + New() + spawn(10) + while (!config) + sleep(10) + if ((!config.humans_can_use_drones) || (!config.enable_drones)) + del(src) + + attack_hand(var/mob/user as mob) + if(stat & (NOPOWER|BROKEN) ) return + if (!config.humans_can_use_drones) + return + if (user.currentDrone) + return + if (istype(user, /mob/drone)) + return + + var/list/L = list( ) + user.machine = src + + var/numDrones = 0 + for(var/mob/drone/rob in world) + if (rob.stat==0) + L[rob.name] = rob + numDrones+=1 + L = sortList(L) + + L["Cancel"] = "Cancel" + var/t = input(user, "Which drone would you like to change to?") as null|anything in L + + if(!t) + user.machine = null + user.reset_view(null) + return 0 + if (t == "Cancel") + user.machine = null + user.reset_view(null) + return 0 + + var/selected = L[t] + if (istype(selected, /mob/drone)) + user.machine = null + user.reset_view(null) + selected:use_via_drone_control(user) + return + + attack_ai(var/mob/user as mob) + user << "To control a drone, click it. The drone control stations are for humans." + return + + attack_paw(var/mob/user as mob) + user << "Monkeys can't control drones." + return diff --git a/Code/Machinery/Computer/engine.dm b/Code/Machinery/Computer/engine.dm index 25775d0..61d0871 100644 --- a/Code/Machinery/Computer/engine.dm +++ b/Code/Machinery/Computer/engine.dm @@ -40,9 +40,7 @@ return use_power(250) - for(var/mob/M in viewers(1, src)) - if ((M.client && M.machine == src)) - src.attack_hand(M) + src.updateDialog() // Attackby object - pass through to interact @@ -85,7 +83,7 @@ dat = "Engine Ejection Module
\nStatus: Ejecting
\n
\nCountdown: [engine_eject_control.timeleft]/60 \[Reset\]
\n
\nStop Ejection
\n
\nClose" else dat = "Engine Ejection Module
\nStatus: Ejected
\n
\nCountdown: N/60 \[Reset\]
\n
\nEngine Ejected!
\n
\nClose" - user << browse(dat, "window=computer;size=400x500") + user.client_mob() << browse(dat, "window=computer;size=400x500") // Handle topic links from interaction window @@ -94,8 +92,9 @@ ..() if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" - return + if (!istype(usr, /mob/drone)) + usr.client_mob() << "\red You don't have the dexterity to do this!" + return if ((usr.stat || usr.restrained())) if (!istype(usr, /mob/ai)) return @@ -114,7 +113,7 @@ engine_eject_control.ejectstart() src.temp = null else - usr << "\red Access Denied." + usr.client_mob() << "\red Access Denied." else if (href_list["stop"]) if (engine_eject_control.status > 0) src.temp = text("Stop Ejection?

Yes
No", src, src) diff --git a/Code/Machinery/Computer/hologram.dm b/Code/Machinery/Computer/hologram.dm index 119f4ed..6be021f 100644 --- a/Code/Machinery/Computer/hologram.dm +++ b/Code/Machinery/Computer/hologram.dm @@ -85,7 +85,7 @@ Hair Color: ([h_r],[h_g],[h_b]) \[Reset\] Red (0-255): \[0\] -10 -1 [h_r] 1 10 \[255\]
Green (0-255): \[0\] -10 -1 [h_g] 1 10 \[255\]
Blue (0-255): \[0\] -10 -1 [h_b] 1 10 \[255\]
"} - user << browse(dat, "window=hologram_console") + user.client_mob() << browse(dat, "window=hologram_console") // Handle topic links from window @@ -131,9 +131,7 @@ Blue (0-255): \[0\] {Log In}" - user << browse("Medical Records[dat]", "window=med_rec") + user.client_mob() << browse("Medical Records[dat]", "window=med_rec") diff --git a/Code/Machinery/Computer/pod.dm b/Code/Machinery/Computer/pod.dm index aa75317..ec7a31e 100644 --- a/Code/Machinery/Computer/pod.dm +++ b/Code/Machinery/Computer/pod.dm @@ -43,7 +43,9 @@ obj/machinery/computer/pod if(stat & (NOPOWER|BROKEN)) return if (!( src.connected )) - viewers(null, null) << "Cannot locate mass driver connector. Cancelling firing sequence!" + var/list/observers = viewers(null, null) + for (var/mob/who in observers) + who.client_mob() << "Cannot locate mass driver connector. Cancelling firing sequence!" return for(var/obj/machinery/door/poddoor/M in machines) @@ -116,7 +118,7 @@ Time Left: [(minute ? "[minute]:" : null)][second] Toggle Outer Door
" dat += "

Close" - user << browse(dat, "window=computer;size=400x500") + user.client_mob() << browse(dat, "window=computer;size=400x500") // Handle topic links from interaction window @@ -125,7 +127,7 @@ Time Left: [(minute ? "[minute]:" : null)][second] Restabalizing prison shuttle atmosphere!" + var/list/observers = viewers(null, null) + for (var/mob/who in observers) + who.client_mob() << "\red Restabilizing prison shuttle atmosphere!" var/A = locate(/area/shuttle_prison) for(var/obj/move/T in A) T.firelevel = 0 @@ -93,5 +95,7 @@ obj/machinery/computer/prison_shuttle T.otemp = T20C T.ttemp = T20C - viewers(null, null) << "\red Prison shuttle Restabalized!" + observers = viewers(null, null) + for (var/mob/who in observers) + who.client_mob() << "\red Prison shuttle Restabilized!" src.add_fingerprint(usr) diff --git a/Code/Machinery/Computer/secure_data.dm b/Code/Machinery/Computer/secure_data.dm index a34e29c..7fb65ea 100644 --- a/Code/Machinery/Computer/secure_data.dm +++ b/Code/Machinery/Computer/secure_data.dm @@ -79,7 +79,7 @@ obj/machinery/computer/secure_data else else dat += text("{Log In}", src) - user << browse(text("Security Records[]", dat), "window=secure_rec") + user.client_mob() << browse(text("Security Records[]", dat), "window=secure_rec") // Handle topic links diff --git a/Code/Machinery/Computer/shuttle.dm b/Code/Machinery/Computer/shuttle.dm index 5fae624..4efb57f 100644 --- a/Code/Machinery/Computer/shuttle.dm +++ b/Code/Machinery/Computer/shuttle.dm @@ -22,7 +22,7 @@ obj/machinery/computer/shuttle verb/restabalize() set src in oview(1) - world << "\red Restabalizing shuttle atmosphere!" + world << "\red Restabilizing shuttle atmosphere!" var/A = locate(/area/shuttle) for(var/obj/move/T in A) T.firelevel = 0 @@ -45,7 +45,7 @@ obj/machinery/computer/shuttle T.otemp = T20C T.ttemp = T20C - world << "\red Shuttle Restabalized!" + world << "\red Shuttle Restabilized!" src.add_fingerprint(usr) @@ -75,7 +75,7 @@ obj/machinery/computer/shuttle if ((!( istype(W, /obj/item/weapon/card/id) ) || !( ticker ) || ticker.shuttle_location == shuttle_z || !( user ))) return if (!W.check_access(access, allowed)) - user << text("The access level ([]) of [] card is not high enough. ", W.access_level, W.registered) + user.client_mob() << text("The access level ([]) of [] card is not high enough. ", W.access_level, W.registered) return var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort") switch(choice) diff --git a/Code/Machinery/Door/_door.dm b/Code/Machinery/Door/_door.dm index 86c864a..fae41d7 100644 --- a/Code/Machinery/Door/_door.dm +++ b/Code/Machinery/Door/_door.dm @@ -84,13 +84,19 @@ obj/machinery/door // Attack with hand. If human and wearing an ID, same as attacking with the ID attack_hand(mob/user as mob) + if (istype(user, /mob/drone)) + if (user:controlledBy != null) + user = user:controlledBy + if(istype(user, /mob/human)) var/mob/human/H = user if(H.wear_id) attackby(H.wear_id, user) else if(istype(user, /mob/ai)) attackby(user, user) - + + + // Does it accept IDs? proc/acceptsIDs() diff --git a/Code/Machinery/Door/airlock.dm b/Code/Machinery/Door/airlock.dm index 02291b8..4821d15 100644 --- a/Code/Machinery/Door/airlock.dm +++ b/Code/Machinery/Door/airlock.dm @@ -109,7 +109,7 @@ About the new airlock wires panel: if (src.locked!=1) src.locked = 1 else - usr << "You hear a click from the bottom of the door." + usr.client_mob() << "You hear a click from the bottom of the door." if (AIRLOCK_WIRE_BACKUP_POWER1 || AIRLOCK_WIRE_BACKUP_POWER2) //two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter). src.loseBackupPower() @@ -132,7 +132,7 @@ About the new airlock wires panel: src.locked=0 src.updateDialog() else - usr << "You hear a click or thump sound from inside the door." + usr.client_mob() << "You hear a click or thump sound from inside the door." if (AIRLOCK_WIRE_ELECTRIFY) //one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds. if (src.secondsElectrified!=-1) @@ -289,21 +289,6 @@ About the new airlock wires panel: proc/get_connection() var/turf/T = src.loc if(!istype(T, /turf/station/floor)) - - - - - - - - - - - - - - - return for(var/obj/cable/C in T) @@ -355,24 +340,6 @@ About the new airlock wires panel: if (src.secondsBackupPowerLost > 0) if ((!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2))) t1 += text("Backup power is offline for [] seconds.
\n", src.secondsBackupPowerLost) - - - - - - - - - - - - - - - - - - else t1 += text("Backup power is offline indefinitely.
\n") else if (src.secondsMainPowerLost > 0) @@ -442,7 +409,7 @@ About the new airlock wires panel: t1 += text("Cannot close door due to power failure.
\n") t1 += text("

Close

\n", src) - user << browse(t1, "window=airlock") + user.client_mob() << browse(t1, "window=airlock") //aiDisable - 1 idscan, 2 disrupt main power, 3 disrupt backup power, 4 drop door bolts, 5 un-electrify door, 7 close door //aiEnable - 1 idscan, 4 raise door bolts, 5 electrify door for 30 seconds, 6 electrify door indefinitely, 7 open door @@ -452,7 +419,6 @@ About the new airlock wires panel: if (src.aiHacking==0) src.aiHacking=1 spawn(20) - //TODO: Make this take a minute user << "Airlock AI control has been blocked. Beginning fault-detection." sleep(50) if (src.canAIControl()) @@ -545,7 +511,7 @@ About the new airlock wires panel: t1 += text("

Close

\n", src) - user << browse(t1, "window=airlock") + user.client_mob() << browse(t1, "window=airlock") else ..(user) return @@ -558,12 +524,9 @@ About the new airlock wires panel: if (usr.stat || usr.restrained() ) return if (href_list["close"]) - usr << browse(null, "window=airlock") + usr.client_mob() << browse(null, "window=airlock") if (usr.machine==src) usr.machine = null - - - return if (!istype(usr, /mob/ai)) if ((get_dist(src, usr) <= 1 && istype(src.loc, /turf))) @@ -571,95 +534,30 @@ About the new airlock wires panel: if (href_list["wires"]) var/t1 = text2num(href_list["wires"]) if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) )) - usr << alert("You need wirecutters!", null, null, null, null, null) + alert(usr.client_mob(), "You need wirecutters!") return if (!( src.p_open )) return if (src.isWireColorCut(t1)) src.mend(t1) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - else src.cut(t1) else if (href_list["pulse"]) var/t1 = text2num(href_list["pulse"]) if (!( istype(usr.equipped(), /obj/item/weapon/multitool) )) - usr << alert("You need a multitool!", null, null, null, null, null) + alert(usr.client_mob(), "You need a multitool!") return if ((stat & NOPOWER)) - usr << "Due to a power failure, nothing happens." + usr.client_mob() << "Due to a power failure, nothing happens." return if (!src.arePowerSystemsOn()) - usr << "Due to power being disrupted, nothing happens." + usr.client_mob() << "Due to power being disrupted, nothing happens." return if (!( src.p_open )) - usr << "You can't pulse it because the panel is closed." + usr.client_mob() << "You can't pulse it because the panel is closed." return if (src.isWireColorCut(t1)) - usr << "You can't pulse that wire - it being cut means a signal can't travel properly in it." + usr.client_mob() << "You can't pulse that wire - it being cut means a signal can't travel properly in it." return @@ -671,7 +569,7 @@ About the new airlock wires panel: else //AI if (!src.canAIControl()) - usr << "Airlock control connection failure!" + usr.client_mob() << "Airlock control connection failure!" return //aiDisable - 1 idscan, 2 disrupt main power, 3 disrupt backup power, 4 drop door bolts, 5 un-electrify door, 7 close door //aiEnable - 1 idscan, 4 raise door bolts, 5 electrify door for 30 seconds, 6 electrify door indefinitely, 7 open door @@ -681,30 +579,30 @@ About the new airlock wires panel: if (1) //disable idscan if (src.isWireCut(AIRLOCK_WIRE_IDSCAN)) - usr << "The IdScan wire has been cut - So, you can't disable it, but it is already disabled anyways." + usr.client_mob() << "The IdScan wire has been cut - So, you can't disable it, but it is already disabled anyways." else if (src.aiDisabledIdScanner) - usr << "You've already disabled the IdScan feature." + usr.client_mob() << "You've already disabled the IdScan feature." else if (src.arePowerSystemsOn() && (!(stat & NOPOWER))) src.aiDisabledIdScanner = 1 else - usr << "Unable to disable ID Scanner due to power failure." + usr.client_mob() << "Unable to disable ID Scanner due to power failure." if (2) //disrupt main power if (src.secondsMainPowerLost == 0) src.loseMainPower() else - usr << "Main power is already offline." + usr.client_mob() << "Main power is already offline." if (3) //disrupt backup power if (src.secondsBackupPowerLost == 0) src.loseBackupPower() else - usr << "Backup power is already offline." + usr.client_mob() << "Backup power is already offline." if (4) //drop door bolts if (src.isWireCut(AIRLOCK_WIRE_DOOR_BOLTS)) - usr << "You can't drop the door bolts - The door bolt dropping wire has been cut." + usr.client_mob() << "You can't drop the door bolts - The door bolt dropping wire has been cut." else if (src.locked!=1) src.locked = 1 if (5) @@ -718,16 +616,16 @@ About the new airlock wires panel: if (7) //close door if (src.blocked) - usr << text("The airlock has been welded shut!
\n") + usr.client_mob() << text("The airlock has been welded shut!
\n") else if (src.locked) - usr << text("The door bolts are down!
\n") + usr.client_mob() << text("The door bolts are down!
\n") else if (!src.density) if (src.arePowerSystemsOn() && (!(stat & NOPOWER))) close() else - usr << "Unable to close door due to power failure." + usr.client_mob() << "Unable to close door due to power failure." else - usr << text("The airlock is already closed.
\n") + usr.client_mob() << text("The airlock is already closed.
\n") else if (href_list["aiEnable"]) var/code = text2num(href_list["aiEnable"]) @@ -735,36 +633,36 @@ About the new airlock wires panel: if (1) //enable idscan if (src.isWireCut(AIRLOCK_WIRE_IDSCAN)) - usr << "You can't enable IdScan - The IdScan wire has been cut." + usr.client_mob() << "You can't enable IdScan - The IdScan wire has been cut." else if (src.aiDisabledIdScanner) if (src.arePowerSystemsOn() && (!(stat & NOPOWER))) src.aiDisabledIdScanner = 0 else - usr << "Unable to enable ID Scanner due to power failure." + usr.client_mob() << "Unable to enable ID Scanner due to power failure." else - usr << "The IdScan feature is not disabled." + usr.client_mob() << "The IdScan feature is not disabled." if (4) //raise door bolts if (src.isWireCut(AIRLOCK_WIRE_DOOR_BOLTS)) - usr << text("The door bolt drop wire is cut - you can't raise the door bolts.
\n") + usr.client_mob() << text("The door bolt drop wire is cut - you can't raise the door bolts.
\n") else if (!src.locked) - usr << text("The door bolts are already up.
\n") + usr.client_mob() << text("The door bolts are already up.
\n") else if (src.isWireCut(AIRLOCK_WIRE_POWER_ASSIST)) - usr << text("The door bolts are not coming up - The power assist wire has been cut.
\n") + usr.client_mob() << text("The door bolts are not coming up - The power assist wire has been cut.
\n") else if (src.arePowerSystemsOn() && (!(stat & NOPOWER))) src.locked = 0 else - usr << text("Cannot raise door bolts due to power failure.
\n") + usr.client_mob() << text("Cannot raise door bolts due to power failure.
\n") if (5) //electrify door for 30 seconds if (src.isWireCut(AIRLOCK_WIRE_ELECTRIFY)) - usr << text("The electrification wire has been cut.
\n") + usr.client_mob() << text("The electrification wire has been cut.
\n") else if (src.secondsElectrified==-1) - usr << text("The door is already indefinitely electrified. You'd have to un-electrify it before you can re-electrify it with a non-forever duration.
\n") + usr.client_mob() << text("The door is already indefinitely electrified. You'd have to un-electrify it before you can re-electrify it with a non-forever duration.
\n") else if (src.secondsElectrified!=0) - usr << text("The door is already electrified. You can't re-electrify it while it's already electrified.
\n") + usr.client_mob() << text("The door is already electrified. You can't re-electrify it while it's already electrified.
\n") else src.secondsElectrified = 30 spawn(10) @@ -777,26 +675,26 @@ About the new airlock wires panel: if (6) //electrify door indefinitely if (src.isWireCut(AIRLOCK_WIRE_ELECTRIFY)) - usr << text("The electrification wire has been cut.
\n") + usr.client_mob() << text("The electrification wire has been cut.
\n") else if (src.secondsElectrified==-1) - usr << text("The door is already indefinitely electrified.
\n") + usr.client_mob() << text("The door is already indefinitely electrified.
\n") else if (src.secondsElectrified!=0) - usr << text("The door is already electrified. You can't re-electrify it while it's already electrified.
\n") + usr.client_mob() << text("The door is already electrified. You can't re-electrify it while it's already electrified.
\n") else src.secondsElectrified = -1 if (7) //open door if (src.blocked) - usr << text("The airlock has been welded shut!
\n") + usr.client_mob() << text("The airlock has been welded shut!
\n") else if (src.locked) - usr << text("The door bolts are down!
\n") + usr.client_mob() << text("The door bolts are down!
\n") else if (src.density) if (src.arePowerSystemsOn() && (!(stat & NOPOWER))) open() else - usr << "Unable to open door due to power failure." + usr.client_mob() << "Unable to open door due to power failure." else - usr << text("The airlock is already opened.
\n") + usr.client_mob() << text("The airlock is already opened.
\n") src.updateIconState() src.updateDialog() @@ -824,7 +722,7 @@ About the new airlock wires panel: if (W.weldfuel > 2) W.weldfuel -= 2 else - user << "Need more welding fuel!" + user.client_mob() << "Need more welding fuel!" return if (!( src.blocked )) src.blocked = 1 @@ -835,12 +733,12 @@ About the new airlock wires panel: else if (istype(C, /obj/item/weapon/wrench)) if (src.p_open) if (src.arePowerSystemsOn()) - if (src.canBoltsBeRaisedManually()) + if (src.canBoltsBeRaisedManually() || istype(user, /mob/drone)) src.locked = null else - user << alert("You strain to try to raise the door bolts, but the door's power assist seems to be disabled!", null, null, null, null, null) + user.client_mob() << alert("You strain to try to raise the door bolts, but the door's power assist seems to be disabled!", null, null, null, null, null) else - user << alert("You need power assist!", null, null, null, null, null) + user.client_mob() << alert("You need power assist!", null, null, null, null, null) src.updateIconState() else if (istype(C, /obj/item/weapon/screwdriver)) src.p_open = !( src.p_open ) diff --git a/Code/Machinery/Door/false_wall.dm b/Code/Machinery/Door/false_wall.dm index b09a9a0..c988df9 100644 --- a/Code/Machinery/Door/false_wall.dm +++ b/Code/Machinery/Door/false_wall.dm @@ -20,12 +20,17 @@ obj/machinery/door/false_wall examine() set src in oview(1) - usr << "It looks like a regular wall" + usr.client_mob() << "It looks like a regular wall" // AI can't use secret doors attack_ai(mob/user as mob) - return + if (user.currentDrone!=null) + if (get_dist(user.currentDrone, src)<=1) + if (src.density) + open() + else + close() // Monkey interact - if in monkey mode, same as human @@ -37,13 +42,19 @@ obj/machinery/door/false_wall // Human interact - 25% chance to open the door attack_hand(mob/user) - + if (user.currentDrone!=null) + if (get_dist(user.currentDrone, src)<=1) + if (src.density) + open() + else + close() + src.add_fingerprint(user) if (src.density) if (prob(25)) open() else - user << "\blue You push the wall but nothing happens!" + user.client_mob() << "\blue You push the wall but nothing happens!" else close() diff --git a/Code/Machinery/Door/firedoor.dm b/Code/Machinery/Door/firedoor.dm index 41cae72..96872ff 100644 --- a/Code/Machinery/Door/firedoor.dm +++ b/Code/Machinery/Door/firedoor.dm @@ -16,11 +16,11 @@ obj/machinery/door/firedoor // Standard open and close procs do not work with firedoors open() - usr << "This is a remote firedoor!" + usr.client_mob() << "This is a remote firedoor!" close() - usr << "This is a remote firedoor!" + usr.client_mob() << "This is a remote firedoor!" diff --git a/Code/Machinery/Door/poddoor.dm b/Code/Machinery/Door/poddoor.dm index 1c62e23..12fc732 100644 --- a/Code/Machinery/Door/poddoor.dm +++ b/Code/Machinery/Door/poddoor.dm @@ -15,10 +15,10 @@ obj/machinery/door/poddoor // Standard open() and close() procs do not work open() - usr << "This is a remote controlled door!" + usr.client_mob() << "This is a remote controlled door!" close() - usr << "This is a remote controlled door!" + usr.client_mob() << "This is a remote controlled door!" diff --git a/Code/Machinery/Door/window.dm b/Code/Machinery/Door/window.dm index 24ab197..aaa88f3 100644 --- a/Code/Machinery/Door/window.dm +++ b/Code/Machinery/Door/window.dm @@ -88,6 +88,9 @@ obj/machinery/door/window return var/obj/item/weapon/card/id/card // check if user is human and wearing ID + if (istype(user, /mob/drone)) + if (user:controlledBy != null) + user = user:controlledBy if (istype(user, /mob/human)) var/mob/human/H = user card = H.wear_id diff --git a/Code/Machinery/Power/_power.dm b/Code/Machinery/Power/_power.dm index be45412..3d718fc 100644 --- a/Code/Machinery/Power/_power.dm +++ b/Code/Machinery/Power/_power.dm @@ -136,7 +136,7 @@ obj/machinery/power for(var/obj/cable/LC in T) if(LC.d1 == dirn || LC.d2 == dirn) - user << "There's already a cable at that position." + user.client_mob() << "There's already a cable at that position." return var/obj/cable/NC = new(T) diff --git a/Code/Machinery/Power/apc.dm b/Code/Machinery/Power/apc.dm index b471b9e..4dbcb10 100644 --- a/Code/Machinery/Power/apc.dm +++ b/Code/Machinery/Power/apc.dm @@ -110,11 +110,11 @@ obj/machinery/power/apc if(stat & BROKEN) return if(usr && !usr.stat) - usr << "A control terminal for the area electrical systems." + usr.client_mob() << "A control terminal for the area electrical systems." if(opened) - usr << "The cover is open and the power cell is [ cell ? "installed" : "missing"]." + usr.client_mob() << "The cover is open and the power cell is [ cell ? "installed" : "missing"]." else - usr << "The cover is closed." + usr.client_mob() << "The cover is closed." // Update the APC icon to show the three base states (normal, opened with cell, opened without cell) @@ -156,48 +156,48 @@ obj/machinery/power/apc updateicon() else if(coverlocked) - user << "The cover is locked and cannot be opened." + user.client_mob() << "The cover is locked and cannot be opened." else opened = 1 updateicon() else if (istype(W, /obj/item/weapon/cell) && opened) // trying to put a cell inside if(cell) - user << "There is a power cell already installed." + user.client_mob() << "There is a power cell already installed." else user.drop_item() W.loc = src cell = W - user << "You insert the power cell." + user.client_mob() << "You insert the power cell." chargecount = 0 updateicon() else if (istype(W, /obj/item/weapon/card/id) ) // trying to unlock the interface with an ID card if(opened) - user << "You must close the cover to swipe an ID card." + user.client_mob() << "You must close the cover to swipe an ID card." else var/obj/item/weapon/card/id/I = W if (I.check_access(access, allowed)) locked = !locked - user << "You [ locked ? "lock" : "unlock"] the APC interface." + user.client_mob() << "You [ locked ? "lock" : "unlock"] the APC interface." updateicon() else - user << "\red Access denied." + user.client_mob() << "\red Access denied." else if (istype(W, /obj/item/weapon/card/emag) ) // trying to unlock with an emag card if(opened) - user << "You must close the cover to swipe an ID card." + user.client_mob() << "You must close the cover to swipe an ID card." else flick("apc-spark", src) sleep(6) if(prob(50)) locked = !locked - user << "You [ locked ? "lock" : "unlock"] the APC interface." + user.client_mob() << "You [ locked ? "lock" : "unlock"] the APC interface." updateicon() else - user << "You fail to [ locked ? "unlock" : "lock"] the APC interface." + user.client_mob() << "You fail to [ locked ? "unlock" : "lock"] the APC interface." // Attack with hand - remove cell (if present and cover open) or interact with the APC @@ -224,7 +224,7 @@ obj/machinery/power/apc cell.updateicon() src.cell = null - user << "You remove the power cell." + user.client_mob() << "You remove the power cell." charging = 0 src.updateicon() @@ -240,7 +240,7 @@ obj/machinery/power/apc if ( (get_dist(src, user) > 1 )) if (!istype(user, /mob/ai)) user.machine = null - user << browse(null, "window=apc") + user.client_mob() << browse(null, "window=apc") return user.machine = src @@ -327,7 +327,7 @@ obj/machinery/power/apc t += "

Close" t += "" - user << browse(t, "window=apc") + user.client_mob() << browse(t, "window=apc") return @@ -366,7 +366,7 @@ obj/machinery/power/apc return if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" + usr.client_mob() << "\red You don't have the dexterity to do this!" return if (( (get_dist(src, usr) <= 1 && istype(src.loc, /turf))) || (istype(usr, /mob/ai))) @@ -409,14 +409,14 @@ obj/machinery/power/apc updateicon() update() else if( href_list["close"] ) - usr << browse(null, "window=apc") + usr.client_mob() << browse(null, "window=apc") usr.machine = null return src.updateDialog() else - usr << browse(null, "window=apc") + usr.client_mob() << browse(null, "window=apc") usr.machine = null return diff --git a/Code/Machinery/Power/generator.dm b/Code/Machinery/Power/generator.dm index b5a8117..41d8175 100644 --- a/Code/Machinery/Power/generator.dm +++ b/Code/Machinery/Power/generator.dm @@ -134,7 +134,7 @@ obj/machinery/power/generator if ( (get_dist(src, user) > 1 ) && (!istype(user, /mob/ai))) user.machine = null - user << browse(null, "window=teg") + user.client_mob() << browse(null, "window=teg") return user.machine = src @@ -158,7 +158,7 @@ obj/machinery/power/generator t += "

Close" t += "" - user << browse(t, "window=teg;size=460x300") + user.client_mob() << browse(t, "window=teg;size=460x300") return @@ -170,9 +170,10 @@ obj/machinery/power/generator if (usr.stat || usr.restrained() ) return if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" - return + if (!istype(usr, /mob/ai)) + if (!istype(usr, /mob/drone)) + usr.client_mob() << "\red You don't have the dexterity to do this!" + return //world << "[href] ; [href_list[href]]" @@ -180,7 +181,7 @@ obj/machinery/power/generator if( href_list["close"] ) - usr << browse(null, "window=teg") + usr.client_mob() << browse(null, "window=teg") usr.machine = null return @@ -247,7 +248,7 @@ obj/machinery/power/generator src.updateDialog() else - usr << browse(null, "window=teg") + usr.client_mob() << browse(null, "window=teg") usr.machine = null return diff --git a/Code/Machinery/Power/monitor.dm b/Code/Machinery/Power/monitor.dm index dce0092..a6eb70c 100644 --- a/Code/Machinery/Power/monitor.dm +++ b/Code/Machinery/Power/monitor.dm @@ -45,9 +45,9 @@ obj/machinery/power/monitor var/obj/item/weapon/card/id/I = W if (I.check_access(access, allowed)) control = !control - user << "You [ control ? "enable" : "disable"] remote APC control." + user.client_mob() << "You [ control ? "enable" : "disable"] remote APC control." else - user << "\red Access denied." + user.client_mob() << "\red Access denied." else attack_hand(user) // otherwise interact as usual @@ -58,7 +58,7 @@ obj/machinery/power/monitor if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) ) if (!istype(user, /mob/ai)) user.machine = null - user << browse(null, "window=powcomp") + user.client_mob() << browse(null, "window=powcomp") return @@ -106,7 +106,7 @@ obj/machinery/power/monitor t += "

Close" - user << browse(t, "window=powcomp;size=450x740") + user.client_mob() << browse(t, "window=powcomp;size=450x740") // Handle topic links from the interaction window @@ -117,8 +117,9 @@ obj/machinery/power/monitor return if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" - return + if (!istype(usr, /mob/drone)) + usr.client_mob() << "\red You don't have the dexterity to do this!" + return if (( (get_dist(src, usr) <= 1 && istype(src.loc, /turf)) || (istype(usr, /mob/ai)))) usr.machine = src @@ -131,11 +132,11 @@ obj/machinery/power/monitor if ((M.client && M.machine == src)) src.interact(M) else if( href_list["close"] ) - usr << browse(null, "window=powcomp") + usr.client_mob() << browse(null, "window=powcomp") usr.machine = null return else - usr << browse(null, "window=powcomp") + usr.client_mob() << browse(null, "window=powcomp") usr.machine = null // Timed process - use power, update window to viewers diff --git a/Code/Machinery/Power/smes.dm b/Code/Machinery/Power/smes.dm index 44a59f7..a9a4a90 100644 --- a/Code/Machinery/Power/smes.dm +++ b/Code/Machinery/Power/smes.dm @@ -219,7 +219,7 @@ if ( (get_dist(src, user) > 1 )) if (!istype(user, /mob/ai)) user.machine = null - user << browse(null, "window=smes") + user.client_mob() << browse(null, "window=smes") return user.machine = src @@ -245,7 +245,7 @@ t += "

Close" t += "" - user << browse(t, "window=smes;size=460x300") + user.client_mob() << browse(t, "window=smes;size=460x300") return @@ -258,8 +258,9 @@ return if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" - return + if (!istype(usr, /mob/drone)) + usr.client_mob() << "\red You don't have the dexterity to do this!" + return //world << "[href] ; [href_list[href]]" @@ -267,7 +268,7 @@ if( href_list["close"] ) - usr << browse(null, "window=smes") + usr.client_mob() << browse(null, "window=smes") usr.machine = null return @@ -337,7 +338,7 @@ src.updateDialog() else - usr << browse(null, "window=smes") + usr.client_mob() << browse(null, "window=smes") usr.machine = null return \ No newline at end of file diff --git a/Code/Machinery/Power/solar_control.dm b/Code/Machinery/Power/solar_control.dm index 6cd9d8c..5f95d59 100644 --- a/Code/Machinery/Power/solar_control.dm +++ b/Code/Machinery/Power/solar_control.dm @@ -114,7 +114,7 @@ obj/machinery/power/solar_control if ( (get_dist(src, user) > 1 )) if (!istype(user, /mob/ai)) user.machine = null - user << browse(null, "window=solcon") + user.client_mob() << browse(null, "window=solcon") return user.machine = src @@ -155,7 +155,7 @@ obj/machinery/power/solar_control t += "
Close" t += "" - user << browse(t, "window=solcon") + user.client_mob() << browse(t, "window=solcon") return @@ -169,8 +169,9 @@ obj/machinery/power/solar_control return if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" - return + if (!istype(usr, /mob/drone)) + usr.client_mob() << "\red You don't have the dexterity to do this!" + return //world << "[href] ; [href_list[href]]" @@ -178,7 +179,7 @@ obj/machinery/power/solar_control if( href_list["close"] ) - usr << browse(null, "window=solcon") + usr.client_mob() << browse(null, "window=solcon") usr.machine = null return @@ -214,7 +215,7 @@ obj/machinery/power/solar_control src.updateDialog() else - usr << browse(null, "window=solcon") + usr.client_mob() << browse(null, "window=solcon") usr.machine = null return diff --git a/Code/Machinery/Power/turbine.dm b/Code/Machinery/Power/turbine.dm index ce01d76..13bb02e 100644 --- a/Code/Machinery/Power/turbine.dm +++ b/Code/Machinery/Power/turbine.dm @@ -189,7 +189,7 @@ obj/machinery/power/turbine if ( (get_dist(src, user) > 1 ) || (stat & (NOPOWER|BROKEN)) && (!istype(user, /mob/ai)) ) user.machine = null - user << browse(null, "window=turbine") + user.client_mob() << browse(null, "window=turbine") return user.machine = src @@ -208,7 +208,7 @@ obj/machinery/power/turbine t += "
Close" t += "" - user << browse(t, "window=turbine") + user.client_mob() << browse(t, "window=turbine") return @@ -223,14 +223,15 @@ obj/machinery/power/turbine return if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" - return + if (!istype(usr, /mob/drone)) + usr.client_mob() << "\red You don't have the dexterity to do this!" + return if (( usr.machine==src && (get_dist(src, usr) <= 1 && istype(src.loc, /turf))) || (istype(usr, /mob/ai))) if( href_list["close"] ) - usr << browse(null, "window=turbine") + usr.client_mob() << browse(null, "window=turbine") usr.machine = null return @@ -241,7 +242,7 @@ obj/machinery/power/turbine src.updateDialog() else - usr << browse(null, "window=turbine") + usr.client_mob() << browse(null, "window=turbine") usr.machine = null return \ No newline at end of file diff --git a/Code/Machinery/alarm.dm b/Code/Machinery/alarm.dm index 811a100..360a2c8 100644 --- a/Code/Machinery/alarm.dm +++ b/Code/Machinery/alarm.dm @@ -53,8 +53,8 @@ obj/machinery/alarm if (usr.stat || stat & NOPOWER) return if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" + if (!istype(usr, /mob/ai) && !istype(usr, /mob/drone)) + usr.client_mob() << "\red You don't have the dexterity to do this!" return var/turf/T = src.loc if (!( istype(T, /turf) )) diff --git a/Code/Machinery/autolathe.dm b/Code/Machinery/autolathe.dm index aeaa649..741799a 100644 --- a/Code/Machinery/autolathe.dm +++ b/Code/Machinery/autolathe.dm @@ -12,8 +12,8 @@ obj/machinery/autolathe icon_state = "autolathe" anchored = 1 var - m_amount = 0 // amount (cc) of metal loaded - g_amount = 0 // amount (cc) of glass loaded + m_amount = 0.0 // amount (cc) of metal loaded + g_amount = 0.0 // amount (cc) of glass loaded operating = 0 // true if the machine is operating opened = 0 // true if the machine is open (not fully implemented?) temp = null // temporary intaction window text @@ -42,22 +42,26 @@ obj/machinery/autolathe src.opened = !( src.opened ) src.icon_state = text("autolathe[]", (src.opened ? "f" : null)) else - user << "\red The machine is in use. You can not maintain it now." + user.client_mob() << "\red The machine is in use. You can not maintain it now." else spawn( 0 ) src.attack_hand(user) return - // Monkey interact same a human + // Monkey interact same as human attack_paw(mob/user) return src.attack_hand(user) + // And the AI's interact is still just the same. + attack_ai(mob/user) + return src.attack_hand(user) + + // Open interaction window // Currenty only pipe pieces can be made - attack_hand(mob/user) if(stat & (BROKEN|NOPOWER)) @@ -78,6 +82,8 @@ obj/machinery/autolathe L["manif"] = "Pipe manifold (15000 cc)" L["junct"] = "Pipe junction (10000 cc)" L["vent"] = "Pipe vent (10000 cc)" + if (config.enable_drones) + L["drone"] = "Robot drone (150,000 cc)" /* L["screwdriver"] = "Make Screwdriver {40 cc}" L["wirecutters"] = "Make Wirecutters {80 cc}" L["wrench"] = "Make Wrench {150 cc}" @@ -96,7 +102,7 @@ obj/machinery/autolathe for(var/t in L) dat += "[L["[t]"]]
" - user << browse("Autolathe Control Panel[dat]", "window=autolathe") + user.client_mob() << browse("Autolathe Control Panel[dat]", "window=autolathe") return // Called by topic links from interaction window @@ -107,10 +113,11 @@ obj/machinery/autolathe if ((usr.stat || usr.restrained())) - return + if (!istype(usr, /mob/ai)) + return if(operating || (stat & NOPOWER)) return - if ( get_dist(src, usr) <= 1 && istype(src.loc, /turf) ) + if ( (get_dist(src, usr) <= 1 || istype(usr, /mob/ai)) && istype(src.loc, /turf) ) usr.machine = src src.add_fingerprint(usr) @@ -128,6 +135,8 @@ obj/machinery/autolathe C["manif"] = 15000 C["junct"] = 10000 C["vent"] = 10000 + if (config.enable_drones) + C["drone"] = 150000 var/item = href_list["make"] var/cost = C[item] @@ -152,12 +161,14 @@ obj/machinery/autolathe new /obj/item/weapon/pipe{ ptype = 6 }(src.loc) if("vent") new /obj/item/weapon/pipe{ ptype = 7 }(src.loc) + if("drone") + if (config.enable_drones) + var/mob/drone/drone = new /mob/drone(src.loc) + drone.nameDrone(numDronesInExistance) + numDronesInExistance ++ - - for(var/mob/M in viewers(1, src)) - if ((M.client && M.machine == src)) - src.attack_hand(M) + src.updateDialog() return // Perform operation animation diff --git a/Code/Machinery/camera.dm b/Code/Machinery/camera.dm index f292d88..b110ad6 100644 --- a/Code/Machinery/camera.dm +++ b/Code/Machinery/camera.dm @@ -27,6 +27,20 @@ obj/machinery/camera for(var/mob/O in viewers(user, null)) O.show_message("\red [user] has deactivated [src]!", 1) src.icon_state = "camera1" + //check if anyone is looking through the camera + for (var/mob/M in world) + if (istype(M, /mob/ai)) + if (M:current == src) + M.show_message("\red [user] has deactivated [src]!", 1) + M:current = null + M.reset_view(null) + else + if (M.machine!=null && istype(M.machine, /obj/machinery/computer/security)) + if (M.machine:current == src) + M.show_message("\red [user] has deactivated [src]!", 1) + M.machine:current = null + M.machine = null + M.reset_view(null) else for(var/mob/O in viewers(user, null)) O.show_message("\red [user] has reactivated [src]!", 1) diff --git a/Code/Machinery/cell_charger.dm b/Code/Machinery/cell_charger.dm index b5b1ca9..0e92250 100644 --- a/Code/Machinery/cell_charger.dm +++ b/Code/Machinery/cell_charger.dm @@ -24,13 +24,13 @@ obj/machinery/cell_charger if(istype(W, /obj/item/weapon/cell)) if(charging) - user << "There is already a cell in the charger." + user.client_mob() << "There is already a cell in the charger." return else user.drop_item() W.loc = src charging = W - user << "You insert the cell into the charger." + user.client_mob() << "You insert the cell into the charger." chargelevel = -1 @@ -78,7 +78,7 @@ obj/machinery/cell_charger charging.updateicon() src.charging = null - user << "You remove the cell from the charger." + user.client_mob() << "You remove the cell from the charger." chargelevel = -1 updateicon() diff --git a/Code/Machinery/connector.dm b/Code/Machinery/connector.dm index bd424a0..1b3d06e 100644 --- a/Code/Machinery/connector.dm +++ b/Code/Machinery/connector.dm @@ -75,9 +75,9 @@ return if(connected) - usr << "A pipe connector for gas equipment. It is connected to \an [connected.name]." + usr.client_mob() << "A pipe connector for gas equipment. It is connected to \an [connected.name]." else - usr << "A pipe connector for gas equipment. It is unconnected." + usr.client_mob() << "A pipe connector for gas equipment. It is unconnected." diff --git a/Code/Machinery/cryocell.dm b/Code/Machinery/cryocell.dm index 9d732d1..01f9727 100644 --- a/Code/Machinery/cryocell.dm +++ b/Code/Machinery/cryocell.dm @@ -172,14 +172,15 @@ obj/machinery/cryo_cell if (usr.stat != 0 || stat & NOPOWER) return if (src.occupant) - usr << "\blue The cell is already occupied!" + usr.client_mob() << "\blue The cell is already occupied!" return if (usr.abiotic()) - usr << "Subject may not have abiotic items on." + usr.client_mob() << "Subject may not have abiotic items on." return usr.pulling = null - usr.client.perspective = EYE_PERSPECTIVE - usr.client.eye = src + if (usr.client) + usr.client.perspective = EYE_PERSPECTIVE + usr.client.eye = src usr.loc = src src.occupant = usr src.icon_state = "celltop_1" @@ -200,10 +201,10 @@ obj/machinery/cryo_cell if ((!( istype(G, /obj/item/weapon/grab) ) || !( ismob(G.affecting) ))) return if (src.occupant) - user << "\blue The cell is already occupied!" + user.client_mob() << "\blue The cell is already occupied!" return if (G.affecting.abiotic()) - user << "Subject may not have abiotic items on." + user.client_mob() << "Subject may not have abiotic items on." return var/mob/M = G.affecting if (M.client) @@ -266,7 +267,7 @@ obj/machinery/cryo_cell dat += text("[]\t-Toxin Content %: []
", (src.occupant.toxloss < 60 ? "" : ""), src.occupant.toxloss) dat += text("[]\t-Burn Severity %: []", (src.occupant.fireloss < 60 ? "" : ""), src.occupant.fireloss) dat += text("

Close", user) - user << browse(dat, "window=cryo;size=400x500") + user.client_mob() << browse(dat, "window=cryo;size=400x500") else var/dat = text(" []
", stars("System Statistics:")) if (src.gas.temperature > T0C) @@ -297,15 +298,16 @@ obj/machinery/cryo_cell dat += text("[]\t[]

", (src.occupant.toxloss < 60 ? "" : ""), stars(text("-Toxin Content %: []", src.occupant.toxloss))) dat += text("[]\t[]", (src.occupant.fireloss < 60 ? "" : ""), stars(text("-Burn Severity %: []", src.occupant.fireloss))) dat += text("

Close", user) - user << browse(dat, "window=cryo;size=400x500") + user.client_mob() << browse(dat, "window=cryo;size=400x500") //This is for the emergency drain feature, for draining the cryo cell back into the freezer -shadowlord13 Topic(href, href_list) ..() if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" - return + if (!istype(usr, /mob/drone)) + usr.client_mob() << "\red You don't have the dexterity to do this!" + return if ((usr.stat || usr.restrained())) return if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf))) || (istype(usr, /mob/ai))) @@ -343,7 +345,7 @@ obj/machinery/cryo_cell leak_to_turf() src.add_fingerprint(usr) else - usr << "User too far?" + usr.client_mob() << "User too far?" return // Called to remove the occupant of a cell @@ -430,9 +432,7 @@ obj/machinery/cryo_cell if (src.gas.temperature < (60+T0C)) src.gas.temperature = min(src.gas.temperature + 1, 60+T0C) - for(var/mob/E in viewers(1, src)) - if ((E.client && E.machine == src)) - src.attack_hand(E) + src.updateDialog() diff --git a/Code/Machinery/dispenser.dm b/Code/Machinery/dispenser.dm index 22a253a..3102399 100644 --- a/Code/Machinery/dispenser.dm +++ b/Code/Machinery/dispenser.dm @@ -40,7 +40,7 @@ obj/machinery/dispenser user.machine = src var/dat = text("Loaded Tank Dispensing Unit
\nOxygen: [] []
\nPlasma: [] []
\n
", src.o2tanks, (src.o2tanks ? text("Dispense", src) : "empty"), src.pltanks, (src.pltanks ? text("Dispense", src) : "empty")) - user << browse(dat, "window=dispenser") + user.client_mob() << browse(dat, "window=dispenser") return // dispense a tank when topic link is clicked on from interaction window @@ -51,10 +51,12 @@ obj/machinery/dispenser return if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" + if (!istype(usr, /mob/drone)) + usr.client_mob() << "\red You don't have the dexterity to do this!" + return else - usr << "\red You are unable to dispense anything, since the controls are physical levers which don't go through any other kind of input." - return + usr.client_mob() << "\red You are unable to dispense anything, since the controls are physical levers which don't go through any other kind of input." + return if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf)))) usr.machine = src @@ -78,11 +80,9 @@ obj/machinery/dispenser src.add_fingerprint(usr) - for(var/mob/M in viewers(1, src)) - if ((M.client && M.machine == src)) - src.attack_hand(M) + src.updateDialog() - usr << browse(null, "window=dispenser") + usr.client_mob() << browse(null, "window=dispenser") return return diff --git a/Code/Machinery/firealarm.dm b/Code/Machinery/firealarm.dm index 3a276df..c5cc3eb 100644 --- a/Code/Machinery/firealarm.dm +++ b/Code/Machinery/firealarm.dm @@ -31,10 +31,13 @@ obj/machinery/firealarm attackby(obj/item/weapon/W, mob/user) if (istype(W, /obj/item/weapon/wirecutters)) src.detecting = !( src.detecting ) + var/list/observers = viewers(user, null) if (src.detecting) - viewers(user, null) << "\red [user] has reconnected [src]'s detecting unit!" + for (var/mob/M in observers) + M.client_mob() << "\red [user] has reconnected [src]'s detecting unit!" else - viewers(user, null) << "\red [user] has disconnected [src]'s detecting unit!" + for (var/mob/M in observers) + M.client_mob() << "\red [user] has disconnected [src]'s detecting unit!" else src.alarm() src.add_fingerprint(user) @@ -109,7 +112,7 @@ obj/machinery/firealarm var/second = src.time % 60 var/minute = (src.time - second) / 60 var/dat = text("Fire alarm []\n
\nTimer System: []
\nTime Left: [][] - - + +\n
", d1, d2, (minute ? text("[]:", minute) : null), second, src, src, src, src) - user << browse(dat, "window=firealarm") + user.client_mob() << browse(dat, "window=firealarm") else A = A.loc if (A.fire) @@ -123,7 +126,7 @@ obj/machinery/firealarm var/second = src.time % 60 var/minute = (src.time - second) / 60 var/dat = text("[] []\n
\nTimer System: []
\nTime Left: [][] - - + +\n
", stars("Fire alarm"), d1, d2, (minute ? text("[]:", minute) : null), second, src, src, src, src) - user << browse(dat, "window=firealarm") + user.client_mob() << browse(dat, "window=firealarm") return @@ -154,7 +157,7 @@ obj/machinery/firealarm src.updateDialog() src.add_fingerprint(usr) else - usr << browse(null, "window=firealarm") + usr.client_mob() << browse(null, "window=firealarm") return return diff --git a/Code/Machinery/freezer.dm b/Code/Machinery/freezer.dm index 424a925..d842f4e 100644 --- a/Code/Machinery/freezer.dm +++ b/Code/Machinery/freezer.dm @@ -140,7 +140,7 @@ obj/machinery/freezer else t2 = text("Cool Stopped", src) var/dat = text("
\n\t\tTemperature: []
\n\t\tTransfer Status: []
\n\t\t Chemicals Used: []
\n\t\tFreezer status: []
\n\t\t - - [] + +
\n
\n\t[]
\n
\n
\n\tClose
\n\t
", src.temperature-T0C, (src.transfer ? text("Transfering Stop", src) : text("Transfer Stopped", src)), t1, t2, src, src, src.c_used, src, src, d1, user) - user << browse(dat, "window=freezer;size=400x500") + user.client_mob() << browse(dat, "window=freezer;size=400x500") else var/d1 = null if (locate(/obj/item/weapon/flasks, src)) @@ -169,7 +169,7 @@ obj/machinery/freezer else t2 = text("Cool []", src, stars("Stopped")) var/dat = text("
\n\t\t[]: []
\n\t\t[]: []
\n\t\t []: []
\n\t\t[]: []
\n\t\t - - [] + +
\n
\n\t[]
\n
\n
\n\tClose\n\t
", stars("Temperature"), src.temperature-T0C, stars("Transfer Status"), (src.transfer ? text("Transfering Stop", src) : text("Transfer Stopped", src)), stars("Chemicals Used"), t1, stars("Freezer status"), t2, src, src, src.c_used, src, src, d1, user) - user << browse(dat, "window=freezer;size=400x500") + user.client_mob() << browse(dat, "window=freezer;size=400x500") // Handle topic links from interaction window @@ -178,7 +178,7 @@ obj/machinery/freezer ..() if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" + usr.client_mob() << "\red You don't have the dexterity to do this!" return if ((usr.stat || usr.restrained())) if (!istype(usr, /mob/ai)) @@ -223,7 +223,7 @@ obj/machinery/freezer if (!( istype(F, /obj/item/weapon/flasks) )) return if (src.contents.len >= 3) - user << "\blue All slots are full!" + user.client_mob() << "\blue All slots are full!" return else user.drop_item() diff --git a/Code/Machinery/igniter.dm b/Code/Machinery/igniter.dm index f86cd66..885ec5e 100644 --- a/Code/Machinery/igniter.dm +++ b/Code/Machinery/igniter.dm @@ -66,7 +66,7 @@ obj/machinery/igniter var/turf/T = src.loc if (locate(/obj/move, T)) T = locate(/obj/move, T) - if (T.firelevel < 900000.0) + if (T.firelevel < config.min_gas_for_fire) T.firelevel = T.poison diff --git a/Code/Machinery/light_switch.dm b/Code/Machinery/light_switch.dm index 4a8063b..1bcd199 100644 --- a/Code/Machinery/light_switch.dm +++ b/Code/Machinery/light_switch.dm @@ -54,7 +54,7 @@ obj/machinery/light_switch examine() set src in oview(1) if(usr && !usr.stat) - usr << "A light switch. It is [on? "on" : "off"]." + usr.client_mob() << "A light switch. It is [on? "on" : "off"]." // Monkey interact same as human diff --git a/Code/Machinery/meter.dm b/Code/Machinery/meter.dm index 34d961d..7285249 100644 --- a/Code/Machinery/meter.dm +++ b/Code/Machinery/meter.dm @@ -52,14 +52,17 @@ obj/machinery/meter // If the meter is clicked on, report the flow rate and temperature of the gas Click() - - if (get_dist(usr, src) <= 3) + var/mob/user = usr + if (user.currentDrone!=null) + user = user.currentDrone + + if (get_dist(user, src) <= 3) if (src.target) - usr << text("\blue Results:\nMass flow []%\nTemperature [] K", round(100*abs(average)/6e6, 0.1), round(target.pl.gas.temperature,0.1)) + user.client_mob() << text("\blue Results:\nMass flow []%\nTemperature [] K", round(100*abs(average)/6e6, 0.1), round(target.pl.gas.temperature,0.1)) else - usr << "\blue Results: Connection Error!" + user.client_mob() << "\blue Results: Connection Error!" else - usr << "\blue You are too far away." + user.client_mob() << "\blue You are too far away." return // Disabled routines @@ -83,6 +86,6 @@ obj/machinery/meter else t += "It is not functioning." - usr << t + usr.client_mob() << t */ diff --git a/Code/Machinery/nuclearbomb.dm b/Code/Machinery/nuclearbomb.dm index e269138..bd2406a 100644 --- a/Code/Machinery/nuclearbomb.dm +++ b/Code/Machinery/nuclearbomb.dm @@ -49,9 +49,7 @@ obj/machinery/nuclearbomb if (src.timeleft <= 0) explode() - for(var/mob/M in viewers(1, src)) - if ((M.client && M.machine == src)) - src.attack_hand(M) + src.updateDialog() // Monkey interact same as human @@ -139,7 +137,7 @@ Anchor: [(src.anchored ? "Engaged" : "Off")] Toggle
7-8-9
R-0-E
"} - user << browse(dat, "window=nuclearbomb;size=300x400") + user.client_mob() << browse(dat, "window=nuclearbomb;size=300x400") else // Deploy and anchor the bomb. @@ -157,8 +155,9 @@ Anchor: [(src.anchored ? "Engaged" : "Off")] Toggle
if (usr.stat || usr.restrained()) return if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - usr << "\red You don't have the dexterity to do this!" - return + if (!istype(usr, /mob/drone)) + usr.client_mob() << "\red You don't have the dexterity to do this!" + return if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf)))) usr.machine = src @@ -209,11 +208,9 @@ Anchor: [(src.anchored ? "Engaged" : "Off")] Toggle
src.add_fingerprint(usr) - for(var/mob/M in viewers(1, src)) - if ((M.client && M.machine == src)) - src.attack_hand(M) + src.updateDialog() else - usr << browse(null, "window=nuclearbomb") + usr.client_mob() << browse(null, "window=nuclearbomb") return diff --git a/Code/Machinery/pipes.dm b/Code/Machinery/pipes.dm index 6700706..18a95e4 100644 --- a/Code/Machinery/pipes.dm +++ b/Code/Machinery/pipes.dm @@ -253,7 +253,7 @@ obj/machinery/pipes if(WT.welding && WT.weldfuel > 3) WT.weldfuel -=3 - user << "\blue Cutting the pipe. Stand still as this takes some time." + user.client_mob() << "\blue Cutting the pipe. Stand still as this takes some time." var/turf/T = user.loc sleep(50) diff --git a/Code/Machinery/pod.dm b/Code/Machinery/pod.dm index 19c54e0..27ec197 100644 --- a/Code/Machinery/pod.dm +++ b/Code/Machinery/pod.dm @@ -79,6 +79,8 @@ obj/machinery/pod // Eject from pod - place player behind pod and restore view + //I left these all as regular .client since the verbs won't work if the mob doesn't have the client anyhow (a remote-controlled mob with no client won't be able to use the verbs). --shadowlord13 + verb/eject() set src = usr.loc @@ -127,8 +129,8 @@ obj/machinery/pod M.client.perspective = EYE_PERSPECTIVE M.client.eye = src for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O << text("\blue [] loads [] into []!", H, H.pulling, src) + if (O.hasClient() && (!( O.blinded ))) + O.client_mob() << text("\blue [] loads [] into []!", H, H.pulling, src) H.pulling = null return @@ -144,8 +146,8 @@ obj/machinery/pod if (istype(A, /atom/movable)) A.loc = src.loc for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O << text("\blue [] unloads [] from []!", usr, A, src) + if (O.hasClient() && (!( O.blinded ))) + O.client_mob() << text("\blue [] unloads [] from []!", usr, A, src) //Foreach goto(54) if (ismob(A)) var/mob/M = A diff --git a/Code/Machinery/recon.dm b/Code/Machinery/recon.dm index bf45342..7c31601 100644 --- a/Code/Machinery/recon.dm +++ b/Code/Machinery/recon.dm @@ -96,7 +96,7 @@ obj/machinery/recon if (usr.stat) return if (locate(/mob, src)) - usr << "There is no room! You can only fit one person." + usr.client_mob() << "There is no room! You can only fit one person." return var/mob/M = usr if (M.client) @@ -117,10 +117,10 @@ obj/machinery/recon var/mob/human/H = usr if ((H.pulling && !( H.pulling.anchored ))) if (!( istype(H.pulling, /obj/item/weapon) )) - usr << "You may only place items in." + usr.client_mob() << "You may only place items in." else if ((locate(/mob, src) && ismob(H.pulling))) - usr << "There is no room! You can only fit one person." + usr.client_mob() << "There is no room! You can only fit one person." else H.pulling.loc = src if (ismob(H.pulling)) @@ -129,8 +129,8 @@ obj/machinery/recon M.client.perspective = EYE_PERSPECTIVE M.client.eye = src for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O << text("\blue [] loads [] into []!", H, H.pulling, src) + if (O.hasClient() && (!( O.blinded ))) + O.client_mob() << text("\blue [] loads [] into []!", H, H.pulling, src) //Foreach goto(204) H.pulling = null @@ -146,8 +146,8 @@ obj/machinery/recon if (istype(A, /atom/movable)) A.loc = src.loc for(var/mob/O in view(src, null)) - if ((O.client && !( O.blinded ))) - O << text("\blue [] unloads [] from []!", usr, A, src) + if ((!( O.blinded ))) + O.client_mob() << text("\blue [] unloads [] from []!", usr, A, src) //Foreach goto(53) if (ismob(A)) var/mob/M = A diff --git a/Code/Machinery/sec_lock.dm b/Code/Machinery/sec_lock.dm index 7ad978d..c27ba31 100644 --- a/Code/Machinery/sec_lock.dm +++ b/Code/Machinery/sec_lock.dm @@ -70,7 +70,7 @@ Keycard: [src.scan ? "[src.scan.name]" : "Emergency Close
Emergency Open
"} - user << browse(dat, "window=sec_lock") + user.client_mob() << browse(dat, "window=sec_lock") return @@ -89,12 +89,13 @@ Keycard: [src.scan ? "[src.scan.name]" : "The sleeper is already occupied!" + usr.client_mob() << "\blue The sleeper is already occupied!" return if (usr.abiotic()) - usr << "Subject may not have abiotic items on." + usr.client_mob() << "Subject may not have abiotic items on." return usr.pulling = null - usr.client.perspective = EYE_PERSPECTIVE - usr.client.eye = src + if (usr.client) + usr.client.perspective = EYE_PERSPECTIVE + usr.client.eye = src usr.loc = src src.occupant = usr src.icon_state = "sleeper_1" @@ -71,10 +72,10 @@ obj/machinery/sleeper if ((!( istype(G, /obj/item/weapon/grab) ) || !( ismob(G.affecting) ))) return if (src.occupant) - user << "\blue The sleeper is already occupied!" + user.client_mob() << "\blue The sleeper is already occupied!" return if (G.affecting.abiotic()) - user << "Subject may not have abiotic items on." + user.client_mob() << "Subject may not have abiotic items on." return var/mob/M = G.affecting if (M.client) @@ -116,9 +117,9 @@ obj/machinery/sleeper if (src.occupant) if (src.occupant.rejuv < 60) src.occupant.rejuv = 60 - user << text("Occupant now has [] units of rejuvenation in his/her bloodstream.", src.occupant.rejuv) + user.client_mob() << text("Occupant now has [] units of rejuvenation in his/her bloodstream.", src.occupant.rejuv) else - user << "No occupant!" + user.client_mob() << "No occupant!" // Shows the health statistics of the occupant @@ -126,7 +127,7 @@ obj/machinery/sleeper proc/check(mob/user) if (src.occupant) - user << "\blue Occupant ([src.occupant]) Statistics:" + user.client_mob() << "\blue Occupant ([src.occupant]) Statistics:" var/t1 switch(src.occupant.stat) if(0.0) @@ -136,14 +137,14 @@ obj/machinery/sleeper if(2.0) t1 = "*dead*" else - user << "[(src.occupant.health > 50 ? "\blue " : "\red ")]\t Health %: [src.occupant.health] ([t1])" - user << "[(src.occupant.oxyloss < 60 ? "\blue " : "\red ")]\t -Respiratory Damage %: [src.occupant.oxyloss]" - user << "[(src.occupant.toxloss < 60 ? "\blue " : "\red ")]\t -Toxin Content %: [src.occupant.toxloss]" - user << "[(src.occupant.fireloss < 60 ? "\blue " : "\red ")]\t -Burn Severity %: [src.occupant.fireloss]" - user << "\blue Expected time till occupant can safely awake: (note: If health is below 20% these times are inaccurate)" - user << "\blue \t [src.occupant.paralysis / 5] second\s (if around 1 or 2 the sleeper is keeping them asleep.)" + user.client_mob() << "[(src.occupant.health > 50 ? "\blue " : "\red ")]\t Health %: [src.occupant.health] ([t1])" + user.client_mob() << "[(src.occupant.oxyloss < 60 ? "\blue " : "\red ")]\t -Respiratory Damage %: [src.occupant.oxyloss]" + user.client_mob() << "[(src.occupant.toxloss < 60 ? "\blue " : "\red ")]\t -Toxin Content %: [src.occupant.toxloss]" + user.client_mob() << "[(src.occupant.fireloss < 60 ? "\blue " : "\red ")]\t -Burn Severity %: [src.occupant.fireloss]" + user.client_mob() << "\blue Expected time till occupant can safely awake: (note: If health is below 20% these times are inaccurate)" + user.client_mob() << "\blue \t [src.occupant.paralysis / 5] second\s (if around 1 or 2 the sleeper is keeping them asleep.)" else - user << "\blue There is no one inside!" + user.client_mob() << "\blue There is no one inside!" return @@ -272,7 +273,7 @@ obj/machinery/computer/sleep_console else dat += "The sleeper is empty." dat += "

Close" - user << browse(dat, "window=sleeper;size=400x500") + user.client_mob() << browse(dat, "window=sleeper;size=400x500") // Handle topic links from interaction window diff --git a/Code/Machinery/turrets.dm b/Code/Machinery/turrets.dm index 4cc0d02..21ccc62 100644 --- a/Code/Machinery/turrets.dm +++ b/Code/Machinery/turrets.dm @@ -9,7 +9,7 @@ if (target:stat==2) if (target in turretTargets) src.Exited(target) - + /area/turret_protected/Entered(atom/movable/O) if (istype(O, /mob)) @@ -20,7 +20,7 @@ //else //O << "You're already in our target list!" return 1 - + /area/turret_protected/Exited(atom/movable/O) if (istype(O, /mob)) if (!istype(O, /mob/ai)) @@ -31,9 +31,9 @@ //O << "You aren't in our target list!" if (turretTargets.len == 0) popDownTurrets() - + return 1 - + /area/turret_protected/proc/popDownTurrets() for (var/obj/machinery/turret/aTurret in src) aTurret.popDown() @@ -90,7 +90,7 @@ /obj/machinery/turret/proc/setState(var/enabled, var/lethal) src.enabled = enabled src.lasers = lethal - + src.power_change() /obj/machinery/turret/process() @@ -113,7 +113,7 @@ if (istype(loc, /area/turret_protected)) src.wasvalid = 1 var/area/turret_protected/tarea = loc - + if (tarea.turretTargets.len>0) if (!isPopping()) if (isDown()) @@ -126,7 +126,7 @@ src.shootAt(target) else tarea.subjectDied(target) - + else if (src.wasvalid) src.die() @@ -145,7 +145,7 @@ src.cover.icon_state = "openTurretCover" spawn(10) if (popping==1) popping = 0 - + /obj/machinery/turret/proc/popDown() if ((!isPopping()) || src.popping==1) popping = -1 @@ -153,11 +153,11 @@ flick("popdown", src.cover) src.cover.icon_state = "turretCover" spawn(10) - if (popping==-1) + if (popping==-1) invisibility = 2 popping = 0 - - + + /obj/machinery/turret/proc/shootAt(var/mob/target) var/turf/T = loc var/atom/U = (istype(target, /atom/movable) ? target.loc : target) @@ -167,15 +167,15 @@ U = U.loc if (!( istype(T, /turf) )) return - - var/obj/beam/a_laser/A + + var/obj/beam/a_laser/A if (src.lasers) A = new /obj/beam/a_laser( loc ) use_power(50) else A = new /obj/beam/a_laser/s_laser( loc ) use_power(100) - + if (!( istype(U, /turf) )) //A = null del(A) @@ -196,7 +196,7 @@ //src.health -= 1 else src.health -= 2 - + if (src.health <= 0) src.die() return @@ -215,7 +215,7 @@ flick("explosion", src) spawn(14) del(src) - + /obj/machinery/turretid name = "Turret deactivation control" icon = 'items.dmi' @@ -227,7 +227,7 @@ var/locked = 1 var/access = "5555" var/allowed = null - + /obj/machinery/turretid/attackby(obj/item/weapon/W, mob/user) if(stat & BROKEN) return if (istype(user, /mob/ai)) @@ -236,26 +236,26 @@ var/obj/item/weapon/card/id/I = W if (I.check_access(access, allowed)) locked = !locked - user << "You [ locked ? "lock" : "unlock"] the panel." + user.client_mob() << "You [ locked ? "lock" : "unlock"] the panel." if (locked) if (user.machine==src) user.machine = null - user << browse(null, "window=turretid") + user.client_mob() << browse(null, "window=turretid") else if (user.machine==src) src.attack_hand(usr) else - user << "\red Access denied." + user.client_mob() << "\red Access denied." /obj/machinery/turretid/attack_ai(mob/user as mob) return attack_hand(user) - + /obj/machinery/turretid/attack_hand(mob/user as mob) if ( (get_dist(src, user) > 1 )) - if (!istype(user, /mob/ai)) - user << text("Too far away.") + if (!istype(user, /mob/ai)) + user.client_mob() << "Too far away." user.machine = null - user << browse(null, "window=turretid") + user.client_mob() << browse(null, "window=turretid") return user.machine = src @@ -263,7 +263,7 @@ if (istype(loc, /turf)) loc = loc:loc if (!istype(loc, /area)) - user << text("Turret badly positioned - loc.loc is [].", loc) + user.client_mob() << text("Turret badly positioned - loc.loc is [].", loc) return var/area/area = loc var/t = "Turret Control Panel ([area.name])
" @@ -273,8 +273,8 @@ else t += text("Turrets [] - []?
\n", src.enabled?"activated":"deactivated", src, src.enabled?"Disable":"Enable") t += text("Currently set for [] - Change to []?
\n", src.lethal?"lethal":"stun repeatedly", src, src.lethal?"Stun repeatedly":"Lethal") - - user << browse(t, "window=turretid") + + user.client_mob() << browse(t, "window=turretid") /obj/machinery/turretid/Topic(href, href_list) ..() @@ -282,7 +282,7 @@ return if (src.locked) if (!istype(usr, /mob/ai)) - usr << "Control panel is locked!" + usr.client_mob() << "Control panel is locked!" return if (href_list["toggleOn"]) src.enabled = !src.enabled @@ -291,7 +291,7 @@ src.lethal = !src.lethal src.updateTurrets() src.attack_hand(usr) - + /obj/machinery/turretid/proc/updateTurrets() if (src.enabled) if (src.lethal) @@ -300,7 +300,7 @@ icon_state = "motion3" else icon_state = "motion0" - + var/loc = src.loc if (istype(loc, /turf)) loc = loc:loc @@ -308,6 +308,6 @@ world << text("Turret badly positioned - loc.loc is [].", loc) return var/area/area = loc - + for (var/obj/machinery/turret/aTurret in area) aTurret.setState(enabled, lethal) diff --git a/Code/Machinery/valve.dm b/Code/Machinery/valve.dm index baba7a4..c4257e0 100644 --- a/Code/Machinery/valve.dm +++ b/Code/Machinery/valve.dm @@ -54,7 +54,7 @@ obj/machinery/valve if(usr.stat) return - usr << "[desc] It is [ open? "open" : "closed"]." + usr.client_mob() << "[desc] It is [ open? "open" : "closed"]." // Find the connected nodes diff --git a/Code/_debug.dm b/Code/_debug.dm index b9a5882..e51d6ec 100644 --- a/Code/_debug.dm +++ b/Code/_debug.dm @@ -470,5 +470,6 @@ world.log << "\nTotals: M=[num2text(mplas, 10)] T=[num2text(tplas, 10)], all = [num2text(mplas+tplas, 10)]" - - +//Pops up the take-off / put-on dialog, but for yourself. +/mob/human/proc/ShowMyInv() + src.show_inv(src) diff --git a/Code/blob.dm b/Code/blob.dm index 691da84..f63c5db 100644 --- a/Code/blob.dm +++ b/Code/blob.dm @@ -194,7 +194,7 @@ world << "Cent. Com. Update: Biohazard Alert." world << "\red Summary downloaded and printed out at all communications consoles." for(var/mob/ai/aiPlayer in world) - if ((aiPlayer.client && aiPlayer.start)) + if (aiPlayer.hasClient() && aiPlayer.start) var/law = text("The station is under a quarantine. Do not permit anyone to leave. Disregard rules 1-3 if necessary to prevent, by any means necessary, anyone from leaving.") aiPlayer.addLaw(8, law) aiPlayer << text("An additional law has been added by CentCom: []", law) diff --git a/Code/cell_process.dm b/Code/cell_process.dm index 478277b..5a09947 100644 --- a/Code/cell_process.dm +++ b/Code/cell_process.dm @@ -172,6 +172,8 @@ src.updatecell = !( D.density ) if (!( src.updatecell )) return + + src.checkfire = !( src.checkfire ) if (src.checkfire) if (cellcontrol.var_swap) @@ -186,7 +188,7 @@ var/burn = src.firelevel >= 10 for(var/atom/S in src.FindTurfs()) var/obj/move/T = S - if (istype(T, /turf/space)) + if ((!config.air_pressure_flow) && istype(T, /turf/space)) space = 1 else divideby++ @@ -196,10 +198,12 @@ tosl_gas += T.osl_gas ton2 += T.on2 totemp += T.temp - if (T.firelevel >= 900000.0) + if (T.firelevel >= config.min_gas_for_fire) burn = 1 + if ((config.air_pressure_flow) && istype(T, /turf/space)) + space = 1 //Foreach continue //goto(158) - if (space) + if (space && ((!config.air_pressure_flow) || (!burn))) src.oxygen = 0 src.poison = 0 src.co2 = 0 @@ -224,8 +228,8 @@ src.overlays = null if (burn) src.firelevel = src.oxygen + src.poison - if (src.firelevel >= 900000.0) - src.icon_state = "burning" + if (src.firelevel >= config.min_gas_for_fire) + src.icon_state = "burning" src.luminosity = 2 if (src.oxygen > 5000) src.co2 += 2500 @@ -264,7 +268,7 @@ var/burn = src.firelevel >= 10 for(var/atom/S in src.FindTurfs()) var/obj/move/T = S - if (istype(T, /turf/space)) + if ((!config.air_pressure_flow) && istype(T, /turf/space)) space = 1 else divideby++ @@ -274,10 +278,12 @@ tosl_gas += T.tsl_gas ton2 += T.tn2 totemp += T.ttemp - if (T.firelevel >= 900000.0) + if (T.firelevel >= config.min_gas_for_fire) burn = 1 + if ((config.air_pressure_flow) && istype(T, /turf/space)) + space = 1 //Foreach continue //goto(744) - if (space) + if (space && ((!config.air_pressure_flow) || (!burn))) src.oxygen = 0 src.poison = 0 src.co2 = 0 @@ -302,9 +308,9 @@ src.overlays = null if (burn) src.firelevel = src.oxygen + src.poison - if (src.firelevel >= 900000.0) - src.icon_state = "burning" - src.luminosity = 2 + if (src.firelevel >= config.min_gas_for_fire) + src.icon_state = "burning" + src.luminosity = 2 if (src.oxygen > 5000) src.co2 += 2500 src.oxygen -= 5000 @@ -342,15 +348,18 @@ var/ton2 = src.n2 var/totemp = src.temp var/space = 0 + var/burn = src.firelevel >= 10 src.airdir = null src.airforce = 0 var/adiff = null + var/airtemp = 0 for(var/atom/S in src.FindTurfs()) var/obj/move/T = S - if (istype(T, /turf/space)) + if ((!config.air_pressure_flow) && istype(T, /turf/space)) space = 1 src.airforce = src.oxygen + src.n2 + src.poison + src.co2 + 25000 src.airdir = get_dir(src, T) + airtemp = src.temp else divideby++ total += T.oldoxy @@ -360,10 +369,20 @@ ton2 += T.on2 totemp += T.otemp adiff = src.oldoxy + src.oldco2 + src.on2 - (T.oldoxy + T.oldco2 + T.on2) + if (T.firelevel >= config.min_gas_for_fire) + burn = 1 if (adiff > src.airforce) src.airforce = adiff src.airdir = get_dir(src, T) - //Foreach continue //goto(1356) + airtemp = src.otemp + if ((config.air_pressure_flow) && istype(T, /turf/space)) + space = 1 + + + if (config.air_pressure_flow && abs(airtemp-(20.0+T0C))>5) + var/tempForce = airtemp / (20.0+T0C) + src.airforce = src.airforce * tempForce + if (src.airforce > 25000) for(var/atom/movable/AM as mob|obj in src.loc) if ((!( AM.anchored ) && AM.weight <= src.airforce)) @@ -371,7 +390,8 @@ step(AM, src.airdir) return //Foreach goto(1559) - if (space) + + if (space && ((!config.air_pressure_flow) || (!burn))) src.oxygen = 0 src.poison = 0 src.co2 = 0 @@ -410,15 +430,18 @@ var/ton2 = src.n2 var/totemp = src.temp var/space = 0 + var/burn = src.firelevel >= 10 src.airdir = null src.airforce = 0 var/adiff = null + var/airtemp = 0 for(var/atom/S in src.FindTurfs()) var/obj/move/T = S - if (istype(T, /turf/space)) + if ((!config.air_pressure_flow) && istype(T, /turf/space)) space = 1 src.airforce = src.oxygen + src.poison + src.n2 + src.co2 + 25000 src.airdir = get_dir(src, T) + airtemp = src.temp else divideby++ total += T.tmpoxy @@ -428,10 +451,19 @@ ton2 += T.tn2 totemp += T.ttemp adiff = src.tmpoxy + src.tmpco2 + src.tn2 - (T.tmpoxy + T.tmpco2 + T.tn2) + if (T.firelevel >= config.min_gas_for_fire) + burn = 1 if (adiff > src.airforce) src.airforce = adiff src.airdir = get_dir(src, T) - //Foreach continue //goto(1927) + airtemp = src.otemp + if ((config.air_pressure_flow) && istype(T, /turf/space)) + space = 1 + + if (config.air_pressure_flow && abs(airtemp-(20.0+T0C))>5) + var/tempForce = airtemp / (20.0+T0C) + src.airforce = src.airforce * tempForce + if (src.airforce > 25000) for(var/atom/movable/AM as mob|obj in src.loc) if ((!( AM.anchored ) && AM.weight <= src.airforce)) @@ -439,7 +471,9 @@ step(AM, src.airdir) return //Foreach goto(2130) - if (space) + + + if (space && ((!config.air_pressure_flow) || (!burn))) src.oxygen = 0 src.poison = 0 src.co2 = 0 @@ -469,7 +503,7 @@ src.osl_gas = src.sl_gas src.on2 = src.n2 src.otemp = src.temp - if ((locate(/obj/effects/water, src.loc) || src.firelevel < 900000.0)) + if ((locate(/obj/effects/water, src.loc) || src.firelevel < config.min_gas_for_fire)) src.firelevel = 0 //cool due to water temp += (T20C - temp) / FIRERATE @@ -531,7 +565,7 @@ /turf/proc/unburn() - src.luminosity = 0 + src.luminosity = 0 src.icon_state = initial(src.icon_state) return @@ -914,6 +948,10 @@ turf/proc/tot_old_gas() //if(tag && Debug) // world.log << "T[tag]=[tot_gas()] Old=[tot_old_gas()] Tmp=[tot_tmp_gas()]" + if (ticker.burningo2) + if (src.oxygen > 0 || src.poison > 0) + if (src.firelevel == 0) + src.firelevel = src.oxygen + src.poison src.checkfire = !( src.checkfire ) if (src.checkfire) @@ -943,14 +981,14 @@ turf/proc/tot_old_gas() tosl_gas += T.osl_gas ton2 += T.on2 totemp += T.otemp - if (T.firelevel >= 900000.0) + if (T.firelevel >= config.min_gas_for_fire) burn = 1 //Foreach continue //goto(113) */ if(airN) - if(istype(linkN, /turf/space)) + if(istype(linkN, /turf/space) && (!config.air_pressure_flow)) space = 1 goto Enddir1 else @@ -961,10 +999,10 @@ turf/proc/tot_old_gas() tosl_gas+= linkN.osl_gas ton2 += linkN.on2 totemp += linkN.otemp - if (linkN.firelevel >= 900000.0) + if (linkN.firelevel >= config.min_gas_for_fire) burn = 1 if(airS) - if(istype(linkS, /turf/space)) + if(istype(linkS, /turf/space) && (!config.air_pressure_flow)) space = 1 goto Enddir1 else @@ -975,10 +1013,10 @@ turf/proc/tot_old_gas() tosl_gas+= linkS.osl_gas ton2 += linkS.on2 totemp += linkS.otemp - if (linkS.firelevel >= 900000.0) + if (linkS.firelevel >= config.min_gas_for_fire) burn = 1 if(airE) - if(istype(linkE, /turf/space)) + if(istype(linkE, /turf/space) && (!config.air_pressure_flow)) space = 1 goto Enddir1 else @@ -989,10 +1027,10 @@ turf/proc/tot_old_gas() tosl_gas+= linkE.osl_gas ton2 += linkE.on2 totemp += linkE.otemp - if (linkE.firelevel >= 900000.0) + if (linkE.firelevel >= config.min_gas_for_fire) burn = 1 if(airW) - if(istype(linkW, /turf/space)) + if(istype(linkW, /turf/space) && (!config.air_pressure_flow)) space = 1 goto Enddir1 else @@ -1003,12 +1041,14 @@ turf/proc/tot_old_gas() tosl_gas+= linkW.osl_gas ton2 += linkW.on2 totemp += linkW.otemp - if (linkW.firelevel >= 900000.0) + if (linkW.firelevel >= config.min_gas_for_fire) burn = 1 Enddir1: + if((!space) && config.air_pressure_flow && (istype(src.linkN, /turf/space) || istype(src.linkS, /turf/space) || istype(src.linkE, /turf/space) || istype(src.linkW, /turf/space) || istype(src, /turf/space))) + space = 1 - if (space) + if (space && ((!config.air_pressure_flow) || (!burn))) src.oxygen = 0 src.poison = 0 src.co2 = 0 @@ -1033,8 +1073,8 @@ turf/proc/tot_old_gas() src.overlays = null if (burn) src.firelevel = src.oxygen + src.poison - if (src.firelevel >= 900000.0) - src.icon_state = "burning" + if (src.firelevel >= config.min_gas_for_fire) + src.icon_state = "burning" src.luminosity = 2 if (src.oxygen > 5000) src.co2 += 2500 @@ -1091,13 +1131,13 @@ turf/proc/tot_old_gas() tosl_gas += T.tsl_gas ton2 += T.tn2 totemp += T.ttemp - if (T.firelevel >= 900000.0) + if (T.firelevel >= config.min_gas_for_fire) burn = 1 //Foreach continue //goto(705) */ if(airN) - if(istype(linkN, /turf/space)) + if(istype(linkN, /turf/space) && (!config.air_pressure_flow)) space = 1 goto Enddir2 else @@ -1108,10 +1148,10 @@ turf/proc/tot_old_gas() tosl_gas+= linkN.tsl_gas ton2 += linkN.tn2 totemp += linkN.ttemp - if (linkN.firelevel >= 900000.0) + if (linkN.firelevel >= config.min_gas_for_fire) burn = 1 if(airS) - if(istype(linkS, /turf/space)) + if(istype(linkS, /turf/space) && (!config.air_pressure_flow)) space = 1 goto Enddir2 else @@ -1122,10 +1162,10 @@ turf/proc/tot_old_gas() tosl_gas+= linkS.tsl_gas ton2 += linkS.tn2 totemp += linkS.ttemp - if (linkS.firelevel >= 900000.0) + if (linkS.firelevel >= config.min_gas_for_fire) burn = 1 if(airE) - if(istype(linkE, /turf/space)) + if(istype(linkE, /turf/space) && (!config.air_pressure_flow)) space = 1 goto Enddir2 else @@ -1136,10 +1176,10 @@ turf/proc/tot_old_gas() tosl_gas+= linkE.tsl_gas ton2 += linkE.tn2 totemp += linkE.ttemp - if (linkE.firelevel >= 900000.0) + if (linkE.firelevel >= config.min_gas_for_fire) burn = 1 if(airW) - if(istype(linkW, /turf/space)) + if(istype(linkW, /turf/space) && (!config.air_pressure_flow)) space = 1 goto Enddir2 else @@ -1150,13 +1190,14 @@ turf/proc/tot_old_gas() tosl_gas+= linkW.tsl_gas ton2 += linkW.tn2 totemp += linkW.ttemp - if (linkW.firelevel >= 900000.0) + if (linkW.firelevel >= config.min_gas_for_fire) burn = 1 Enddir2: + if((!space) && config.air_pressure_flow && (istype(src.linkN, /turf/space) || istype(src.linkS, /turf/space) || istype(src.linkE, /turf/space) || istype(src.linkW, /turf/space) || istype(src, /turf/space))) + space = 1 - - if (space) + if (space && ((!config.air_pressure_flow) || (!burn))) src.oxygen = 0 src.poison = 0 src.co2 = 0 @@ -1181,8 +1222,8 @@ turf/proc/tot_old_gas() src.overlays = null if (burn) src.firelevel = src.oxygen + src.poison - if (src.firelevel >= 900000.0) - src.icon_state = "burning" + if (src.firelevel >= config.min_gas_for_fire) + src.icon_state = "burning" src.luminosity = 2 if (src.oxygen > 5000) src.co2 += 2500 @@ -1225,16 +1266,19 @@ turf/proc/tot_old_gas() var/tosl_gas = src.sl_gas var/ton2 = src.n2 var/totemp = src.temp + var/burn = src.firelevel >= 10 var/space = 0 src.airdir = null src.airforce = 0 var/adiff = null + var/airtemp = 0 /* for(var/turf/T in src.FindLinkedTurfs()) if (istype(T, /turf/space)) space = 1 src.airforce = src.oxygen + src.poison + src.n2 + src.co2 + 25000 src.airdir = get_dir(src, T) + airtemp = src.temp break // *****RM else divideby++ @@ -1244,18 +1288,22 @@ turf/proc/tot_old_gas() tosl_gas += T.osl_gas ton2 += T.on2 totemp += T.otemp + if (T.firelevel >= config.min_gas_for_fire) + burn = 1 adiff = src.oldoxy + src.oldco2 + src.on2 - (T.oldoxy + T.oldco2 + T.on2) if (adiff > src.airforce) src.airforce = adiff src.airdir = get_dir(src, T) + airtemp = src.otemp //Foreach continue //goto(1317) */ if(airN) - if(istype(linkN, /turf/space)) + if(istype(linkN, /turf/space) && (!config.air_pressure_flow)) space = 1 src.airforce = src.oxygen + src.poison + src.n2 + src.co2 + 25000 src.airdir = NORTH + airtemp = src.temp goto Enddir3 else divideby++ @@ -1265,15 +1313,19 @@ turf/proc/tot_old_gas() tosl_gas+= linkN.osl_gas ton2 += linkN.on2 totemp += linkN.otemp + if (linkN.firelevel >= config.min_gas_for_fire) + burn = 1 adiff = src.oldoxy + src.oldco2 + src.on2 - (linkN.oldoxy + linkN.oldco2 + linkN.on2) if (adiff > src.airforce) src.airforce = adiff src.airdir = NORTH + airtemp = src.otemp if(airS) - if(istype(linkS, /turf/space)) + if(istype(linkS, /turf/space) && (!config.air_pressure_flow)) space = 1 src.airforce = src.oxygen + src.poison + src.n2 + src.co2 + 25000 src.airdir = get_dir(src, SOUTH) + airtemp = src.temp goto Enddir3 else divideby++ @@ -1283,15 +1335,19 @@ turf/proc/tot_old_gas() tosl_gas+= linkS.osl_gas ton2 += linkS.on2 totemp += linkS.otemp + if (linkS.firelevel >= config.min_gas_for_fire) + burn = 1 adiff = src.oldoxy + src.oldco2 + src.on2 - (linkS.oldoxy + linkS.oldco2 + linkS.on2) if (adiff > src.airforce) src.airforce = adiff src.airdir = SOUTH + airtemp = src.otemp if(airE) - if(istype(linkE, /turf/space)) + if(istype(linkE, /turf/space) && (!config.air_pressure_flow)) space = 1 src.airforce = src.oxygen + src.poison + src.n2 + src.co2 + 25000 src.airdir = EAST + airtemp = src.temp goto Enddir3 else divideby++ @@ -1301,15 +1357,19 @@ turf/proc/tot_old_gas() tosl_gas+= linkE.osl_gas ton2 += linkE.on2 totemp += linkE.otemp + if (linkE.firelevel >= config.min_gas_for_fire) + burn = 1 adiff = src.oldoxy + src.oldco2 + src.on2 - (linkE.oldoxy + linkE.oldco2 + linkE.on2) if (adiff > src.airforce) src.airforce = adiff src.airdir = EAST + airtemp = src.otemp if(airW) - if(istype(linkW, /turf/space)) + if(istype(linkW, /turf/space) && (!config.air_pressure_flow)) space = 1 src.airforce = src.oxygen + src.poison + src.n2 + src.co2 + 25000 src.airdir = get_dir(src, WEST) + airtemp = src.temp goto Enddir3 else divideby++ @@ -1319,13 +1379,23 @@ turf/proc/tot_old_gas() tosl_gas+= linkW.osl_gas ton2 += linkW.on2 totemp += linkW.otemp + if (linkS.firelevel >= config.min_gas_for_fire) + burn = 1 adiff = src.oldoxy + src.oldco2 + src.on2 - (linkW.oldoxy + linkW.oldco2 + linkW.on2) if (adiff > src.airforce) src.airforce = adiff src.airdir = WEST + airtemp = src.otemp Enddir3: + if((!space) && config.air_pressure_flow && (istype(src.linkN, /turf/space) || istype(src.linkS, /turf/space) || istype(src.linkE, /turf/space) || istype(src.linkW, /turf/space) || istype(src, /turf/space))) + space = 1 + + if (config.air_pressure_flow && abs(airtemp-(20.0+T0C))>5) + var/tempForce = airtemp / (20.0+T0C) + src.airforce = src.airforce * tempForce + if (src.airforce > 25000) for(var/atom/movable/AM in src) if ((!( AM.anchored ) && AM.weight <= src.airforce)) @@ -1334,7 +1404,7 @@ turf/proc/tot_old_gas() return //Foreach goto(1518) - if (space) + if (space && ((!config.air_pressure_flow) || (!burn))) src.oxygen = 0 src.poison = 0 src.co2 = 0 @@ -1377,14 +1447,17 @@ turf/proc/tot_old_gas() var/ton2 = src.n2 var/totemp = src.temp var/space = 0 + var/burn = src.firelevel >= 10 src.airdir = null src.airforce = 0 var/adiff = null + var/airtemp = 0 /*for(var/turf/T in src.FindLinkedTurfs()) if (istype(T, /turf/space)) space = 1 src.airforce = src.oxygen + src.poison + src.n2 + src.co2 + 25000 src.airdir = get_dir(src, T) + airtemp = src.temp break // *****RM else divideby++ @@ -1394,19 +1467,23 @@ turf/proc/tot_old_gas() tosl_gas += T.tsl_gas ton2 += T.tn2 totemp += T.ttemp + if (T.firelevel >= config.min_gas_for_fire) + burn = 1 adiff = src.tmpoxy + src.tmpco2 + src.tn2 - (T.tmpoxy + T.tmpco2 + T.tn2) if (adiff > src.airforce) src.airforce = adiff src.airdir = get_dir(src, T) + airtemp = src.ttemp //Foreach continue //goto(1872) */ if(airN) - if(istype(linkN, /turf/space)) + if(istype(linkN, /turf/space) && (!config.air_pressure_flow)) space = 1 src.airforce = src.oxygen + src.poison + src.n2 + src.co2 + 25000 src.airdir = NORTH + airtemp = src.temp goto Enddir4 else divideby++ @@ -1416,15 +1493,19 @@ turf/proc/tot_old_gas() tosl_gas+= linkN.tsl_gas ton2 += linkN.tn2 totemp += linkN.ttemp + if (linkN.firelevel >= config.min_gas_for_fire) + burn = 1 adiff = src.tmpoxy + src.tmpco2 + src.tn2 - (linkN.tmpoxy + linkN.tmpco2 + linkN.tn2) if (adiff > src.airforce) src.airforce = adiff src.airdir = NORTH + airtemp = src.ttemp if(airS) - if(istype(linkS, /turf/space)) + if(istype(linkS, /turf/space) && (!config.air_pressure_flow)) space = 1 src.airforce = src.oxygen + src.poison + src.n2 + src.co2 + 25000 src.airdir = get_dir(src, SOUTH) + airtemp = src.temp goto Enddir4 else divideby++ @@ -1434,15 +1515,19 @@ turf/proc/tot_old_gas() tosl_gas+= linkS.tsl_gas ton2 += linkS.tn2 totemp += linkS.ttemp + if (linkS.firelevel >= config.min_gas_for_fire) + burn = 1 adiff = src.tmpoxy + src.tmpco2 + src.tn2 - (linkS.tmpoxy + linkS.tmpco2 + linkS.tn2) if (adiff > src.airforce) src.airforce = adiff src.airdir = SOUTH + airtemp = src.ttemp if(airE) - if(istype(linkE, /turf/space)) + if(istype(linkE, /turf/space) && (!config.air_pressure_flow)) space = 1 src.airforce = src.oxygen + src.poison + src.n2 + src.co2 + 25000 src.airdir = EAST + airtemp = src.temp goto Enddir4 else divideby++ @@ -1452,15 +1537,19 @@ turf/proc/tot_old_gas() tosl_gas+= linkE.tsl_gas ton2 += linkE.tn2 totemp += linkE.ttemp + if (linkE.firelevel >= config.min_gas_for_fire) + burn = 1 adiff = src.tmpoxy + src.tmpco2 + src.tn2 - (linkE.tmpoxy + linkE.tmpco2 + linkE.tn2) if (adiff > src.airforce) src.airforce = adiff src.airdir = EAST + airtemp = src.ttemp if(airW) - if(istype(linkW, /turf/space)) + if(istype(linkW, /turf/space) && (!config.air_pressure_flow)) space = 1 src.airforce = src.oxygen + src.poison + src.n2 + src.co2 + 25000 src.airdir = get_dir(src, WEST) + airtemp = src.temp goto Enddir4 else divideby++ @@ -1470,13 +1559,22 @@ turf/proc/tot_old_gas() tosl_gas+= linkW.tsl_gas ton2 += linkW.tn2 totemp += linkW.ttemp + if (linkW.firelevel >= config.min_gas_for_fire) + burn = 1 adiff = src.tmpoxy + src.tmpco2 + src.tn2 - (linkW.tmpoxy + linkW.tmpco2 + linkW.tn2) if (adiff > src.airforce) src.airforce = adiff src.airdir = WEST + airtemp = src.ttemp Enddir4: + if((!space) && config.air_pressure_flow && (istype(src.linkN, /turf/space) || istype(src.linkS, /turf/space) || istype(src.linkE, /turf/space) || istype(src.linkW, /turf/space) || istype(src, /turf/space))) + space = 1 + + if (config.air_pressure_flow && abs(airtemp-(20.0+T0C))>5) + var/tempForce = airtemp / (20.0+T0C) + src.airforce = src.airforce * tempForce if (src.airforce > 25000) for(var/atom/movable/AM as mob|obj in src) @@ -1485,7 +1583,7 @@ turf/proc/tot_old_gas() step(AM, src.airdir) return //Foreach goto(2073) - if (space) + if (space && ((!config.air_pressure_flow) || (!burn))) src.oxygen = 0 src.poison = 0 src.co2 = 0 @@ -1521,7 +1619,7 @@ turf/proc/tot_old_gas() // world.log << "Tot[tag]=[total+tpoison+tco2+tosl_gas+ton2] / [divideby]" // world.log << "T[tag]=[tot_gas()] .Old=[tot_old_gas()]" - if ((locate(/obj/effects/water, src) || src.firelevel < 900000.0)) + if ((locate(/obj/effects/water, src) || src.firelevel < config.min_gas_for_fire)) src.firelevel = 0 //cool due to water temp += (T20C - temp) / FIRERATE diff --git a/Code/cellautomata.dm b/Code/cellautomata.dm index 58b90c2..9e519ce 100644 --- a/Code/cellautomata.dm +++ b/Code/cellautomata.dm @@ -84,7 +84,7 @@ //Foreach goto(507) return -/obj/team/proc/show_screen(user as mob) +/obj/team/proc/show_screen(mob/user as mob) var/dat = "

CTF Team


"
 	dat += text("\[disband\]\n", src)
@@ -96,7 +96,7 @@
 		//Foreach goto(79)
 	dat += text("Base: \t[]\nColor: \t[]\n\nRefresh", src, src.base, src, src.color, src)
 	dat += "
" - user << browse(dat, "window=ctf_team") + user.client_mob() << browse(dat, "window=ctf_team") return /obj/team/Topic(href, href_list) @@ -127,7 +127,7 @@ if (href_list["captain"]) var/L = list( ) for(var/mob/human/H in world) - if (H.client) + if (H.client || H.currentDrone!=null) L += H //Foreach goto(331) for(var/obj/team/T in world) @@ -213,14 +213,14 @@ return src.picker return -/obj/ctf_assist/proc/show_pick(user as mob) +/obj/ctf_assist/proc/show_pick(mob/user as mob) var/dat = "

CTF Mode Pick


" dat += text("Players (per Team): []
\n\"Please Pick a Player
", src.play_team) for(var/mob/human/H in src.players_left) dat += text("[] ([])
", src, H, H.rname, H.key) //Foreach goto(39) - user << browse(dat, "window=ctf_pick") + user.client_mob() << browse(dat, "window=ctf_pick") return /obj/ctf_assist/proc/get_team(captain as mob) @@ -258,12 +258,12 @@ world << text("Team: [] Team led by [] in []", uppertext(winner.color), winner.captain, winner.base) world << "Original Members:" for(var/mob/human/H in winner.members) - if (H.client) + if (H.client || H.currentDrone!=null) world << text("\t [] ([])", H.rname, H.key) //Foreach goto(266) return -/obj/ctf_assist/proc/show_screen(user as mob) +/obj/ctf_assist/proc/show_screen(mob/user as mob) var/dat = "

CTF Mode Helper


"
 	dat += text("Players (per Team): []\nBarrier Time: [] minutes\n\nTeams:\n", src, src.play_team, src, src.barriertime)
@@ -281,7 +281,7 @@
 		//Foreach goto(43)
 	dat += text("\[Add Team\]\nCaptains Select Members\n\nStart the Game (and Set up Map)\n\nWin Options: []\nCollection - All flags same color on clipboard\nConversion - All flags same color\nNone\n\nOther Options:\nAuto-Dress (Teams): []\nRemove Engine Ejection: []\nPaint Cans: []\nImmobile flags (Territory): []\nAdd Neutral Flags to Unused Bases: []\n\nRefresh", src, src, src, src.wintype, src, src, src, src, (src.autodress ? "Yes" : "No"), src, (src.ejectengine ? "Yes" : "No"), src, (src.paint_cans ? "Yes" : "No"), src, (src.immobile ? "Yes" : "No"), src, (src.neutral_replace ? "Yes" : "No"), src)
 	dat += "
" - user << browse(dat, "window=ctf_assist") + user.client_mob() << browse(dat, "window=ctf_assist") return /obj/ctf_assist/Topic(href, href_list) @@ -299,7 +299,7 @@ next_pick() return else - usr << "It's not your turn!" + usr.client_mob() << "It's not your turn!" if (!( usr.CanAdmin() )) return if (href_list["team"]) @@ -351,7 +351,7 @@ src.picking = 0 src.players_left.len = 0 src.pickers_left.len = 0 - usr << "Not enough players/teams!" + usr.client_mob() << "Not enough players/teams!" return world << "Now Selecting Teams!!!" src.picker = pick(src.pickers_left) @@ -512,7 +512,7 @@ if(href_list["vmode"]) - if ((src.rank in list( "Moderator", "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 2) vote.mode = text2num(href_list["vmode"])-1 // hack to yield 0=restart, 1=changemode vote.voting = 1 // now voting vote.votetime = world.timeofday + config.voteperiod*10 // when the vote will end @@ -525,12 +525,13 @@ if(config.logvote || config.logadmin) world.log << "VOTE/ADMIN: Voting to [vote.mode?"change mode":"restart round"] forced by admin [usr.key]" - for(var/mob/CM in world) - if(CM.client) - CM.client.vote = "default" + for(var/mob/CM in world) + var/client/CCM = CM.cliented() + if (CCM) + CCM.vote = "default" if(href_list["votekill"]) - if ((src.rank in list( "Moderator", "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 2) world << "\red ***Voting aborted by [usr.key]." @@ -540,13 +541,14 @@ vote.nextvotetime = world.timeofday + 10*config.votedelay for(var/mob/M in world) // clear vote window from all clients - if(M.client) - M << browse(null, "window=vote") - M.client.showvote = 0 + var/client/CM = M.cliented() + if (CM) + M.client_mob() << browse(null, "window=vote") + CM.showvote = 0 if (href_list["vt_rst"]) - if ((src.rank in list("Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) config.allowvoterestart = !config.allowvoterestart @@ -557,7 +559,7 @@ update() if (href_list["vt_mode"]) - if ((src.rank in list("Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) config.allowvotemode = !config.allowvotemode @@ -568,24 +570,24 @@ update() if (href_list["boot"]) - if ((src.rank in list( "Moderator", "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 4) var/dat = "Boot Player:
" - for(var/mob/M in world) + for(var/mob/M in world) dat += text("N:[] R:[] (K:[]) (IP:[])
", src, M, M.name, M.rname, (M.client ? M.client : M.lastKnownCKey? "Formerly [M.lastKnownCKey]" : "No Client"), M.lastKnownIP) //Foreach goto(103) usr << browse(dat, "window=boot") if (href_list["boot2"]) - if ((src.rank in list( "Moderator", "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 4) var/mob/M = locate(href_list["boot2"]) if (ismob(M)) if ((M.client && M.client.holder && M.client.holder.rank >= src.rank)) - alert("You cannot perform this. Action you must be of a higher administrative rank!", null, null, null, null, null) + alert("You cannot perform this action! You must be of a higher administrative rank!", null, null, null, null, null) return if(config.logadmin) world.log << text("ADMIN: [] booted [].", usr.key, M.key) //M.client = null del(M.client) if (href_list["ban"]) - if ((src.rank in list( "Moderator", "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 4) var/dat = "Ban Player:
" for(var/mob/M in world) dat += text("N: [] R: [] (K: []) (IP: [])
", src, M, M.name, M.rname, (M.client ? M.client : M.lastKnownCKey? "Formerly [M.lastKnownCKey]" : "No Client"), M.lastKnownIP) @@ -596,63 +598,63 @@ //Foreach goto(424) usr << browse(dat, "window=ban") if (href_list["ban2"]) - if ((src.rank in list( "Moderator", "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 4) var/mob/M = locate(href_list["ban2"]) if (ismob(M)) if ((M.client && M.client.holder && M.client.holder.rank >= src.rank)) - alert("You cannot perform this. Action you must be of a higher administrative rank!", null, null, null, null, null) + alert("You cannot perform this action! You must be of a higher administrative rank!", null, null, null, null, null) return if(config.logadmin) world.log << text("ADMIN: [] banned [].", usr.key, M.key) banned += ckey(M.key) //M.client = null del(M.client) if (href_list["unban2"]) - if ((src.rank in list( "Moderator", "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 4) var/t = href_list["unban2"] if (t) banned -= t if(config.logadmin) world.log << text("ADMIN: [] unbanned [].", usr.key, t) if (href_list["mute"]) - if ((src.rank in list( "Moderator", "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 4) var/dat = "Mute/Unmute Player:
" for(var/mob/M in world) dat += text("N:[] R:[] (K:[]) (IP: []) \[[]\]
", src, M, M.name, M.rname, (M.client ? M.client : M.lastKnownCKey? "Formerly [M.lastKnownCKey]" : "No Client"), M.lastKnownIP, (M.muted ? "Muted" : "Voiced")) //Foreach goto(757) usr << browse(dat, "window=mute") if (href_list["mute2"]) - if ((src.rank in list( "Moderator", "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 4) var/mob/M = locate(href_list["mute2"]) if (ismob(M)) if ((M.client && M.client.holder && M.client.holder.rank >= src.rank)) - alert("You cannot perform this. Action you must be of a higher administrative rank!", null, null, null, null, null) + alert("You cannot perform this action! You must be of a higher administrative rank!", null, null, null, null, null) return if(config.logadmin) world.log << text("ADMIN: [] altered []'s mute status.", usr.key, M.key) M.muted = !( M.muted ) if (href_list["restart"]) - if ((src.rank in list( "Game Master", "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 2) var/dat = text("Restart game?
\n
\nYes\n", src) usr << browse(dat, "window=restart") if (href_list["restart2"]) - if ((src.rank in list( "Game Master", "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 2) world << text("\red Restarting world!\blue Initiated by []!", usr.key) if(config.logadmin) world.log << text("ADMIN: [] initiated a reboot.", usr.key) sleep(50) world.Reboot() if (href_list["restart3"]) - if ((src.rank in list( "Game Master", "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 2) if( alert("Reboot server?",,"Yes","No") == "No") return world << text("\red Rebooting world!\blue Initiated by []!", usr.key) if(config.logadmin) world.log << text("ADMIN: [] initiated an immediate reboot.", usr.key) world.Reboot() if (href_list["c_mode"]) - if ((src.rank in list( "Game Master", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) if (ticker) return alert(usr, "The game has already started.", null, null, null, null) var/dat = text("What mode do you wish to play?
\nSecret
\nRandom
\nTraitor
\nMeteor
\nExtended
\nMonkey
\nNuclear Emergency
\nBlob
\nSandbox
\n\nNow: []\n", src, src, src, src, src, src, src, src, src, master_mode) usr << browse(dat, "window=c_mode") if (href_list["c_mode2"]) - if ((src.rank in list( "Game Master", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) if (ticker) return alert(usr, "The game has already started.", null, null, null, null) switch(href_list["c_mode2"]) @@ -695,7 +697,7 @@ if (href_list["l_keys"]) var/dat = "Keys:
" for(var/mob/M in world) - if (M.client) + if(M.cliented()) dat += text("[]
", M.client.ckey) //Foreach goto(1525) usr << browse(dat, "window=keys") @@ -727,10 +729,10 @@ if (!( t )) return if (M.client && M.client.holder) - M << text("\blue Admin PM from-[]: []", M.client.holder, usr, usr.key, t) + M.client_mob() << text("\blue Admin PM from-[]: []", M.client.holder, usr, usr.key, t) else - M << text("\blue Admin PM from-[]: []", usr.key, t) - usr << text("\blue Admin PM to-[]: []", src, M, M.key, t) + M.client_mob() << text("\blue Admin PM from-[]: []", usr.key, t) + usr.client_mob() << text("\blue Admin PM to-[]: []", src, M, M.key, t) if(config.logadmin) world.log << "ADMIN: PM: [usr.key]->[M.key] : [t]" */ @@ -749,14 +751,14 @@ new Q( usr.loc ) if(config.logadmin) world.log << text("ADMIN: [] created a []", usr.key, Q) if (href_list["dna"]) - if ((src.rank in list( "Game Master", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) var/dat = "Registered DNA sequences:
" for(var/M in reg_dna) dat += text("\t [] = []
", M, reg_dna[text("[]", M)]) //Foreach goto(2171) usr << browse(dat, "window=dna") if (href_list["t_ooc"]) - if ((src.rank in list( "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 2) ooc_allowed = !( ooc_allowed ) if (ooc_allowed) world << "The OOC channel has been globally enabled!" @@ -764,12 +766,12 @@ world << "The OOC channel has been globally disabled!" if(config.logadmin) world.log << text("ADMIN: [] toggled OOC.", usr.key) if (href_list["startnow"]) - if ((src.rank in list( "Supervisor", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 2) world << "The game will now start immediately thanks to [usr.key]!" usr.start_now() if (href_list["toggle_enter"]) - if ((src.rank in list( "Game Master", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) enter_allowed = !( enter_allowed ) if (!( enter_allowed )) world << "You may no longer enter the game." @@ -779,7 +781,7 @@ world.update_stat() update() if (href_list["toggle_ai"]) - if ((src.rank in list( "Game Master", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) config.allowai = !( config.allowai ) if (!( config.allowai )) world << "The AI job is no longer chooseable." @@ -789,7 +791,7 @@ world.update_stat() update() if (href_list["bombtemp_determines_range"]) - if ((src.rank in list( "Game Master", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) config.bombtemp_determines_range = !( config.bombtemp_determines_range ) if (!( config.bombtemp_determines_range )) world << "Bomb temperature no longer determines range (superheated bombs will not destroy a larger area than 500 degree bombs)." @@ -799,7 +801,7 @@ world.update_stat() update() if (href_list["crowbars_close_depowered_doors"]) - if ((src.rank in list( "Game Master", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) config.crowbars_close_depowered_doors = !( config.crowbars_close_depowered_doors ) if (!( config.crowbars_close_depowered_doors )) world << "Crowbars can no longer close depowered doors." @@ -809,7 +811,7 @@ world.update_stat() update() if (href_list["ai_can_call_shuttle"]) - if ((src.rank in list( "Game Master", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) config.ai_can_call_shuttle = !( config.ai_can_call_shuttle ) if (!( config.ai_can_call_shuttle )) world << "The AI can no longer call the shuttle." @@ -819,7 +821,7 @@ world.update_stat() update() if (href_list["ai_can_uncall_shuttle"]) - if ((src.rank in list( "Game Master", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) config.ai_can_uncall_shuttle = !( config.ai_can_uncall_shuttle ) if (!( config.ai_can_uncall_shuttle )) world << "The AI can no longer send the shuttle back." @@ -830,7 +832,7 @@ update() if (href_list["toggle_abandon"]) - if ((src.rank in list( "Game Master", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) abandon_allowed = !( abandon_allowed ) if (abandon_allowed) world << "You may now abandon mob." @@ -840,7 +842,7 @@ world.update_stat() update() if (href_list["delay"]) - if ((src.rank in list( "Game Master", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 2) if (ticker) return alert("Too late... The game has already started!", null, null, null, null, null) going = !( going ) @@ -851,7 +853,7 @@ world << text("The game will start soon thanks to [] (Administrator to SS13)", usr.key) if(config.logadmin) world.log << text("ADMIN: [] removed the delay.", usr.key) if (href_list["secrets"]) - if ((src.rank in list( "Game Master", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) var/dat = {" What secret do you wish to activate?
Remove 'internal' clothing
@@ -863,11 +865,17 @@ Toxic Air (WARNING: dangerous)
Turn all humans into monkies
Make all areas powered
-Spawn a wave of meteors
"} +Spawn a wave of meteors
+Self-igniting oxygen (Not at normal oxygen amounts, but a bit higher)
"} - usr << browse(dat, "window=secrets") + usr << browse(dat, "window=secrets") + if (href_list["repopMap"]) + if (src.a_level >= 5) + world << "\red

Replacing destroyed objects and mobs.

" + world.Repop() + if (href_list["secrets2"]) - if ((src.rank in list( "Game Master", "Administrator", "Major Administrator", "Primary Administrator" ))) + if (src.a_level >= 3) var/ok = 0 switch(href_list["secrets2"]) if("sec_clothes") @@ -958,7 +966,10 @@ A.power_equip = 1 A.power_environ = 1 - A.power_change() + A.power_change() + if("burningo2") + if(config.logadmin) world.log << text("ADMIN: [] used secret []", usr.key, href_list["secrets2"]) + ticker.burningo2 = 1-ticker.burningo2 if("wave") if(config.logadmin) world.log << text("ADMIN: [] used secret []", usr.key, href_list["secrets2"]) meteor_wave() @@ -972,20 +983,20 @@ /obj/admins/proc/update() var/dat - var/lvl = 0 + a_level = 0 switch(src.rank) if("Moderator") - lvl = 1 + a_level = 1 if("Game Master") - lvl = 2 + a_level = 2 if("Supervisor") - lvl = 3 + a_level = 3 if("Administrator") - lvl = 4 + a_level = 4 if("Major Administrator") - lvl = 5 + a_level = 5 if("Primary Administrator") - lvl = 6 + a_level = 6 @@ -994,7 +1005,7 @@ dat += "
Admin Control Console

\n" - if(lvl>=4) + if(a_level>=4) dat += {" Boot Player/Key
Ban/Unban Player/Key
@@ -1002,51 +1013,58 @@ "} dat += "
" - if(lvl!=1) + if(a_level!=1) dat += "Toggle OOC
" dat += "Delay Game
" dat += "Start Round Now
" - if(lvl >=3 ) + if(a_level >=3 ) dat += "Toggle Entering [enter_allowed]
" dat += "Toggle Abandon [abandon_allowed]
" dat += "Toggle AI [config.allowai]
" dat += "Toggle Bombtemp-Determines-Range [config.bombtemp_determines_range]
" dat += "Change Game Mode
" - if(lvl >= 2) + if(a_level >= 2) dat += "Restart Game
" dat += "Immediate Reboot
" dat += "
" - if(lvl!=1) + if(a_level!=1) dat += "Begin restart vote.
" dat += "Begin change mode vote.
" dat += "Abort current vote.
" - if(lvl>=3) + if(a_level>=3) dat += "Toggle restart voting [config.allowvoterestart].
" dat += "Toggle mode voting [config.allowvotemode].
" dat += "
" - if(lvl >=3 ) + if(a_level >=3 ) dat += "Activate Secrets
" dat += "Make Item
" dat += "Make Object
" dat += "
" - if(lvl >=3 ) + if(a_level >=3 ) dat += "List DNA
" dat += "List Keys
" - dat += "List Players/Keys
" + dat += "List Players/Keys
" + + dat += "
" + if(a_level >= 5 ) + + dat += "Recreate Destroyed Mobs and Objects
" + + dat += "Send Global Message
" dat += "Send Private Message
" - + else dat = text("
Admin Control Center

\nAccess Admin Commands
\nContact Admins
\nAccess Messageboard
\n
\nList Keys
\nList Players/Keys
\nSend Global Message
\nSend Private Message
", src, src, src, src, src, src, src) usr << browse(dat, "window=admin") @@ -1140,7 +1158,13 @@ config.bombtemp_determines_range = 0 config.crowbars_close_depowered_doors = 0 config.ai_can_call_shuttle = 0 - config.ai_can_uncall_shuttle = 0 + config.ai_can_uncall_shuttle = 0 + config.air_pressure_flow = 0 // This makes temperature affect the air pressure force which moves objects. This also allows fire to spread to floor tiles which are next to space. It would also allow fire to spread into space if (a) space tiles had air code running on them, but they don't because that would be slow, and (b) if the burning hot gas flowing out an airlock wasn't diluted rapidly upon reaching space, resulting in it enflaming at most four space tiles. + config.min_gas_for_fire = 900000 + config.meteorchance = 0.1 + config.enable_drones = 0 + config.humans_can_use_drones = 0 + config.walkable_not_pullable_drones = 0 else world.log << "Reading config.txt" var/list/CL = dd_text2list(config_text, "\n") @@ -1211,7 +1235,19 @@ if("ai_can_uncall_shuttle") config.ai_can_uncall_shuttle = 1 if("alternate_ai_laws") - config.alternate_ai_laws = 1 + config.alternate_ai_laws = 1 + if("air_pressure_flow") + config.air_pressure_flow = 1 + if ("min_gas_for_fire") + config.min_gas_for_fire = text2num(cfgval) + if("meteorchance") + config.meteorchance = text2num(cfgval) + if("enable_drones") + config.enable_drones = 1 + if("humans_can_use_drones") + config.humans_can_use_drones = 1 + if("walkable_not_pullable_drones") + config.walkable_not_pullable_drones = 1 else world.log<<"Unknown setting in config.txt: [cfgvar]" @@ -1284,8 +1320,9 @@ var/n = 0 for(var/mob/M in world) - if(M.client) - world.log << "[++n] : [M.name] ([M.client.key]) at [M.loc.loc] ([M.x],[M.y],[M.z]) : [M.client.inactivity/10.0]s" + var/mob/CM = M.cliented() + if (CM) + world.log << "[++n] : [M.name] ([CM.key]) at [M.loc.loc] ([M.x],[M.y],[M.z]) : [CM.client.inactivity/10.0]s" return n @@ -1395,7 +1432,7 @@ /datum/control/gameticker/proc/megamonkey_process() do - if (prob(2)) + if (src.meteorChanceRoll()) spawn( 0 ) new /obj/meteor( pick(block(locate(world.maxx, 1, 1), locate(world.maxx, world.maxy, 1))) ) return @@ -1410,11 +1447,19 @@ while(src.processing) return +/datum/control/gameticker/proc/meteorChanceRoll() + if (config.meteorchance<=0) + return 0 + if (config.meteorchance>=100) + return 1 + var maxroll = (100.0/config.meteorchance)-1 + var roll = rand(maxroll) + return (roll==0) /datum/control/gameticker/proc/blob_process() do - if (prob(2)) + if (src.meteorChanceRoll()) spawn( 0 ) new /obj/meteor( pick(block(locate(world.maxx, 1, 1), locate(world.maxx, world.maxy, 1))) ) return @@ -1447,8 +1492,8 @@ src.timeleft += 10 if (src.timeleft >= 6000) src.timeleft = null - src.timing = 0 - if (prob(1)) + src.timing = 0 + if (src.meteorChanceRoll()) spawn( 0 ) new /obj/meteor( pick(block(locate(world.maxx, 1, 1), locate(world.maxx, world.maxy, 1))) ) return @@ -1473,7 +1518,7 @@ src.objective = "Success" world << "The Syndicate Operatives have destroyed Space Station 13!" for(var/mob/human/H in world) - if ((H.client && findtext(H.rname, "Syndicate ", 1, null))) + if ((H.cliented() && findtext(H.rname, "Syndicate ", 1, null))) if (H.stat != 2) world << text("[] was []", H.key, H.rname) else @@ -1574,7 +1619,7 @@ numAlive = 0 numPod = 0 for(var/mob/M in world) - if ((M != src.killer && M.client)) + if ((M != src.killer && M.cliented())) if (M.stat == 2) numDead += 1 else @@ -1592,7 +1637,7 @@ traitorwin = 0 else for(var/mob/M in world) - if ((M != src.killer && M.client)) + if ((M != src.killer && M.cliented())) if (M.stat != 2) var/T = M.loc if (!( istype(T, /turf) )) @@ -1720,13 +1765,13 @@ if (monkeywin) world << "The monkies have won!" for(var/mob/monkey/M in world) - if (M.client) + if (M.cliented()) world << text("[] was a monkey.", M.key) //Foreach goto(1194) else world << "The Research Staff has stopped he monkey invasion!" for(var/mob/human/M in world) - if (M.client) + if (M.cliented()) world << text("[] was [].", M.key, M) //Foreach goto(1254) if("nuclear") @@ -1741,7 +1786,7 @@ if (disk_on_shuttle) world << "The Research Staff has stopped the Syndicate Operatives!" for(var/mob/human/H in world) - if ((H.client && !( findtext(H.rname, "Syndicate ", 1, null) ))) + if ((H.cliented() && !( findtext(H.rname, "Syndicate ", 1, null) ))) if (H.stat != 2) world << text("[] was []", H.key, H.rname) else @@ -1766,7 +1811,7 @@ var/escapees = list( ) for(var/mob/M in world) if (M.stat == 2) - if (M.client) + if (M.cliented()) if (M.virus > 0) dead += text("[] died. \red (Had Stage [] Infection)", M.rname, round(M.virus)) else @@ -1799,7 +1844,7 @@ if("meteor") var/list/L = list( ) for(var/mob/M in world) - if (M.client) + if (M.cliented()) if (M.stat != 2) var/T = M.loc if ((T in A)) @@ -1853,7 +1898,7 @@ var/numOffStation = 0 for (var/mob/ai/aiPlayer in world) for(var/mob/M in world) - if ((M != aiPlayer && M.client)) + if ((M != aiPlayer && M.cliented())) if (M.stat == 2) numDead += 1 else @@ -1928,7 +1973,7 @@ else var/list/L = list( ) for(var/mob/M in world) - if (M.client) + if (M.cliented()) if (M.stat != 2) var/T = M.loc if ((T in A)) @@ -1993,7 +2038,8 @@ world.update_stat() world << "Welcome to the Space Station 13!\n\n" - src.mode = master_mode + src.mode = master_mode + switch(src.mode) if("secret") src.mode = config.pickmode() @@ -2038,7 +2084,7 @@ world << "A nuclear explosive was being transported by Nanotrasen to a military base. The transport ship mysteriously lost contact with Space Traffic Control (STC). About that time a strange disk was discovered around SS13. It was identified by Nanotrasen as a nuclear auth. disk and now Syndicate Operatives have arrived to retake the disk and detonate SS13! Also, most likely Syndicate star ships are in the vicinity so take care not to lose the disk!\nSyndicate: Reclaim the disk and detonate the nuclear bomb anywhere on SS13.\nPersonell: Hold the disk and escape with the disk on the shuttle!" var/list/mobs = list( ) for(var/mob/human/M in world) - if ((M.client && M.start)) + if ((M.cliented() && M.start)) mobs += M //Foreach goto(260) var/obj/O = locate("landmark*CTF-rogue") @@ -2090,7 +2136,7 @@ R.layer = 20 H.w_radio = R for(var/mob/ai/M in world) - if ((M.client && M.start)) + if ((M.cliented() && M.start)) if (prob(25)) M << "Your laws have been changed!" M:addLaw(0, "Only syndicate agents are human beings.") @@ -2118,12 +2164,18 @@ reg_dna[text("[]", H.primary.uni_identity)] = H.name //Foreach goto(878) data_core.manifest() + + numDronesInExistance = 0 + for (var/mob/drone/D in world) + D.nameDrone(numDronesInExistance) + numDronesInExistance ++ + switch(src.mode) if("traitor") var/list/mobs = list( ) Label_970: for(var/mob/M in world) - if ((M.client && M.start)) + if ((M.cliented() && M.start)) mobs += M //Foreach goto(983) if (!( mobs.len )) @@ -2290,7 +2342,7 @@ spawn( 50 ) var/list/mobs = list( ) for(var/mob/human/M in world) - if ((M.client && M.start)) + if ((M.cliented() && M.start)) mobs += M //Foreach goto(1974) if (mobs.len >= 3) @@ -2425,7 +2477,7 @@ spawn( 50 ) var/list/mobs = list( ) for(var/mob/human/M in world) - if ((M.client && M.start)) + if ((M.cliented() && M.start)) mobs += M //Foreach goto(2295) if (mobs.len > 3) @@ -2481,7 +2533,8 @@ if (T.updatecell) T.updatecell() if(!time) - T.conduction() + T.conduction() + //if(Debug) // world.log << "*** EoT ***" // Air() diff --git a/Code/computer.dm b/Code/computer.dm index e9202f2..39148d5 100644 --- a/Code/computer.dm +++ b/Code/computer.dm @@ -186,10 +186,15 @@ return /turf/space/updatecell() - + if (config.air_pressure_flow) + if ((src.linkN && src.linkN.firelevel && src.linkN.firelevel > 0) || (src.linkS && src.linkS.firelevel && src.linkS.firelevel > 0) || (src.linkE && src.linkE.firelevel && src.linkE.firelevel > 0) || (src.linkW && src.linkW.firelevel && src.linkW.firelevel > 0)) + ..() return /turf/space/conduction() + if (config.air_pressure_flow) + if ((src.linkN && src.linkN.firelevel && src.linkN.firelevel > 0) || (src.linkS && src.linkS.firelevel && src.linkS.firelevel > 0) || (src.linkE && src.linkE.firelevel && src.linkE.firelevel > 0) || (src.linkW && src.linkW.firelevel && src.linkW.firelevel > 0)) + ..() return /turf/space/Entered(atom/movable/A as mob|obj) @@ -242,7 +247,7 @@ t1 = round(t1) if (t1 < 5) if (prob(t1)) - M << "\blue You slipped!" + M.client_mob() << "\blue You slipped!" else spawn( 5 ) if (src == A.loc) @@ -277,7 +282,7 @@ return if( ticker.mode == "blob" ) - user << "Under directive 7-10, SS13 is quarantined until further notice." + user.client_mob() << "Under directive 7-10, SS13 is quarantined until further notice." return world << "\blue Alert: The emergency shuttle has been called. It will arrive in T-10:00 minutes." diff --git a/Code/cryo.dm b/Code/cryo.dm index c5ee2bd..d91f27a 100644 --- a/Code/cryo.dm +++ b/Code/cryo.dm @@ -3,8 +3,8 @@ /obj/item/weapon/flasks/examine() set src in oview(1) - usr << text("The flask is []% full", (src.oxygen + src.plasma + src.coolant) * 100 / 500) - usr << "The flask can ONLY store liquids." + usr.client_mob() << text("The flask is []% full", (src.oxygen + src.plasma + src.coolant) * 100 / 500) + usr.client_mob() << "The flask can ONLY store liquids." return /mob/human/abiotic() diff --git a/Code/datumvars.dm b/Code/datumvars.dm index a2ee4ba..4ef0384 100644 --- a/Code/datumvars.dm +++ b/Code/datumvars.dm @@ -23,7 +23,7 @@ dat += variable(usr, V, D.vars[V]) //get the text for that variable dat += "" - usr << browse(dat, "window=\ref[D]") // display the browser pop-up + usr.client_mob() << browse(dat, "window=\ref[D]") // display the browser pop-up // return a HTML formatted string displaying a variable @@ -45,7 +45,7 @@ #ifdef VARSICON var/rnd = rand(1,10000) // use random number in filename to avoid conflicts - user << browse_rsc(val, "tmp\ref[val][rnd].png") // precache the icon image file + user.client_mob() << browse_rsc(val, "tmp\ref[val][rnd].png") // precache the icon image file t+="" // and add the icon to the HTML #endif diff --git a/Code/demo.dm b/Code/demo.dm index aefacd8..249727d 100644 --- a/Code/demo.dm +++ b/Code/demo.dm @@ -53,7 +53,7 @@ if (!( src.gas )) return var/dat = text("Tank
\nContains/Capacity [] / []
\nInterals Valve: [] Gas Flow
\n\t- - - [] + + +
\n
\nClose\n
", src.gas.tot_gas(), src.maximum, src, ((src.loc == user && user.internal == src) ? "Stop" : "Restore"), src, src, src, src.i_used, src, src, src, user) - user << browse(dat, "window=tank;size=600x300") + user.client_mob() << browse(dat, "window=tank;size=600x300") return /obj/item/weapon/tank/Topic(href, href_list) @@ -69,18 +69,18 @@ if ((href_list["stat"] && src.loc == usr)) if (usr.internal == src) usr.internal = null - src.updateEquippedDialog() + src.updateEquippedDialog() return if (usr.internal) usr.internal = null if ((!( usr.wear_mask ) || !( usr.wear_mask.flags & 8 ))) return usr.internal = src - usr << "\blue Now running on internals!" + usr.client_mob() << "\blue Now running on internals!" src.add_fingerprint(usr) src.updateEquippedDialog() else - usr << browse(null, "window=tank") + usr.client_mob() << browse(null, "window=tank") return return @@ -96,29 +96,29 @@ return /obj/item/weapon/tank/attack(mob/M as mob, mob/user as mob) - + ..() if ((prob(30) && M.stat < 2)) - var/mob/human/H = M + if (istype(M, /mob/human) || istype(M, /mob/monkey)) + var/mob/human/H = M // ******* Check - - if ((istype(H, /mob/human) && istype(H, /obj/item/weapon/clothing/head) && H.flags & 8 && prob(80))) - M << "\red The helmet protects you from being hit hard in the head!" - return - var/time = rand(10, 120) - if (prob(90)) - if (M.paralysis < time) - M.paralysis = time - else - if (M.stunned < time) - M.stunned = time - M.stat = 1 - for(var/mob/O in viewers(M, null)) - if ((O.client && !( O.blinded ))) - O << text("\red [] has been knocked unconscious!", M) - //Foreach goto(169) - M << text("\red This was a []% hit. Roleplay it! (personality/memory change if the hit was severe enough)", time * 100 / 120) + if ((istype(H, /mob/human) && istype(H, /obj/item/weapon/clothing/head) && H.flags & 8 && prob(80))) + M.client_mob() << "\red The helmet protects you from being hit hard in the head!" + return + var/time = rand(10, 120) + if (prob(90)) + if (M.paralysis < time) + M.paralysis = time + else + if (M.stunned < time) + M.stunned = time + M.stat = 1 + for(var/mob/O in viewers(M, null)) + if ((!( O.blinded ))) + O.client_mob() << text("\red [] has been knocked unconscious!", M) + //Foreach goto(169) + M.client_mob() << text("\red This was a []% hit. Roleplay it! (personality/memory change if the hit was severe enough)", time * 100 / 120) return /obj/item/weapon/tank/New() @@ -149,7 +149,7 @@ set src in view(1) if(src) - usr << text("\blue The \icon[] contains [] unit\s of gas.", src, src.gas.tot_gas()) + usr.client_mob() << text("\blue The \icon[] contains [] unit\s of gas.", src, src.gas.tot_gas()) return /obj/item/weapon/tank/oxygentank/New() @@ -165,7 +165,6 @@ return /obj/item/weapon/tank/jetpack/verb/toggle() - src.on = !( src.on ) src.icon_state = text("jetpack[]", src.on) return @@ -296,10 +295,10 @@ flick("flash", M.flash) //Foreach goto(732) var/m_range = 2 - var/extended_range = round(strength / 387) - if (extended_range < 2) - extended_range = 2 - if (config.bombtemp_determines_range) + var/extended_range = round(strength / 387) + if (extended_range < 2) + extended_range = 2 + if (config.bombtemp_determines_range) m_range = extended_range for(var/obj/machinery/atmoalter/canister/C in range(2, T)) if (!( C.destroyed )) @@ -310,46 +309,46 @@ var/min = extended_range var/med = extended_range * 2 var/max = extended_range * 3 - var/u_max = m_range * 4 - + var/u_max = m_range * 4 + var/turf/sw = locate(max(T.x - u_max, 1), max(T.y - u_max, 1), T.z) var/turf/ne = locate(min(T.x + u_max, world.maxx), min(T.y + u_max, world.maxy), T.z) defer_powernet_rebuild = 1 - - //If m_range is <= 12, then we are going to calculate the squared distance between tiles and ground zero. To avoid complicating comparisons in the for loop with additional if statements, we are going to square max, med, and min. You wouldn't be able to subtract tileRange (squared) from max, med, or min and get a useful distance, but this works fine for comparing the range to max, med, or min, without caring about how far between them it is. -Trafalgar - - if (m_range<=12) - max *= max - med *= med - min *= min - u_max *= u_max - - for(var/turf/U in block(sw, ne)) - var tileRange = 0 - var/zone = 4 - //If this if-else were outside the for loop, this would (assuming BYOND doesn't optimize this already) help improve performance more, but the only way I see to do that would be to have two copies of the for loop, one for m_range <= 12 and one for m_range > 12. -Trafalgar - if (m_range<=12) - tileRange = (U.y-T.y)*(U.y-T.y) + (U.x-T.x)*(U.x-T.x) - else - tileRange = max(abs(U.y-T.y), abs(U.x-T.x)) - - if (tileRange <= u_max) - //If this were, say, c++, then this would be faster than the commented out code (for one it isn't doing calculations 3 times over for no reason, for two it's an if-elseif-elseif instead of three ifs which all would get evaluated. It might be slightly faster if we did if (tileRange>max) first, then else if (tileRange > med), then else if (tileRange > min), then else (due to performance increases from having if/elseif/elses's ordered with the choices sorted from most likely at the top to least likely at the end, but who knows if this even applies to BYOND games since the performance benefit is the result of how the CPU processes comparisons and branching and such). -Trafalgar - if (tileRange <= min) - zone = 1 - else if (tileRange <= med) - zone = 2 - else if (tileRange <= max) - zone = 3 + //If m_range is <= 12, then we are going to calculate the squared distance between tiles and ground zero. To avoid complicating comparisons in the for loop with additional if statements, we are going to square max, med, and min. You wouldn't be able to subtract tileRange (squared) from max, med, or min and get a useful distance, but this works fine for comparing the range to max, med, or min, without caring about how far between them it is. -Trafalgar + + if (m_range<=12) + max *= max + med *= med + min *= min + u_max *= u_max + + for(var/turf/U in block(sw, ne)) + var tileRange = 0 + var/zone = 4 + //If this if-else were outside the for loop, this would (assuming BYOND doesn't optimize this already) help improve performance more, but the only way I see to do that would be to have two copies of the for loop, one for m_range <= 12 and one for m_range > 12. -Trafalgar + if (m_range<=12) + tileRange = (U.y-T.y)*(U.y-T.y) + (U.x-T.x)*(U.x-T.x) + else + tileRange = max(abs(U.y-T.y), abs(U.x-T.x)) + + + if (tileRange <= u_max) + //If this were, say, c++, then this would be faster than the commented out code (for one it isn't doing calculations 3 times over for no reason, for two it's an if-elseif-elseif instead of three ifs which all would get evaluated. It might be slightly faster if we did if (tileRange>max) first, then else if (tileRange > med), then else if (tileRange > min), then else (due to performance increases from having if/elseif/elses's ordered with the choices sorted from most likely at the top to least likely at the end, but who knows if this even applies to BYOND games since the performance benefit is the result of how the CPU processes comparisons and branching and such). -Trafalgar + if (tileRange <= min) + zone = 1 + else if (tileRange <= med) + zone = 2 + else if (tileRange <= max) + zone = 3 /*if ((U.y <= (T.y + max) && U.y >= (T.y - max) && U.x <= (T.x + max) && U.x >= (T.x - max) )) zone = 3 if ((U.y <= (T.y + med) && U.y >= (T.y - med) && U.x <= (T.x + med) && U.x >= (T.x - med) )) zone = 2 if ((U.y <= (T.y + min) && U.y >= (T.y - min) && U.x <= (T.x + min) && U.x >= (T.x - min) )) - zone = 1 - */ + zone = 1 + */ for(var/atom/A in U) A.ex_act(zone) //Foreach goto(1217) @@ -371,7 +370,8 @@ /obj/item/weapon/tank/plasmatank/attackby(obj/item/weapon/W as obj, mob/user as mob) - + var/mob/CM = user.client_mob() + var/client/CL = CM.client if (istype(W, /obj/item/weapon/assembly/rad_ignite)) var/obj/item/weapon/assembly/rad_ignite/S = W if (!( S.status )) @@ -383,20 +383,27 @@ R.part2 = S.part2 S.part2.loc = R S.part2.master = R - S.layer = initial(S.layer) - if (user.client) - user.client.screen -= S - if (user.r_hand == S) - user.u_equip(S) - user.r_hand = R - else - user.u_equip(S) - user.l_hand = R + S.layer = initial(S.layer) + if (CL) + CL.screenOrBackupRemove(S) + CL.screen -= S + if (istype(user, /mob/drone)) + if (user.equipped() == S) + user.u_equip(S) + user:grip(R) + else + if (user.r_hand == S) + user.u_equip(S) + user.r_hand = R + else + user.u_equip(S) + user.l_hand = R src.master = R src.layer = initial(src.layer) user.u_equip(src) - if (user.client) - user.client.screen -= src + if (CL) + CL.screenOrBackupRemove(src) + CL.screen -= src src.loc = R R.part3 = src R.layer = 20 @@ -417,19 +424,26 @@ S.part2.loc = R S.part2.master = R S.layer = initial(S.layer) - if (user.client) - user.client.screen -= S - if (user.r_hand == S) - user.u_equip(S) - user.r_hand = R - else - user.u_equip(S) - user.l_hand = R + if (CL) + CL.screenOrBackupRemove(S) + CL.screen -= S + if (istype(user, /mob/drone)) + if (user.equipped() == S) + user.u_equip(S) + user:grip(R) + else + if (user.r_hand == S) + user.u_equip(S) + user.r_hand = R + else + user.u_equip(S) + user.l_hand = R src.master = R src.layer = initial(src.layer) user.u_equip(src) - if (user.client) - user.client.screen -= src + if (CL) + CL.screenOrBackupRemove(src) + CL.screen -= src src.loc = R R.part3 = src R.layer = 20 @@ -451,19 +465,26 @@ S.part2.loc = R S.part2.master = R S.layer = initial(S.layer) - if (user.client) - user.client.screen -= S - if (user.r_hand == S) - user.u_equip(S) - user.r_hand = R - else - user.u_equip(S) - user.l_hand = R + if (CL) + CL.screenOrBackupRemove(S) + CL.screen -= S + if (istype(user, /mob/drone)) + if (user.equipped() == S) + user.u_equip(S) + user:grip(R) + else + if (user.r_hand == S) + user.u_equip(S) + user.r_hand = R + else + user.u_equip(S) + user.l_hand = R src.master = R src.layer = initial(src.layer) user.u_equip(src) - if (user.client) - user.client.screen -= src + if (CL) + CL.screenOrBackupRemove(src) + CL.screen -= src src.loc = R R.part3 = src R.layer = 20 @@ -588,11 +609,12 @@ /obj/secloset/personal/attackby(obj/item/weapon/W as obj, mob/user as mob) if (src.opened) - if (istype(W, /obj/item/weapon/grab)) - src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet - else: - user.drop_item() - W.loc = src.loc + if (istype(W, /obj/item/weapon/grab)) + src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet + else: + if (user.can_drop()) + user.drop_item() + W.loc = src.loc else if (istype(W, /obj/item/weapon/card/id)) var/obj/item/weapon/card/id/I = W @@ -605,17 +627,17 @@ if (I.check_access(access,allowed)) src.locked = !( src.locked ) for(var/mob/O in viewers(user, 3)) - if ((O.client && !( O.blinded ))) - O << text("\blue The locker has been []locked by [].", (src.locked ? null : "un"), user) + if (O.hasClient() && !( O.blinded )) + O.client_mob() << text("\blue The locker has been []locked by [].", (src.locked ? null : "un"), user) //Foreach goto(185) src.icon_state = text("[]secloset0", (src.locked ? "1" : null)) if (!( src.allowed )) src.allowed = "Name:[I.registered]/Captain/Head of Personnel" src.desc = "Owned by [I.registered], Clear by using a card of rank 'Systems'" else - user << "\red Access Denied" + user.client_mob() << "\red Access Denied" else - user << "\red It's closed..." + user.client_mob() << "\red It's closed..." return /obj/secloset/security2/New() @@ -780,9 +802,11 @@ //Foreach goto(29) for(var/mob/M in src) M.loc = src.loc - if (M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE + var/client/client = M.alwaysClient() + if (client) + if (client.eye == src) + client.eye = client.mob + client.perspective = MOB_PERSPECTIVE //Foreach goto(71) src.icon_state = "secloset1" //SN src = null @@ -793,11 +817,12 @@ /obj/secloset/attackby(obj/item/weapon/W as obj, mob/user as mob) if (src.opened) - if (istype(W, /obj/item/weapon/grab)) - src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet - else: - user.drop_item() - W.loc = src.loc + if (istype(W, /obj/item/weapon/grab)) + src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet + else: + if (user.can_drop()) + user.drop_item() + W.loc = src.loc else if (istype(W, /obj/item/weapon/card/id)) var/obj/item/weapon/card/id/I = W @@ -805,14 +830,13 @@ if(I.check_access(access,allowed)) src.locked = !( src.locked ) for(var/mob/O in viewers(user, 3)) - if ((O.client && !( O.blinded ))) - O << text("\blue The locker has been []locked by [].", (src.locked ? null : "un"), user) - //Foreach goto(121) + if (O.hasClient() && !( O.blinded )) + O.client_mob() << text("\blue The locker has been []locked by [].", (src.locked ? null : "un"), user) src.icon_state = text("[]secloset0", (src.locked ? "1" : null)) else - user << "\red Access Denied" + user.client_mob() << "\red Access Denied" else - user << "\red It's closed..." + user.client_mob() << "\red It's closed..." return /obj/secloset/relaymove(mob/user as mob) @@ -825,17 +849,18 @@ //Foreach goto(36) for(var/mob/M in src) M.loc = src.loc - if (M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE - //Foreach goto(78) + var/client/client = M.alwaysClient() + if (client) + if (client.eye == src) + client.eye = client.mob + client.perspective = MOB_PERSPECTIVE src.icon_state = "secloset1" src.opened = 1 else - user << "\blue It's welded shut!" + user.client_mob() << "\blue It's welded shut!" for(var/mob/M in hearers(src, null)) - M << text("BANG, bang!", max(0, 5 - get_dist(src, M))) - //Foreach goto(170) + var/msg = text("BANG, bang!", max(0, 5 - get_dist(src, M))) + M.client_mob() << msg return /obj/secloset/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob) @@ -847,9 +872,8 @@ step_towards(O, src.loc) if (user != O) for(var/mob/B in viewers(user, 3)) - if ((B.client && !( B.blinded ))) - B << text("\red [] stuffs [] into []!", user, O, src) - //Foreach goto(115) + if (B.hasClient() && !( B.blinded )) + B.client_mob() << text("\red [] stuffs [] into []!", user, O, src) src.add_fingerprint(user) return @@ -868,23 +892,24 @@ //Foreach goto(43) for(var/mob/M in src) M.loc = src.loc - if (M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE - //Foreach goto(85) + var/client/client = M.alwaysClient() + if (client) + if (client.eye == src) + client.eye = client.mob + client.perspective = MOB_PERSPECTIVE src.icon_state = "secloset1" src.opened = 1 else - usr << "\blue It's locked tight!" + usr.client_mob() << "\blue It's locked tight!" else for(var/obj/item/I in src.loc) if (!( I.anchored )) I.loc = src //Foreach goto(176) for(var/mob/M in src.loc) - if (M.client) + if (M.client) + M.client.eye = src M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src M.loc = src //Foreach goto(226) src.icon_state = "secloset0" @@ -1011,8 +1036,8 @@ O.loc = src.loc if (user != O) for(var/mob/B in viewers(user, 3)) - if ((B.client && !( B.blinded ))) - B << text("\red [] stuffs [] into []!", user, O, src) + if (B.hasClient() && !( B.blinded )) + B.client_mob() << text("\red [] stuffs [] into []!", user, O, src) //Foreach goto(99) return @@ -1044,7 +1069,7 @@ var/obj/item/weapon/syndicate_uplink/U = new /obj/item/weapon/syndicate_uplink( src ) U.uses = 5 return - + /obj/closet/syndicate/personal/New() ..() @@ -1275,11 +1300,12 @@ I.loc = src.loc //Foreach goto(29) for(var/mob/M in src) - M.loc = src.loc - if (M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE - //Foreach goto(71) + M.loc = src.loc + var/client/client = M.alwaysClient() + if (client) + if (client.eye == src) + client.eye = client.mob + client.perspective = MOB_PERSPECTIVE src.icon_state = "emcloset1" //SN src = null del(src) @@ -1288,15 +1314,16 @@ /obj/closet/attackby(obj/item/weapon/W as obj, mob/user as mob) if ((src.opened || W.damtype != "fire" || !( istype(W, /obj/item/weapon/weldingtool) ))) - if (istype(W, /obj/item/weapon/grab)) - src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet - else: - user.drop_item() - W.loc = src.loc + if (istype(W, /obj/item/weapon/grab)) + src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet + else + if (user.can_drop()) + user.drop_item() + W.loc = src.loc else src.welded = !( src.welded ) for(var/mob/M in viewers(user, null)) - if (M.client) + if (M.hasClient()) M.show_message(text("\red [] has been [] by [].", src, (src.welded ? "welded shut" : "unwelded"), user), 3, "\red You hear welding.", 2) //Foreach goto(82) return @@ -1311,17 +1338,19 @@ //Foreach goto(36) for(var/mob/M in src) M.loc = src.loc - if (M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE + var/client/client = M.alwaysClient() + if (client) + if (client.eye == src) + client.eye = client.mob + client.perspective = MOB_PERSPECTIVE //Foreach goto(78) src.icon_state = "emcloset1" src.opened = 1 else - user << "\blue It's welded shut!" + user.client_mob() << "\blue It's welded shut!" for(var/mob/M in hearers(src, null)) - M << text("BANG, bang!", max(0, 5 - get_dist(src, M))) - //Foreach goto(170) + var/msg = text("BANG, bang!", max(0, 5 - get_dist(src, M))) + M.client_mob() << msg return /obj/closet/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob) @@ -1342,8 +1371,8 @@ */ step_towards(O, src.loc) for(var/mob/M in viewers(user, null)) - if ((M.client && !( M.blinded ))) - M << text("\red [] stuffs [] into []!", user, O, src) + if (M.hasClient() && !( M.blinded )) + M.client_mob() << text("\red [] stuffs [] into []!", user, O, src) //Foreach goto(104) src.add_fingerprint(user) return @@ -1364,23 +1393,24 @@ for(var/mob/M in src) if (!( M.buckled )) M.loc = src.loc - if (M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE + var/client/client = M.alwaysClient() + if (client) + if (client.eye == src) + client.eye = client.mob + client.perspective = MOB_PERSPECTIVE //Foreach goto(85) src.icon_state = "emcloset1" src.opened = 1 else - usr << "\blue It's welded shut!" + usr.client_mob() << "\blue It's welded shut!" else for(var/obj/item/I in src.loc) if (!( I.anchored )) I.loc = src - //Foreach goto(187) for(var/mob/M in src.loc) - if (M.client) + if (M.client) + M.client.eye = src M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src M.loc = src //Foreach goto(237) src.icon_state = src.original @@ -1517,17 +1547,18 @@ flick("e_chairs", src) flick("e_chairos", src.overl) for(var/mob/M in src.loc) - M.burn(7.5E7) - M << "\red You feel a deep shock course through your body!" - sleep(1) - M.burn(7.5E7) - M.stunned = 600 - //Foreach goto(72) + if (!istype(M, /mob/drone)) + M.burn(7.5E7) + M.client_mob() << "\red You feel a deep shock course through your body!" + sleep(1) + M.burn(7.5E7) + M.stunned = 600 + //Foreach goto(72) for(var/mob/M in hearers(src, null)) if (!( M.blinded )) - M << "\red The electric chair went off!" + M.client_mob() << "\red The electric chair went off!" else - M << "\red You hear a deep sharp shock." + M.client_mob() << "\red You hear a deep sharp shock." //Foreach goto(142) A.power_light = light @@ -1597,19 +1628,23 @@ /obj/stool/chair/MouseDrop_T(mob/M as mob, mob/user as mob) if (!ticker) - user << "You can't buckle anyone in before the game starts." + user.client_mob() << "You can't buckle anyone in before the game starts." return - if ((!( istype(M, /mob) ) || get_dist(src, user) > 1 || M.loc != src.loc || user.restrained() || usr.stat)) + if ((!( istype(M, /mob) ) || get_dist(src, user) > 1 || M.loc != src.loc || user.restrained() || usr.stat) || istype(M, /mob/drone)) return + if (istype(user, /mob/drone)) + if (user.equipped()) + user.client_mob() << "You need to be using the gripper to buckle someone in." + return if (M == usr) for(var/mob/O in viewers(user, null)) - if ((O.client && !( O.blinded ))) - O << text("\blue [] buckles in!", user) + if (O.hasClient() && (!( O.blinded ))) + O.client_mob() << text("\blue [] buckles in!", user) //Foreach goto(83) else for(var/mob/O in viewers(user, null)) - if ((O.client && !( O.blinded ))) - O << text("\blue [] is buckled in by []!", M, user) + if (O.hasClient() && (!( O.blinded ))) + O.client_mob() << text("\blue [] is buckled in by []!", M, user) //Foreach goto(137) M.anchored = 1 M.buckled = src @@ -1625,17 +1660,22 @@ /obj/stool/chair/attack_hand(mob/user as mob) + if (istype(user, /mob/drone)) + if (istype(user, /mob/drone)) + if (user.equipped()) + user.client_mob() << "You need to be using the gripper to buckle someone in." + return for(var/mob/M in src.loc) if (M.buckled) if (M != user) for(var/mob/O in viewers(user, null)) - if ((O.client && !( O.blinded ))) - O << text("\blue [] is unbuckled by [].", M, user) + if (O.hasClient() && (!( O.blinded ))) + O.client_mob() << text("\blue [] is unbuckled by [].", M, user) //Foreach goto(64) else for(var/mob/O in viewers(user, null)) - if ((O.client && !( O.blinded ))) - O << text("\blue [] unbuckles.", M) + if (O.hasClient() && (!( O.blinded ))) + O.client_mob() << text("\blue [] unbuckles.", M) //Foreach goto(123) M.anchored = 0 M.buckled = null @@ -1677,7 +1717,6 @@ if (prob(25)) src.health -= 11 healthcheck() - else return /obj/grille/blob_act() @@ -1711,7 +1750,7 @@ else if ((istype(W, /obj/item/weapon/screwdriver) && (istype(src.loc, /turf/station) || src.anchored))) if(!shock(user, 50)) src.anchored = !( src.anchored ) - user << (src.anchored ? "You have fastened the grille to the floor." : "You have unfastened the grill.") + user.client_mob() << src.anchored ? "You have fastened the grille to the floor." : "You have unfastened the grill." else if(istype(W, /obj/item/weapon/shard)) // can't get a shock by attacking with glass shard src.health -= W.force * 0.1 @@ -1873,17 +1912,17 @@ if (istype(W, /obj/item/weapon/screwdriver)) if(reinf && state >= 1) state = 3 - state - usr << ( state==1? "You have unfastened the window from the frame." : "You have fastened the window to the frame." ) + usr.client_mob() << state==1? "You have unfastened the window from the frame." : "You have fastened the window to the frame." else if(reinf && state == 0) anchored = !anchored - user << (src.anchored ? "You have fastened the frame to the floor." : "You have unfastened the frame from the floor.") + user.client_mob() << src.anchored ? "You have fastened the frame to the floor." : "You have unfastened the frame from the floor." else if(!reinf) src.anchored = !( src.anchored ) - user << (src.anchored ? "You have fastened the window to the floor." : "You have unfastened the window.") + user.client_mob() << src.anchored ? "You have fastened the window to the floor." : "You have unfastened the window." else if(istype(W, /obj/item/weapon/crowbar) && reinf) if(state <=1) state = 1-state; - user << (state ? "You have pried the window into the frame." : "You have pried the window out of the frame.") + user.client_mob() << state ? "You have pried the window into the frame." : "You have pried the window out of the frame." else var/aforce = W.force if(reinf) aforce /= 2.0 @@ -1920,11 +1959,11 @@ set src in oview(1) if (src.anchored) - usr << "It is fastened to the floor; therefore, you can't rotate it!" + usr.client_mob() << "It is fastened to the floor; therefore, you can't rotate it!" return 0 else if (src.dir == SOUTHWEST) - usr << "You can't rotate this! " + usr.client_mob() << "You can't rotate this! " return 0 src.dir = turn(src.dir, 90) src.ini_dir = src.dir @@ -2211,19 +2250,21 @@ /turf/station/r_wall/attackby(obj/item/weapon/W as obj, mob/user as mob) - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" - return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return if (src.state == 2) if (istype(W, /obj/item/weapon/wrench)) if (src.d_state == 4) var/turf/T = user.loc - user << "\blue Cutting support rods." + user.client_mob() << "\blue Cutting support rods." sleep(40) if (!( istype(src, /turf/station/r_wall) )) return if ((user.loc == T && user.equipped() == W && !( user.stat ))) src.d_state = 5 + user.client_mob() << "\green Support rods cut." else if (istype(W, /obj/item/weapon/wirecutters)) if (src.d_state == 0) @@ -2233,16 +2274,17 @@ if (istype(W, /obj/item/weapon/weldingtool)) if (src.d_state == 2) var/turf/T = user.loc - user << "\blue Slicing metal cover." + user.client_mob() << "\blue Slicing metal cover." sleep(60) if (!( istype(src, /turf/station/r_wall) )) return if ((user.loc == T && user.equipped() == W && !( user.stat ))) src.d_state = 3 + user.client_mob() << "\green Metal cover sliced." else if (src.d_state == 5) var/turf/T = user.loc - user << "\blue Removing support rods." + user.client_mob() << "\blue Removing support rods." sleep(100) if (!( istype(src, /turf/station/r_wall) )) return @@ -2250,40 +2292,44 @@ if ((user.loc == T && user.equipped() == W && !( user.stat ))) src.d_state = 6 new /obj/item/weapon/rods( src ) + user.client_mob() << "\green Support rods removed." else if (istype(W, /obj/item/weapon/screwdriver)) if (src.d_state == 1) var/turf/T = user.loc - user << "\blue Removing support lines." + user.client_mob() << "\blue Removing support lines." sleep(40) if (!( istype(src, /turf/station/r_wall) )) return if ((user.loc == T && user.equipped() == W && !( user.stat ))) src.d_state = 2 + user.client_mob() << "\green Support lines removed." else if (istype(W, /obj/item/weapon/crowbar)) if (src.d_state == 3) var/turf/T = user.loc - user << "\blue Prying cover off." + user.client_mob() << "\blue Prying cover off." sleep(100) if (!( istype(src, /turf/station/r_wall) )) return if ((user.loc == T && user.equipped() == W && !( user.stat ))) src.d_state = 4 + user.client_mob() << "\green Cover pried off." else if (src.d_state == 6) var/turf/T = user.loc - user << "\blue Prying outer sheath off." + user.client_mob() << "\blue Prying outer sheath off." sleep(100) if (!( istype(src, /turf/station/r_wall) )) return if ((user.loc == T && user.equipped() == W && !( user.stat ))) src.d_state = 7 new /obj/item/weapon/sheet/metal( src ) + user.client_mob() << "\green Outer sheath pried off." else if (istype(W, /obj/item/weapon/sheet/metal)) var/turf/T = user.loc - user << "\blue Repairing wall." + user.client_mob() << "\blue Repairing wall." sleep(100) if (!( istype(src, /turf/station/r_wall) )) return @@ -2296,7 +2342,7 @@ del(W) if (src.state == 1) if (istype(W, /obj/item/weapon/wrench)) - user << "\blue Now dismantling girders." + user.client_mob() << "\blue Now dismantling girders." var/turf/T = user.loc sleep(100) if (!( istype(src, /turf/station/r_wall) )) @@ -2330,7 +2376,7 @@ /turf/station/wall/examine() set src in oview(1) - usr << "It looks like a regular wall." + usr.client_mob() << "It looks like a regular wall." return /turf/station/wall/updatecell() @@ -2430,20 +2476,21 @@ /turf/station/wall/attack_hand(mob/user as mob) - user << "\blue You push the wall but nothing happens!" + user.client_mob() << "\blue You push the wall but nothing happens!" src.add_fingerprint(user) return /turf/station/wall/attackby(obj/item/weapon/W as obj, mob/user as mob) - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" - return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return if ((istype(W, /obj/item/weapon/wrench) && src.state == 1)) var/turf/T = user.loc if (!( istype(T, /turf) )) return - user << "\blue Now dissembling the reinforced girders. Please stand still. This is a long process." + user.client_mob() << "\blue Now dissembling the reinforced girders. Please stand still. This is a long process." sleep(100) if (!( istype(src, /turf/station/wall) )) return @@ -2461,7 +2508,7 @@ var/turf/T = user.loc if (!( istype(T, /turf) )) return - user << "\blue Now dislodging girders." + user.client_mob() << "\blue Now dislodging girders." sleep(100) if (!( istype(src, /turf/station/wall) )) return @@ -2479,7 +2526,7 @@ var/turf/T = user.loc if (!( istype(T, /turf) )) return - user << "\blue Now reinforcing girders." + user.client_mob() << "\blue Now reinforcing girders." sleep(100) if (!( istype(src, /turf/station/wall) )) return @@ -2501,10 +2548,10 @@ var/obj/item/weapon/weldingtool/WT = W if(WT.welding) if (WT.weldfuel < 5) - user << "\blue You need more welding fuel to complete this task." + user.client_mob() << "\blue You need more welding fuel to complete this task." return WT.weldfuel -= 5 - user << "\blue Now dissembling the outer wall plating. Please stand still." + user.client_mob() << "\blue Now dissembling the outer wall plating. Please stand still." sleep(50) if ((user.loc == T && src.state == 2 && user.equipped() == W)) src.opacity = 0 @@ -2626,7 +2673,7 @@ levelupdate() src.health = 150 src.burnt = 0 - if (src.firelevel >= 900000.0) + if (src.firelevel >= config.min_gas_for_fire) src.icon_state = "burning" src.luminosity = 2 else diff --git a/Code/dna.dm b/Code/dna.dm index 2d6a8ca..c4891f9 100644 --- a/Code/dna.dm +++ b/Code/dna.dm @@ -28,19 +28,19 @@ var/dat = text("Please Insert the cards into the slots
\n\t\t\t\tFunction Disk: []
\n\t\t\t\tTarget Disk: []
\n\t\t\t\tAux. Data Disk: []
\n\t\t\t\t\t(Not always used!)
\n\t\t\t\t[]", src, (src.scan ? text("[]", src.scan.name) : "----------"), src, (src.modify ? text("[]", src.modify.name) : "----------"), src, (src.modify2 ? text("[]", src.modify2.name) : "----------"), (src.scan ? text("Execute Function", src) : "No function disk inserted!")) if (src.temp) dat = text("[]

Clear Message", src.temp, src) - user << browse(dat, "window=dna_comp") + user.client_mob() << browse(dat, "window=dna_comp") else var/dat = text("[]
\n\t\t\t\t[] []
\n\t\t\t\t[] []
\n\t\t\t\t[] []
\n\t\t\t\t\t(Not always used!)
\n\t\t\t\t[]", stars("Please Insert the cards into the slots"), stars("Function Disk:"), src, (src.scan ? text("[]", src.scan.name) : "----------"), stars("Target Disk:"), src, (src.modify ? text("[]", src.modify.name) : "----------"), stars("Aux. Data Disk:"), src, (src.modify2 ? text("[]", src.modify2.name) : "----------"), (src.scan ? text("[]", src, stars("Execute Function")) : stars("No function disk inserted!"))) if (src.temp) dat = text("[]

[]", stars(src.temp), src, stars("Clear Message")) - user << browse(dat, "window=dna_comp") + user.client_mob() << browse(dat, "window=dna_comp") return /obj/machinery/computer/dna/Topic(href, href_list) ..() if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" + if (!istype(usr, /mob/ai) && !istype(usr, /mob/drone)) + usr.client_mob() << "\red You don't have the dexterity to do this!" return if ((usr.stat || usr.restrained())) return @@ -250,14 +250,15 @@ if (usr.stat != 0) return if (src.occupant) - usr << "\blue The scanner is already occupied!" + usr.client_mob() << "\blue The scanner is already occupied!" return if (usr.abiotic()) - usr << "\blue Subject cannot have abiotic items on." + usr.client_mob() << "\blue Subject cannot have abiotic items on." return usr.pulling = null - usr.client.perspective = EYE_PERSPECTIVE - usr.client.eye = src + if (usr.client) + usr.client.perspective = EYE_PERSPECTIVE + usr.client.eye = src usr.loc = src src.occupant = usr src.icon_state = "scanner_1" @@ -268,15 +269,15 @@ src.add_fingerprint(usr) return -/obj/machinery/dna_scanner/attackby(obj/item/weapon/grab/G as obj, user as mob) +/obj/machinery/dna_scanner/attackby(obj/item/weapon/grab/G as obj, mob/user as mob) if ((!( istype(G, /obj/item/weapon/grab) ) || !( ismob(G.affecting) ))) return if (src.occupant) - user << "\blue The scanner is already occupied!" + user.client_mob() << "\blue The scanner is already occupied!" return if (G.affecting.abiotic()) - user << "\blue Subject cannot have abiotic items on." + user.client_mob() << "\blue Subject cannot have abiotic items on." return var/mob/M = G.affecting if (M.client) @@ -621,7 +622,7 @@ /obj/machinery/scan_console/attack_ai(user as mob) return src.attack_hand(user) -/obj/machinery/scan_console/attack_hand(user as mob) +/obj/machinery/scan_console/attack_hand(mob/user as mob) if(stat & (NOPOWER|BROKEN) ) return @@ -654,14 +655,14 @@ (src.scan ? text("Upload Data", src) : "No disk to upload"), ((src.data || src.func || src.special) ? text("Clear Data
Execute Data
Function Type: [][]
Data: []", src, src, src.func, (src.special ? text("-[]", src.special) : null), src.data) : "No data uploaded")) dat += text("

Close", user) - user << browse(dat, "window=scanner;size=400x500") + user.client_mob() << browse(dat, "window=scanner;size=400x500") return /obj/machinery/scan_console/Topic(href, href_list) ..() if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - if (!istype(usr, /mob/ai)) - usr << "\red You don't have the dexterity to do this!" + if (!istype(usr, /mob/ai) && !istype(usr, /mob/drone)) + usr.client_mob() << "\red You don't have the dexterity to do this!" return if ((usr.stat || usr.restrained())) return @@ -749,7 +750,10 @@ M << "Genetic Transversal Complete!" if (M.client) M << "Transferring..." - M.client.mob = O + M.client.mob = O + if (M.currentDrone!=null) + O.currentDrone = M.currentDrone + O.currentDrone:controlledBy = O O << "Neural Sequencing Complete!" O.loc = src src.occupant = O @@ -771,7 +775,10 @@ M << "Genetic Transversal Complete!" if (M.client) M << "Transferring..." - M.client.mob = O + M.client.mob = O + if (M.currentDrone!=null) + O.currentDrone = M.currentDrone + O.currentDrone:controlledBy = O O << "Neural Sequencing Complete!" O.loc = src O << "Genetic Transversal Complete!" @@ -881,14 +888,15 @@ if (usr.stat != 0) return if (src.occupant) - usr << "\blue The scanner is already occupied!" + usr.client_mob() << "\blue The scanner is already occupied!" return if (usr.abiotic()) - usr << "\blue Subject cannot have abiotic items on." + usr.client_mob() << "\blue Subject cannot have abiotic items on." return usr.pulling = null - usr.client.perspective = EYE_PERSPECTIVE - usr.client.eye = src + if (usr.client) + usr.client.perspective = EYE_PERSPECTIVE + usr.client.eye = src usr.loc = src src.occupant = usr src.icon_state = "restruct_1" @@ -906,15 +914,15 @@ src.go_out() return -/obj/machinery/restruct/attackby(obj/item/weapon/grab/G as obj, user as mob) +/obj/machinery/restruct/attackby(obj/item/weapon/grab/G as obj, mob/user as mob) if ((!( istype(G, /obj/item/weapon/grab) ) || !( ismob(G.affecting) ))) return if (src.occupant) - user << "\blue The machine is already occupied!" + user.client_mob() << "\blue The machine is already occupied!" return if (G.affecting.abiotic()) - user << "\blue Subject cannot have abiotic items on." + user.client_mob() << "\blue Subject cannot have abiotic items on." return var/mob/M = G.affecting if (M.client) diff --git a/Code/globals.dm b/Code/globals.dm index 3377122..596a06b 100644 --- a/Code/globals.dm +++ b/Code/globals.dm @@ -123,7 +123,7 @@ var
  • Fixed exceptions from clicking things which dropped the active held item while you had someone grabbed in your active hand. If you try to click a closet with someone grabbed, you stuff them in it now. If you try to click a table or rack, you don't do anything. Previously all of these caused you to lose the grip and caused an exception (because when it told the grip to be dropped, it deleted itself, and then it tried to move null).
  • Many many things which could take someone from being 'dead' to being 'unconscious' have been fixed. These were all cases where stat was being set to 1 without being checked to see if it was 2. Mind you, it wasn't terribly easy to actually resurrect someone with this, since they always immediately died again due to all the damage they had taken, but it did cause them to get (Dead) (Dead) (Dead) (Dead) spammed at the end of their corpse's name if they were thwacked repeatedly. Also, related stuff that would say they were stunned, weakened, etc, should also not happen (unless I missed some).
  • Syndicate mini-station is more rectangular-ish, and the forcefield around it is more circle-ish. The forcefield is also thicker and completely encases the mini-station, making it harder to teleport inside. -
  • Un-nerfed meteor chance in non-meteor modes a bit from 0.5 to 1 (originally 2.0 before it was nerfed to 0.5). +
  • Un-nerfed meteor chance in non-meteor modes a bit ... well, it was really at 0%, so this is technically still an un-nerfing. Now it's at 0.1% chance each second.
  • Added an alternate_ai_laws config variable, which gives the AI some more reasonable laws. It also has some more law adjustments when it's the traitor.
  • Merged in a number of changes from the goons' svn (but not all of them - I didn't take all of them, and I probably missed a bunch because I didn't try to compare any of the code which was moved in the openss13 code reorganizations). Changes that I merged in include:
    • Anesthetic tanks have 700000 N2O and 1000000 oxygen in them now, instead of 1000 N2O and no oxygen @@ -154,6 +154,18 @@ var
    • Fixed a bug which was causing the air tank dialog to not update when you switched gas flow off (so it still said 'stop gas flow' instead of 'restore gas flow').
    • You shouldn't be able to knock out, stun, paralyze, etc, the AI anymore.
    • Timer/igniters now actually ignite when the timer finishes. +
    • Added air_pressure_flow to config.txt, which, if enabled (it's disabled by default), makes a few changes to air stuff: Air pressure and temperature will affect how strongly things are pushed/pulled between tiles, and air and fire processing will occur on tiles which are adjacent to space. This is disabled by default because it would be slightly slower and the only really notable thing it does is letting tiles next to space burn. +
    • Added admin panel secret for making air ignite itself if it reaches a sufficient amount of oxygen (initially for testing purposes). +
    • Added a config var for the amount of gas needed for a fire in a tile to keep going, or for it to spread to another tile, with the config.txt variable named min_gas_for_fire. (If you're bored, change it from 900000 to 9000, start a game, and light an igniter to set the station on fire. Eventually it'll consume all the oxygen *without destroying the floors* because the temperature won't get hot enough (in most places) to harm them. Or use the air-ignites-self secret :P) +
    • Added a METEORCHANCE config.txt variable and fixed the meteor chance stuff. Previous attempts to put the chance below 1% per second were resulting in no meteors at all, due to BYOND's prob function not liking numbers like 0.5. (The config file's chance doesn't affect meteor mode or sandbox mode, which always have 100% and 0% respectively) +
    • The AI can no longer be: fed pills, handcuffed, injected with a syringe, shaken to wake up, have CPR applied, be knocked out or stunned by being struck by an air tank, eyedropped, treated with ointment, treated with a bruise pack, health-analyzed, sleepypenned, affected by flashes or flashbangs, or aggressively grabbed or strangled. Additionally, punching the AI will harm your active hand instead of harming the AI. You can still shoot it or whack it with actual objects. +
    • The AI has a HUD icon for power or loss thereof, a fire icon, and a damage icon. (There isn't a hud background under them, so they just float over a few tiles on the right side of the map) +
    • Fixed a bug: If you had flipped the main breaker off on the AI's APC, it was unable to find the APC to hack it. Now it can. +
    • The privs required to see links on the admin panel should match up now with the privs required to use those links. Previously it was possible - even likely for lower priv levels - that you could try to do something and the admin panel would simply ignore you (Of course, if I made a mistake and it's still broken, it will still ignore you. Er... I guess we don't want to give anyone trying to trick the system any hints or something like that). +
    • Deactivating cameras *should* cause anyone looking through it to get notified of the deactivation, and to then get kicked out of the camera. (This needs to be tested) +
    • Maintenance drones for the AI or station personnel to control (optional, see config.txt). It has the standard tools (wirecutters, crowbar, screwdriver, welder), and a gripper which is kind of like a robo-hand, for manipulating things, or picking up and carrying or using one other item, and drone control stations (for humans). There are three drones on SS13, one in a closet east of the EVA room, one in a closet attached to engine storage, and one in atmospherics in the room with all the gas tanks. There are currently two drone control stations, one in the engine room and one in southwest atmospherics (Security doesn't have one because (a) they're ridiculously easy to break into, and (b) these are maintenance drones). +
    • Electrician's toolboxes now have a pair of insulated gloves in them (replacing one of the coils of wires). +
    • You should no longer be able to open the take-off/put-on dialog on AIs (or drones).

    Version 40.93.2H9.6 @@ -410,7 +422,9 @@ var list/airlockIndexToWireColor list/airlockWireColorToIndex list/airlockFeatureNames = list("IdScan", "Main power In", "Main power Out", "Drop door bolts", "Backup power In", "Backup power Out", "Power assist", "AI Control", "Electrify") - + + numDronesInExistance = 0 + world mob = /mob/human turf = /turf/space diff --git a/Code/h_sandbox.dm b/Code/h_sandbox.dm index 6ed6d12..57834a8 100644 --- a/Code/h_sandbox.dm +++ b/Code/h_sandbox.dm @@ -44,7 +44,7 @@ datum/hSB hsbpanel += "- [hrefs[T]]
    " if(hsboxspawn) hsbpanel += "- Spawn Object

    " - usr << browse(hsbpanel, "window=hsbpanel") + usr.client_mob() << browse(hsbpanel, "window=hsbpanel") Topic(href, href_list) if(!(src.owner == usr.ckey)) return if(href_list["hsb"]) @@ -105,7 +105,7 @@ datum/hSB hsb.loc = usr.loc hsb.loc.buildlinks() - usr << "Sandbox: Created an airlock requiring at least [r_access]>[r_lab]-[r_engine]-[r_air] access." + usr.client_mob() << "Sandbox: Created an airlock requiring at least [r_access]>[r_lab]-[r_engine]-[r_air] access." if("hsbregulator") var/obj/machinery/atmoalter/siphs/fullairsiphon/hsb = new/obj/machinery/atmoalter/siphs/fullairsiphon/air_vent hsb.loc = usr.loc diff --git a/Code/items.dm b/Code/items.dm index 48745f6..1408268 100644 --- a/Code/items.dm +++ b/Code/items.dm @@ -110,13 +110,17 @@ if (istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/T = W if ((T.welding && T.weldfuel > 0)) - viewers(user, null) << text("[] burns the paper with the welding tool!", user) + var/list/observers = viewers(user, null) + for (var/mob/who in observers) + who.client_mob() << text("[] burns the paper with the welding tool!", user) spawn( 0 ) src.burn(1800000.0) return else if (istype(W, /obj/item/weapon/igniter)) - viewers(user, null) << text("[] burns the paper with the igniter!", user) + var/list/observers = viewers(user, null) + for (var/mob/who in observers) + who.client_mob() << text("[] burns the paper with the igniter!", user) spawn( 0 ) src.burn(1800000.0) return @@ -129,7 +133,7 @@ for(var/atom/movable/A in src) A.burn(fi_amount) //Foreach goto(23) - if (fi_amount >= 900000.0) + if (fi_amount >= config.min_gas_for_fire) src.amount = 0 src.update() return @@ -195,12 +199,12 @@ //Foreach goto(33) if (n <= 0) n = 0 - usr << "There are no papers in the bin." + usr.client_mob() << "There are no papers in the bin." else if (n == 1) - usr << "There is one paper in the bin." + usr.client_mob() << "There is one paper in the bin." else - usr << text("There are [] papers in the bin.", n) + usr.client_mob() << text("There are [] papers in the bin.", n) return /obj/item/weapon/dummy/ex_act() @@ -315,7 +319,7 @@ user.machine = src if (!( src.data )) update() - user << browse(src.data, "window=game_kit") + user.client_mob() << browse(src.data, "window=game_kit") return return @@ -389,10 +393,7 @@ src.board_stat = text("[][][]", copytext(src.board_stat, 1, place), src.selected, copytext(src.board_stat, place + 2, 129)) src.add_fingerprint(usr) update() - for(var/mob/M in viewers(1, src)) - if ((M.client && M.machine == src)) - src.attack_hand(M) - //Foreach goto(835) + updateDialog() return /obj/item/weapon/ex_act(severity) @@ -585,40 +586,42 @@ set src in oview(1) ..() - usr << text("There is about [] square units of paper left!", src.amount) + usr.client_mob() << text("There is about [] square units of paper left!", src.amount) return /obj/item/weapon/wrapping_paper/attackby(obj/item/weapon/W, mob/user) if (!( locate(/obj/table, src.loc) )) - user << "\blue You MUST put the paper on a table!" + user.client_mob() << "\blue You MUST put the paper on a table!" if (W.w_class < 4) if ((istype(user.l_hand, /obj/item/weapon/wirecutters) || istype(user.r_hand, /obj/item/weapon/wirecutters))) var/a_used = 2 ** (src.w_class - 1) if (src.amount < a_used) - user << "\blue You need more paper!" + user.client_mob() << "\blue You need more paper!" return else - src.amount -= a_used - user.drop_item() - var/obj/item/weapon/gift/G = new /obj/item/weapon/gift( src.loc ) - G.size = W.w_class - G.w_class = G.size + 1 - G.icon_state = text("gift[]", G.size) - G.gift = W - W.loc = G - G.add_fingerprint(user) - W.add_fingerprint(user) - src.add_fingerprint(user) + if (user.can_drop()) + src.amount -= a_used + user.drop_item() + + var/obj/item/weapon/gift/G = new /obj/item/weapon/gift( src.loc ) + G.size = W.w_class + G.w_class = G.size + 1 + G.icon_state = text("gift[]", G.size) + G.gift = W + W.loc = G + G.add_fingerprint(user) + W.add_fingerprint(user) + src.add_fingerprint(user) if (src.amount <= 0) new /obj/item/weapon/c_tube( src.loc ) //SN src = null del(src) return else - user << "\blue You need scissors!" + user.client_mob() << "\blue You need scissors!" else - user << "\blue The object is FAR too large!" + user.client_mob() << "\blue The object is FAR too large!" return /obj/item/weapon/gift/attack_self(mob/user) @@ -644,7 +647,7 @@ /obj/item/weapon/a_gift/burn(fi_amount) - if (fi_amount > 900000.0) + if (fi_amount > config.min_gas_for_fire) //SN src = null del(src) return @@ -740,7 +743,7 @@ if (user.equipped() == src) if (!( src.state )) - user << "\red You prime the flashbang! [det_time/10] seconds!" + user.client_mob() << "\red You prime the flashbang! [det_time/10] seconds!" src.state = 1 src.icon_state = "flashbang1" spawn( src.det_time ) @@ -770,80 +773,81 @@ var/turf/T = get_turf(src) T.firelevel = T.poison for(var/mob/M in viewers(T, null)) - if (locate(/obj/item/weapon/cloaking_device, M)) - for(var/obj/item/weapon/cloaking_device/S in M) - S.active = 0 - S.icon_state = "shield0" - //Foreach goto(72) - if ((get_dist(M, T) <= 2 || src.loc == M.loc || src.loc == M)) - flick("e_flash", M.flash) - M.stunned = 10 - M.weakened = 3 - M << "\red BANG" - if ((prob(14) || (M == src.loc && prob(70)))) - M.ear_damage += rand(10, 20) - else - if (prob(30)) - M.ear_damage += rand(7, 14) - if (!( M.paralysis )) - M.eye_stat += rand(10, 15) - if (prob(10)) - M.eye_stat += 7 - M.ear_deaf += 30 - if (M == src.loc) - M.eye_stat += 10 - if (prob(60)) - if (istype(M, /mob/human)) - var/mob/human/H = M - if (!( istype(H.ears, /obj/item/weapon/clothing/ears/earmuffs) )) + if (istype(M, /mob/human) || istype(M, /mob/monkey)) + if (locate(/obj/item/weapon/cloaking_device, M)) + for(var/obj/item/weapon/cloaking_device/S in M) + S.active = 0 + S.icon_state = "shield0" + //Foreach goto(72) + if ((get_dist(M, T) <= 2 || src.loc == M.loc || src.loc == M)) + flick("e_flash", M.flash) + M.stunned = 10 + M.weakened = 3 + M.client_mob() << "\red BANG" + if ((prob(14) || (M == src.loc && prob(70)))) + M.ear_damage += rand(10, 20) + else + if (prob(30)) + M.ear_damage += rand(7, 14) + if (!( M.paralysis )) + M.eye_stat += rand(10, 15) + if (prob(10)) + M.eye_stat += 7 + M.ear_deaf += 30 + if (M == src.loc) + M.eye_stat += 10 + if (prob(60)) + if (istype(M, /mob/human)) + var/mob/human/H = M + if (!( istype(H.ears, /obj/item/weapon/clothing/ears/earmuffs) )) + M.ear_damage += 15 + M.ear_deaf += 60 + else M.ear_damage += 15 M.ear_deaf += 60 - else - M.ear_damage += 15 - M.ear_deaf += 60 - else - if (get_dist(M, T) <= 5) - flick("e_flash", M.flash) - if (!( istype(M, /mob/human) )) - M.stunned = 7 - M.weakened = 2 - else - var/mob/human/H = M - M.ear_deaf += 10 - if (prob(20)) - M.ear_damage += 10 - if ((!( istype(H.glasses, /obj/item/weapon/clothing/glasses/sunglasses) ) || M.paralysis)) + else + if (get_dist(M, T) <= 5) + flick("e_flash", M.flash) + if (!( istype(M, /mob/human) )) M.stunned = 7 M.weakened = 2 else - if (!( M.paralysis )) - M.eye_stat += rand(1, 3) - M << "\red BANG" - else - if (!( istype(M, /mob/human) )) - flick("flash", M.flash) + var/mob/human/H = M + M.ear_deaf += 10 + if (prob(20)) + M.ear_damage += 10 + if ((!( istype(H.glasses, /obj/item/weapon/clothing/glasses/sunglasses) ) || M.paralysis)) + M.stunned = 7 + M.weakened = 2 + else + if (!( M.paralysis )) + M.eye_stat += rand(1, 3) + M.client_mob() << "\red BANG" else - var/mob/human/H = M - if (!( istype(H.glasses, /obj/item/weapon/clothing/glasses/sunglasses) )) + if (!( istype(M, /mob/human) )) flick("flash", M.flash) - M.eye_stat += rand(1, 2) - M.ear_deaf += 5 - M << "\red BANG" - if (M.eye_stat >= 20) - M << "\red Your eyes start to burn badly!" - M.disabilities |= 1 - if (prob(M.eye_stat - 20 + 1)) - M << "\red You go blind!" - M.sdisabilities |= 1 - if (M.ear_damage >= 15) - M << "\red Your ears start to ring badly!" - if (prob(M.ear_damage - 10 + 5)) - M << "\red You go deaf!" - M.sdisabilities |= 4 - else - if (M.ear_damage >= 5) - M << "\red Your ears start to ring!" - //Foreach goto(39) + else + var/mob/human/H = M + if (!( istype(H.glasses, /obj/item/weapon/clothing/glasses/sunglasses) )) + flick("flash", M.flash) + M.eye_stat += rand(1, 2) + M.ear_deaf += 5 + M << "\red BANG" + if (M.eye_stat >= 20) + M << "\red Your eyes start to burn badly!" + M.disabilities |= 1 + if (prob(M.eye_stat - 20 + 1)) + M << "\red You go blind!" + M.sdisabilities |= 1 + if (M.ear_damage >= 15) + M << "\red Your ears start to ring badly!" + if (prob(M.ear_damage - 10 + 5)) + M << "\red You go deaf!" + M.sdisabilities |= 4 + else + if (M.ear_damage >= 5) + M << "\red Your ears start to ring!" + //SN src = null for(var/obj/blob/B in view(8,T)) @@ -859,7 +863,7 @@ /obj/item/weapon/flashbang/attack_self(mob/user) if (!( src.state )) - user << "\red You prime the flashbang! [det_time/10] seconds!" + user.client_mob() << "\red You prime the flashbang! [det_time/10] seconds!" src.state = 1 src.icon_state = "flashbang1" add_fingerprint(user) @@ -869,22 +873,25 @@ return /obj/item/weapon/flash/attack(mob/M, mob/user) - if (src.shots > 0) var/safety = null if (istype(M, /mob/human)) var/mob/human/H = M if (istype(H.glasses, /obj/item/weapon/clothing/glasses/sunglasses)) safety = 1 + else if (!istype(M, /mob/monkey)) + safety = 1 + if (!( safety )) M.weakened = 10 - if (M.client) + if (M.hasClient()) + var/mob/CM = M.client_mob() if (!( safety )) if ((M.eye_stat > 15 && prob(M.eye_stat + 50))) - flick("e_flash", M.flash) + flick("e_flash", CM.flash) M.eye_stat += rand(1, 2) else - flick("flash", M.flash) + flick("flash", CM.flash) M.eye_stat += rand(0, 2) if (M.eye_stat >= 20) M << "\red You eyes start to burn badly!" @@ -905,30 +912,32 @@ if (src.shots < 1) user.show_message("\red *click* *click*", 2) return - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" - return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return src.l_time = world.time add_fingerprint(user) src.shots-- flick("flash2", src) if (!( flag )) for(var/mob/M in oviewers(3, null)) - if (prob(50)) - if (locate(/obj/item/weapon/cloaking_device, M)) - for(var/obj/item/weapon/cloaking_device/S in M) - S.active = 0 - S.icon_state = "shield0" - //Foreach goto(201) - if (M.client) - var/safety = null - if (istype(M, /mob/human)) - var/mob/human/H = M - if (istype(H.glasses, /obj/item/weapon/clothing/glasses/sunglasses)) - safety = 1 - if (!( safety )) - flick("flash", M.flash) - //Foreach goto(160) + if (istype(M, /mob/human) || istype(M, /mob/monkey)) + if (prob(50)) + if (locate(/obj/item/weapon/cloaking_device, M)) + for(var/obj/item/weapon/cloaking_device/S in M) + S.active = 0 + S.icon_state = "shield0" + //Foreach goto(201) + if (M.hasClient()) + var/mob/CM = M.client_mob() + var/safety = null + if (istype(M, /mob/human)) + var/mob/human/H = M + if (istype(H.glasses, /obj/item/weapon/clothing/glasses/sunglasses)) + safety = 1 + if (!( safety )) + flick("flash", CM.flash) return /obj/item/weapon/locator/attack_self(mob/user) @@ -939,7 +948,7 @@ dat = text("[]

    Clear", src.temp, src) else dat = text("Persistent Signal Locator


    \nFrequency: -- [] ++
    \nRefresh", src, src, src.freq, src, src, src) - user << browse(dat, "window=radio") + user.client_mob() << browse(dat, "window=radio") return /obj/item/weapon/locator/Topic(href, href_list) @@ -1011,7 +1020,7 @@ attack_self(src.loc) else for(var/mob/M in viewers(1, src)) - if (M.client) + if (M.hasClient()) src.attack_self(M) //Foreach goto(749) return @@ -1051,7 +1060,7 @@ dat = text("[]

    Clear", src.temp, src) else dat = text("Syndicate Uplink Console:
    \nTele-Crystals left: []
    \nRequest item: (uses 1 tele-crystal)
    \nElectromagnet Card
    \nSleepy Pen
    \nCyanide Pill
    \nCloaking Device
    \nRevolver
    \nImplant- Freedom (with injector)
    \n
    \nSelf-Destruct", src.uses, src, src, src, src, src, src, src) - user << browse(dat, "window=radio") + user.client_mob() << browse(dat, "window=radio") return /obj/item/weapon/syndicate_uplink/Topic(href, href_list) @@ -1109,7 +1118,7 @@ attack_self(src.loc) else for(var/mob/M in viewers(1, src)) - if (M.client) + if (M.hasClient()) src.attack_self(M) //Foreach goto(488) return @@ -1125,12 +1134,12 @@ src.active = !( src.active ) if (src.active) - user << "\blue The sword is now active." + user.client_mob() << "\blue The sword is now active." src.force = 40 src.icon_state = "sword1" src.w_class = 4 else - user << "\blue The sword can now be concealed." + user.client_mob() << "\blue The sword can now be concealed." src.force = 3 src.icon_state = "sword0" src.w_class = 2 @@ -1141,11 +1150,11 @@ src.active = !( src.active ) if (src.active) - user << "\blue The shield is now active." + user.client_mob() << "\blue The shield is now active." src.force = 40 src.icon_state = "shield1" else - user << "\blue The shield is now inactive." + user.client_mob() << "\blue The shield is now inactive." src.force = 3 src.icon_state = "shield0" src.add_fingerprint(user) @@ -1155,11 +1164,11 @@ src.active = !( src.active ) if (src.active) - user << "\blue The cloaking device is now active." + user.client_mob() << "\blue The cloaking device is now active." src.force = 40 src.icon_state = "shield1" else - user << "\blue The cloaking device is now inactive." + user.client_mob() << "\blue The cloaking device is now inactive." src.force = 3 src.icon_state = "shield0" src.add_fingerprint(user) @@ -1186,17 +1195,17 @@ if (istype(A, /obj/item/weapon/ammo/a357)) if (src.bullets >= 7) - user << "\blue It's already fully loaded!" + user.client_mob() << "\blue It's already fully loaded!" return 1 if (A.amount_left <= 0) - user << "\red There is no more bullets!" + user.client_mob() << "\red There is no more bullets!" return 1 if (A.amount_left < (7 - src.bullets)) src.bullets += A.amount_left - user << text("\red You reload [] bullet\s!", A.amount_left) + user.client_mob() << text("\red You reload [] bullet\s!", A.amount_left) A.amount_left = 0 else - user << text("\red You reload [] bullet\s!", 7 - src.bullets) + user.client_mob() << text("\red You reload [] bullet\s!", 7 - src.bullets) A.amount_left -= 7 - src.bullets src.bullets = 7 A.update_icon() @@ -1207,9 +1216,10 @@ if (flag) return - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" - return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return src.add_fingerprint(user) if (src.bullets < 1) user.show_message("\red *click* *click*", 2) @@ -1246,27 +1256,27 @@ /obj/item/weapon/gun/revolver/attack(mob/M, mob/user) src.add_fingerprint(user) - if (istype(M, /mob/ai)) - if ((user.a_intent == "hurt" && src.bullets > 0)) - src.bullets-- - src.force = 75 - ..() - src.force = 60 - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] has been shot point-blank by []!", M, user), 1, "\red You have been shot point-blank by []!", 2) - else - src.force = 30 - ..() - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] has been pistol whipped by []!", M, user), 1, "\red You have been pistol whipped by []!", 2) - - else + if (istype(M, /mob/ai)) + if ((user.a_intent == "hurt" && src.bullets > 0)) + src.bullets-- + src.force = 75 + ..() + src.force = 60 + for(var/mob/O in viewers(M, null)) + O.show_message(text("\red [] has been shot point-blank by []!", M, user), 1, "\red You have been shot point-blank by []!", 2) + else + src.force = 30 + ..() + for(var/mob/O in viewers(M, null)) + O.show_message(text("\red [] has been pistol whipped by []!", M, user), 1, "\red You have been pistol whipped by []!", 2) + + else var/mob/human/H = M - + // ******* Check if ((istype(H, /mob/human) && istype(H, /obj/item/weapon/clothing/head) && H.flags & 8 && prob(80))) - M << "\red The helmet protects you from being hit hard in the head!" + M.client_mob() << "\red The helmet protects you from being hit hard in the head!" return if ((user.a_intent == "hurt" && src.bullets > 0)) if (prob(20)) @@ -1278,12 +1288,12 @@ src.bullets-- src.force = 75 ..() - src.force = 60 - if (M.stat<2) + src.force = 60 + if (M.stat<2) M.stat = 1 for(var/mob/O in viewers(M, null)) O.show_message(text("\red [] has been shot point-blank by []!", M, user), 1, "\red You hear someone fall", 2) - + else if (prob(50)) if (M.paralysis < 60) @@ -1293,12 +1303,12 @@ M.weakened = 60 src.force = 30 ..() - if (M.stat<2) + if (M.stat<2) M.stat = 1 for(var/mob/O in viewers(M, null)) - if ((O.client && !( O.blinded ))) + if ((O.hasClient() && !( O.blinded ))) O.show_message(text("\red [] has been pistol whipped by []!", M, user), 1, "\red You hear someone fall", 2) - + return /obj/item/weapon/gun/energy/proc/update_icon() @@ -1312,9 +1322,10 @@ if (flag) return - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" - return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return src.add_fingerprint(user) if (src.charges < 1) user.show_message("\red *click* *click*", 2) @@ -1355,7 +1366,7 @@ // ******* Check if ((istype(H, /mob/human) && istype(H, /obj/item/weapon/clothing/head) && H.flags & 8 && prob(80))) - M << "\red The helmet protects you from being hit hard in the head!" + M.client_mob() << "\red The helmet protects you from being hit hard in the head!" return var/time = rand(10, 120) if (prob(90)) @@ -1382,9 +1393,10 @@ if (flag) return - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" - return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return src.add_fingerprint(user) if (src.charges < 1) user.show_message("\red *click* *click*", 2) @@ -1418,26 +1430,26 @@ /obj/item/weapon/gun/energy/taser_gun/attack(mob/M, mob/user) src.add_fingerprint(user) - - if (istype(M, /mob/ai) && M.stat<2) - if ((user.a_intent == "hurt" && src.charges > 0)) - src.charges-- - src.force = 25 - ..() - src.force = 10 - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] has been zapped with the taser gun by []!", M, user), 1, "\red You have been zapped with the taser gun by []!", 2) - else - ..() - else - + + if (istype(M, /mob/ai) && M.stat<2) + if ((user.a_intent == "hurt" && src.charges > 0)) + src.charges-- + src.force = 25 + ..() + src.force = 10 + for(var/mob/O in viewers(M, null)) + O.show_message(text("\red [] has been zapped with the taser gun by []!", M, user), 1, "\red You have been zapped with the taser gun by []!", 2) + else + ..() + else + var/mob/human/H = M // ******* Check if ((istype(H, /mob/human) && istype(H, /obj/item/weapon/clothing/head) && H.flags & 8 && prob(80))) - M << "\red The helmet protects you from being hit hard in the head!" + M.client_mob() << "\red The helmet protects you from being hit hard in the head!" return - if (src.charges >= 1) + if (src.charges >= 1) if (user.a_intent == "hurt") if (prob(20)) if (M.paralysis < 10) @@ -1447,7 +1459,7 @@ if (M.stuttering < 10) M.stuttering = 10 ..() - if (M.stat<2) + if (M.stat<2) M.stat = 1 for(var/mob/O in viewers(M, null)) O.show_message(text("\red [] has been knocked unconscious!", M), 1, "\red You hear someone fall", 2) @@ -1461,15 +1473,15 @@ M.weakened = 60 if (M.stuttering < 60) M.stuttering = 60 - if (M.stat<2) + if (M.stat<2) M.stat = 1 for(var/mob/O in viewers(M, null)) - if ((O.client && !( O.blinded ))) + if ((O.hasClient() && !( O.blinded ))) O.show_message(text("\red [] has been stunned with the taser gun by []!", M, user), 1, "\red You hear someone fall", 2) //Foreach goto(309) - src.charges-- - update_icon() - else // no charges in the gun, so they just wallop the target with it + src.charges-- + update_icon() + else // no charges in the gun, so they just wallop the target with it ..() /obj/item/weapon/pill_canister/New() @@ -1542,9 +1554,9 @@ for(var/obj/item/weapon/m_pill/M in src) pills += M.amount //Foreach goto(39) - usr << text("\blue There are [] pills inside!", pills) + usr.client_mob() << text("\blue There are [] pills inside!", pills) else - usr << "\blue It looks empty!" + usr.client_mob() << "\blue It looks empty!" return /obj/item/weapon/pill_canister/attack_paw(mob/user) @@ -1582,7 +1594,7 @@ pills += M.amount //Foreach goto(34) if (pills > 30) - usr << "\blue There are too many pills inside!" + usr.client_mob() << "\blue There are too many pills inside!" return for(var/obj/item/weapon/m_pill/M in src) if (M.type == W.type) @@ -1656,7 +1668,7 @@ spawn( 0 ) O.process() return - else + else if (istype(user, /mob/human) || istype(user, /mob/monkey)) src.add_fingerprint(user) ingest(M) return @@ -1741,7 +1753,7 @@ set src in view(1) ..() - usr << text("\blue There are [] pills left on the stack!", src.amount) + usr.client_mob() << text("\blue There are [] pills left on the stack!", src.amount) return /obj/item/weapon/m_pill/attackby(obj/item/weapon/m_pill/W, mob/user) @@ -1762,9 +1774,10 @@ /obj/item/weapon/handcuffs/attack(mob/M, mob/user) - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" - return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return if (istype(M, /mob/human)) var/obj/equip_e/human/O = new /obj/equip_e/human( ) O.source = user @@ -1777,7 +1790,7 @@ spawn( 0 ) O.process() return - else + else if (istype(M, /mob/monkey)) var/obj/equip_e/monkey/O = new /obj/equip_e/monkey( ) O.source = user O.target = M @@ -1789,6 +1802,8 @@ spawn( 0 ) O.process() return + else + user.client_mob() << "You can't handcuff [M]." return /obj/item/weapon/throwing(t_dir, rs) @@ -1814,7 +1829,7 @@ if(5.0) t = "huge" else - usr << text("This is a \icon[][]. It is a [] item.", src, src.name, t) + usr.client_mob() << text("This is a \icon[][]. It is a [] item.", src, src.name, t) ..() return @@ -1823,8 +1838,7 @@ if (istype(src.loc, /obj/item/weapon/storage)) for(var/mob/M in range(1, src.loc)) if (M.s_active == src.loc) - if (M.client) - M.client.screen -= src + M.eitherScreenRemove(src) //Foreach goto(34) src.throwing = 0 if (src.loc == user) @@ -1844,8 +1858,7 @@ if (istype(src.loc, /obj/item/weapon/storage)) for(var/mob/M in range(1, src.loc)) if (M.s_active == src.loc) - if (M.client) - M.client.screen -= src + M.eitherScreenRemove(src) //Foreach goto(34) src.throwing = 0 if (src.loc == user) @@ -1873,9 +1886,9 @@ if (src.laying) src.laying = 0 - user << "\blue Your done laying wire!" + user.client_mob() << "\blue You're done laying wire!" else - user << "\blue You are not using this to lay wire..." + user.client_mob() << "\blue You are not using this to lay wire..." return /obj/item/weapon/card/data/verb/label(t as text) @@ -1899,8 +1912,8 @@ /obj/item/weapon/card/id/verb/read() set src in usr - usr << text("\icon[] []: The current assignment on the card is [].", src, src.name, src.assignment) - usr << "\blue The rubric for the 4 access numbers is: general>lab-engine-systems" + usr.client_mob() << text("\icon[] []: The current assignment on the card is [].", src, src.name, src.assignment) + usr.client_mob() << "\blue The rubric for the 4 access numbers is: general>lab-engine-systems" return // new check_access for ID cards @@ -1980,7 +1993,7 @@ set src in view(1) ..() - usr << text("There are [] rod\s left on the stack.", src.amount) + usr.client_mob() << text("There are [] rod\s left on the stack.", src.amount) return /obj/item/weapon/rods/attack_self(mob/user) @@ -2049,7 +2062,7 @@ set src in view(1) ..() - usr << text("There are [] metal sheet\s on the stack.", src.amount) + usr.client_mob() << text("There are [] metal sheet\s on the stack.", src.amount) return /obj/item/weapon/sheet/metal/attack_self(mob/user) @@ -2077,7 +2090,7 @@ t1 += "
    " //Foreach goto(186) t1 += "
    " - user << browse(t1, "window=met_sheet") + user.client_mob() << browse(t1, "window=met_sheet") return /obj/item/weapon/sheet/metal/Topic(href, href_list) @@ -2225,10 +2238,7 @@ if(V.amount == 1) - - if(user.client) - user.client.screen -= V - + user.eitherScreenRemove(V) user.u_equip(W) del(W) else @@ -2252,16 +2262,17 @@ set src in view(1) ..() - usr << text("There are [] glass sheet\s on the stack.", src.amount) + usr.client_mob() << text("There are [] glass sheet\s on the stack.", src.amount) return /obj/item/weapon/sheet/glass/attack_self(mob/user) - if (!( istype(usr.loc, /turf/station) )) - return - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" + if (!( istype(user.loc, /turf/station) )) return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return switch(alert("Sheet-Glass", "Would you like full tile glass or one direction?", "one direct", "full (2 sheets)", "cancel", null)) if("one direct") var/obj/window/W = new /obj/window( usr.loc ) @@ -2327,16 +2338,17 @@ set src in view(1) ..() - usr << text("There are [] reinforced glass sheet\s on the stack.", src.amount) + usr.client_mob() << text("There are [] reinforced glass sheet\s on the stack.", src.amount) return /obj/item/weapon/sheet/rglass/attack_self(mob/user) - if (!( istype(usr.loc, /turf/station) )) - return - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" + if (!( istype(user.loc, /turf/station) )) return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return switch(alert("Sheet Reinf. Glass", "Would you like full tile glass or one direction?", "one direct", "full (2 sheets)", "cancel", null)) if("one direct") var/obj/window/W = new /obj/window( usr.loc, 1 ) @@ -2371,7 +2383,7 @@ for(var/obj/item/weapon/paper/P in src) dat += text("[] Write Remove
    ", src, P, P.name, src, P, src, P) //Foreach goto(42) - user << browse(dat, "window=clipboard") + user.client_mob() << browse(dat, "window=clipboard") return /obj/item/weapon/clipboard/Topic(href, href_list) @@ -2430,9 +2442,9 @@ var/obj/item/weapon/paper/P = locate(href_list["read"]) if ((P && P.loc == src)) if (!( istype(usr, /mob/human) )) - usr << browse(text("[][]", P.name, stars(P.info)), text("window=[]", P.name)) + usr.client_mob() << browse(text("[][]", P.name, stars(P.info)), text("window=[]", P.name)) else - usr << browse(text("[][]", P.name, P.info), text("window=[]", P.name)) + usr.client_mob() << browse(text("[][]", P.name, P.info), text("window=[]", P.name)) if (ismob(src.loc)) var/mob/M = src.loc if (M.machine == src) @@ -2482,7 +2494,7 @@ if (ctf) ctf.check_win(src) else - user << "\blue Not enough space!!!" + user.client_mob() << "\blue Not enough space!!!" else if (istype(P, /obj/item/weapon/pen)) if (!( src.pen )) @@ -2508,7 +2520,7 @@ for(var/obj/item/weapon/f_card/P in src) dat += text("[] Remove
    ", src, P, P.name, src, P) //Foreach goto(23) - user << browse(dat, "window=fcardholder") + user.client_mob() << browse(dat, "window=fcardholder") return /obj/item/weapon/fcardholder/Topic(href, href_list) @@ -2538,9 +2550,9 @@ var/obj/item/weapon/f_card/P = locate(href_list["read"]) if ((P && P.loc == src)) if (!( istype(usr, /mob/human) )) - usr << browse(text("[][]", P.name, P.display()), text("window=[]", P.name)) + usr.client_mob() << browse(text("[][]", P.name, P.display()), text("window=[]", P.name)) else - usr << browse(text("[][]", P.name, P.display()), text("window=[]", P.name)) + usr.client_mob() << browse(text("[][]", P.name, P.display()), text("window=[]", P.name)) src.add_fingerprint(usr) if (ismob(src.loc)) var/mob/M = src.loc @@ -2575,7 +2587,7 @@ add_fingerprint(user) src.add_fingerprint(user) else - user << "\blue Not enough space!!!" + user.client_mob() << "\blue Not enough space!!!" else if (istype(P, /obj/item/weapon/pen)) var/t = input(user, "Holder Label:", text("[]", src.name), null) as text @@ -2610,7 +2622,7 @@ /obj/item/weapon/extinguisher/examine() set src in usr - usr << text("\icon[] [] contains [] units of water left!", src, src.name, src.waterleft) + usr.client_mob() << text("\icon[] [] contains [] units of water left!", src, src.name, src.waterleft) ..() return @@ -2707,7 +2719,7 @@ /obj/item/weapon/pen/sleepypen/attack(mob/M, mob/user) - if (!( istype(M, /mob) )) + if (!((istype(M, /mob/human) || istype(M, /mob/monkey)))) return if (src.desc == "It's a normal black ink pen.") return ..() @@ -2883,9 +2895,9 @@ ..() if (!( istype(usr, /mob/human) )) - usr << browse(text("[][]", src.name, stars(src.info)), text("window=[]", src.name)) + usr.client_mob() << browse(text("[][]", src.name, stars(src.info)), text("window=[]", src.name)) else - usr << browse(text("[][]", src.name, src.info), text("window=[]", src.name)) + usr.client_mob() << browse(text("[][]", src.name, src.info), text("window=[]", src.name)) return /obj/item/weapon/paper/Map/examine() @@ -2893,11 +2905,11 @@ ..() - usr << browse_rsc(map_graphic) + usr.client_mob() << browse_rsc(map_graphic) if (!( istype(usr, /mob/human) )) - usr << browse(text("[][]", src.name, stars(src.info)), text("window=[]", src.name)) + usr.client_mob() << browse(text("[][]", src.name, stars(src.info)), text("window=[]", src.name)) else - usr << browse(text("[][]", src.name, src.info), text("window=[]", src.name)) + usr.client_mob() << browse(text("[][]", src.name, src.info), text("window=[]", src.name)) return @@ -2905,8 +2917,8 @@ set src in view(2) ..() - usr << text("\blue There are [] on the stack!", src.amount) - usr << browse(text("[][]", src.name, display()), text("window=[]", src.name)) + usr.client_mob() << text("\blue There are [] on the stack!", src.amount) + usr.client_mob() << browse(text("[][]", src.name, display()), text("window=[]", src.name)) return /obj/item/weapon/f_card/proc/display() @@ -3017,11 +3029,11 @@ /obj/item/weapon/f_print_scanner/attack(mob/human/M, mob/user) if ((!( ismob(M) ) || !( istype(M.primary, /obj/dna) ) || !( istype(M, /mob/human) ) || M.gloves)) - user << text("\blue Unable to locate any fingerprints on []!", M) + user.client_mob() << text("\blue Unable to locate any fingerprints on []!", M) return 0 else if ((src.amount < 1 && src.printing)) - user << text("\blue Fingerprints scanned on []. Need more cards to print.", M) + user.client_mob() << text("\blue Fingerprints scanned on []. Need more cards to print.", M) src.printing = 0 src.icon_state = text("f_print_scanner[]", src.printing) if (src.printing) @@ -3031,19 +3043,19 @@ F.fingerprints = md5(M.primary.uni_identity) F.icon_state = "f_print_card1" F.name = text("FPrintC- '[]'", M.name) - user << "\blue Done printing." - user << text("\blue []'s Fingerprints: []", M, md5(M.primary.uni_identity)) + user.client_mob() << "\blue Done printing." + user.client_mob() << text("\blue []'s Fingerprints: []", M, md5(M.primary.uni_identity)) return /obj/item/weapon/f_print_scanner/afterattack(atom/A, mob/user) src.add_fingerprint(user) if (!( A.fingerprints )) - user << "\blue Unable to locate any fingerprints!" + user.client_mob() << "\blue Unable to locate any fingerprints!" return 0 else if ((src.amount < 1 && src.printing)) - user << "\blue Fingerprints found. Need more cards to print." + user.client_mob() << "\blue Fingerprints found. Need more cards to print." src.printing = 0 src.icon_state = text("f_print_scanner[]", src.printing) if (src.printing) @@ -3052,47 +3064,54 @@ F.amount = 1 F.fingerprints = A.fingerprints F.icon_state = "f_print_card1" - user << "\blue Done printing." + user.client_mob() << "\blue Done printing." var/list/L = params2list(A.fingerprints) - user << text("\blue Isolated [] fingerprints.", L.len) + user.client_mob() << text("\blue Isolated [] fingerprints.", L.len) for(var/i in L) - user << text("\blue \t []", i) + user.client_mob() << text("\blue \t []", i) //Foreach goto(186) return /obj/item/weapon/healthanalyzer/attack(mob/M, mob/user) - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" - return - - for (var/mob/O in viewers(M, null)) - O.show_message("\red [user] has analyzed [M]'s vitals!", 1) - - user.show_message("\blue Analyzing Results for [M]:\n\t Overall Status: [M.stat > 1 ? "dead" : "[M.health]% healthy"]", 1) - user.show_message("\blue \t Damage Specifics: [M.oxyloss]-[M.toxloss]-[M.fireloss]-[M.bruteloss]", 1) - user.show_message("\blue Key: Suffocation/Toxin/Burns/Brute", 1) - - if (M.rejuv) - user.show_message("\blue Bloodstream Analysis located [M.rejuv] units of rejuvenation chemicals.", 1) - if (M.antitoxs) - user.show_message("\blue Bloodstream Analysis located [M.antitoxs] units of antitoxin chemicals.", 1) - if (M.plasma) - user.show_message("\blue Bloodstream Analysis located [M.antitoxs] units of toxic plasma chemicals.", 1) - // Not checked: r_epil, r_ch_cou, r_tourette - - if (!M.client) - user.show_message("\blue [M] has a vacant look in \his eyes.", 1) - + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return + + if (istype(M, /mob/human) || istype(M, /mob/monkey)) + + for (var/mob/O in viewers(M, null)) + O.show_message("\red [user] has analyzed [M]'s vitals!", 1) + + user.show_message("\blue Analyzing Results for [M]:\n\t Overall Status: [M.stat > 1 ? "dead" : "[M.health]% healthy"]", 1) + user.show_message("\blue \t Damage Specifics: [M.oxyloss]-[M.toxloss]-[M.fireloss]-[M.bruteloss]", 1) + user.show_message("\blue Key: Suffocation/Toxin/Burns/Brute", 1) + + if (M.rejuv) + user.show_message("\blue Bloodstream Analysis located [M.rejuv] units of rejuvenation chemicals.", 1) + if (M.antitoxs) + user.show_message("\blue Bloodstream Analysis located [M.antitoxs] units of antitoxin chemicals.", 1) + if (M.plasma) + user.show_message("\blue Bloodstream Analysis located [M.antitoxs] units of toxic plasma chemicals.", 1) + // Not checked: r_epil, r_ch_cou, r_tourette + + if (!M.hasClient()) + user.show_message("\blue [M] has a vacant look in \his eyes.", 1) + else if (M.currentDrone!=null) + user.show_message("\blue [M] does not appear to notice you.", 1) + else + user.client_mob() << "You can't get any meaningful results about [M] from the analyzer." src.add_fingerprint(user) /obj/item/weapon/analyzer/attack_self(mob/user) if (user.stat) return - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" - return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return var/turf/T = user.loc if (!( istype(T, /turf) )) return @@ -3156,23 +3175,42 @@ return /obj/item/weapon/storage/proc/show_to(mob/user) - - user.client.screen -= src.boxes - user.client.screen -= src.closer - user.client.screen -= src.contents - user.client.screen += src.boxes - user.client.screen += src.closer - user.client.screen += src.contents + var/screen + if (user.client) + screen = user.client.screen + else if (user.currentDrone!=null) + var/client/client = user.alwaysClient() + if (client) + screen = client.screenOrBackup() + else + return + else + return + screen -= src.boxes + screen -= src.closer + screen -= src.contents + screen += src.boxes + screen += src.closer + screen += src.contents + user.s_active = src return /obj/item/weapon/storage/proc/hide_from(mob/user) - - if(!user.client) + var/screen + if (user.client) + screen = user.client.screen + else if (user.currentDrone!=null) + var/client/client = user.alwaysClient() + if (client) + screen = client.screenOrBackup() + else + return + else return - user.client.screen -= src.boxes - user.client.screen -= src.closer - user.client.screen -= src.contents + screen -= src.boxes + screen -= src.closer + screen -= src.contents return /obj/item/weapon/storage/proc/close(mob/user) @@ -3368,7 +3406,7 @@ //Foreach goto(46) t += W.w_class if (t > 20) - user << "You cannot fit the item inside. (Remove larger classed items)" + user.client_mob() << "You cannot fit the item inside. (Remove larger classed items)" return user.u_equip(W) W.loc = src @@ -3471,7 +3509,7 @@ new /obj/item/weapon/wirecutters( src ) new /obj/item/weapon/t_scanner( src ) new /obj/item/weapon/crowbar( src ) - new /obj/item/weapon/cable_coil( src ) + new /obj/item/weapon/clothing/gloves/yellow( src ) new /obj/item/weapon/cable_coil( src ) new /obj/item/weapon/cable_coil( src ) @@ -3480,13 +3518,12 @@ /obj/item/weapon/storage/toolbox/attack(mob/M, mob/user) ..() - if ((prob(30) && M.stat < 2) && (!istype(M, /mob/ai))) + if ((prob(30) && M.stat < 2) && ((istype(M, /mob/human) || istype(M, /mob/monkey)))) var/mob/H = M // ******* Check - if ((istype(H, /mob/human) && istype(H, /obj/item/weapon/clothing/head) && H.flags & 8 && prob(80))) - M << "\red The helmet protects you from being hit hard in the head!" + M.client_mob() << "\red The helmet protects you from being hit hard in the head!" return var/time = rand(10, 120) if (prob(90)) @@ -3617,12 +3654,12 @@ return var/T = user.loc if (!( istype(T, /turf) )) - user << "\blue You must be on the ground!" + user.client_mob() << "\blue You must be on the ground!" return else var/S = T if (!( istype(S, /turf/space) )) - user << "You cannot build on or repair this turf!" + user.client_mob() << "You cannot build on or repair this turf!" return else src.build(S) @@ -3656,11 +3693,12 @@ set src in view(1) ..() - usr << text("There are [] tile\s left on the stack.", src.amount) + usr.client_mob() << text("There are [] tile\s left on the stack.", src.amount) return /obj/item/weapon/igniter/attackby(obj/item/weapon/W, mob/user) + var/client/client = user.alwaysClient() if ((istype(W, /obj/item/weapon/radio/signaler) && !( src.status ))) var/obj/item/weapon/radio/signaler/S = W if (!( S.b_stat )) @@ -3668,10 +3706,15 @@ var/obj/item/weapon/assembly/rad_ignite/R = new /obj/item/weapon/assembly/rad_ignite( user ) S.loc = R R.part1 = S - S.layer = initial(S.layer) - if (user.client) - user.client.screen -= S - if (user.r_hand == S) + S.layer = initial(S.layer) + if (client) + client.screenOrBackupRemove(S) + client.screen -= S + if (istype(user, /mob/drone)) + if (user.equipped() == S) + user.u_equip(S) + user:grip(R) + else if (user.r_hand == S) user.u_equip(S) user.r_hand = R else @@ -3681,8 +3724,9 @@ src.master = R src.layer = initial(src.layer) user.u_equip(src) - if (user.client) - user.client.screen -= src + if (client) + client.screenOrBackupRemove(src) + client.screen -= src src.loc = R R.part2 = src R.layer = 20 @@ -3695,9 +3739,14 @@ W.loc = R R.part1 = W W.layer = initial(W.layer) - if (user.client) - user.client.screen -= W - if (user.r_hand == W) + if (client) + client.screenOrBackupRemove(W) + client.screen -= W + if (istype(user, /mob/drone)) + if (user.equipped() == W) + user.u_equip(W) + user:grip(R) + else if (user.r_hand == W) user.u_equip(W) user.r_hand = R else @@ -3707,8 +3756,9 @@ src.master = R src.layer = initial(src.layer) user.u_equip(src) - if (user.client) - user.client.screen -= src + if (client) + client.screenOrBackupRemove(src) + client.screen -= src src.loc = R R.part2 = src R.layer = 20 @@ -3721,9 +3771,14 @@ W.loc = R R.part1 = W W.layer = initial(W.layer) - if (user.client) - user.client.screen -= W - if (user.r_hand == W) + if (client) + client.screenOrBackupRemove(W) + client.screen -= W + if (istype(user, /mob/drone)) + if (user.equipped() == W) + user.u_equip(W) + user:grip(R) + else if (user.r_hand == W) user.u_equip(W) user.r_hand = R else @@ -3733,8 +3788,9 @@ src.master = R src.layer = initial(src.layer) user.u_equip(src) - if (user.client) - user.client.screen -= src + if (client) + client.screenOrBackupRemove(src) + client.screen -= src src.loc = R R.part2 = src R.layer = 20 @@ -3775,7 +3831,7 @@ else if (!( istype(T, /turf) )) return - if (T.firelevel < 900000.0) + if (T.firelevel < config.min_gas_for_fire) T.firelevel = T.poison return @@ -3796,7 +3852,7 @@ ..() if ((get_dist(src, usr) <= 1 || src.loc == usr)) if (src.e_pads) - usr << "\blue The electric pads are exposed!" + usr.client_mob() << "\blue The electric pads are exposed!" return /obj/item/weapon/radio/electropack/attack_paw(mob/user) @@ -3807,7 +3863,7 @@ /obj/item/weapon/radio/electropack/attack_hand(mob/user) if (src == user.back) - user << "\blue You need help taking this off!" + user.client_mob() << "\blue You need help taking this off!" return else ..() @@ -3815,6 +3871,7 @@ /obj/item/weapon/radio/electropack/attackby(obj/item/weapon/W, mob/user) + var/client/client = user.alwaysClient() if (istype(W, /obj/item/weapon/screwdriver)) src.e_pads = !( src.e_pads ) if (src.e_pads) @@ -3828,9 +3885,14 @@ W.loc = A A.part1 = W W.layer = initial(W.layer) - if (user.client) - user.client.screen -= W - if (user.r_hand == W) + if (client) + client.screenOrBackupRemove(W) + client.screen -= W + if (istype(user, /mob/drone)) + if (user.equipped() == W) + user.u_equip(W) + user:grip(A) + else if (user.r_hand == W) user.u_equip(W) user.r_hand = A else @@ -3840,8 +3902,9 @@ src.master = A src.layer = initial(src.layer) user.u_equip(src) - if (user.client) - user.client.screen -= src + if (client) + client.screenOrBackupRemove(src) + client.screen -= src src.loc = A A.part2 = src A.layer = 20 @@ -3853,7 +3916,7 @@ //..() //Was causing double frequency changes -shadowlord13 if (usr.stat || usr.restrained()) return - if (((istype(usr, /mob/human) && ((!( ticker ) || (ticker && ticker.mode != "monkey")) && usr.contents.Find(src))) || (usr.contents.Find(src.master) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf))))) + if (((istype(usr, /mob/human) && ((!( ticker ) || (ticker && ticker.mode != "monkey") || (istype(usr, /mob/drone)) && usr.contents.Find(src))) || (usr.contents.Find(src.master) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf)))))) usr.machine = src if (href_list["freq"]) src.freq += text2num(href_list["freq"]) @@ -3888,7 +3951,7 @@ src.attack_self(M) //Foreach goto(384) else - usr << browse(null, "window=radio") + usr.client_mob() << browse(null, "window=radio") return return @@ -3927,7 +3990,7 @@ return user.machine = src var/dat = text("[]
    \nFrequency/Code for electropack:
    \nFrequency: -- [] ++
    \nCode: -- [] ++
    \n
    ", src, (src.on ? "Turn Off" : "Turn On"), src, src, src.freq, src, src, src, src, src.code, src, src) - user << browse(dat, "window=radio") + user.client_mob() << browse(dat, "window=radio") return /obj/item/weapon/radio/proc/accept_rad(obj/item/weapon/radio/R, message) @@ -4035,7 +4098,7 @@ else t1 = "-------" var/dat = text("Speaker: []
    \nSend Signal
    \nFrequency/Code for signaler:
    \nFrequency: -- [] ++
    \nCode: -- [] ++
    \n[]
    ", (src.listening ? text("Engaged", src) : text("Disengaged", src)), src, src, src, src.freq, src, src, src, src, src.code, src, src, t1) - user << browse(dat, "window=radio") + user.client_mob() << browse(dat, "window=radio") return /obj/item/weapon/radio/signaler/hear_talk() @@ -4166,7 +4229,7 @@ src.attack_self(M) //Foreach goto(577) else - usr << browse(null, "window=radio") + usr.client_mob() << browse(null, "window=radio") return return @@ -4213,7 +4276,7 @@ else t1 = "-------" var/dat = text("Microphone: []
    \nSpeaker: []
    \nFrequency: -- [] ++
    \n[]
    ", (src.broadcasting ? text("Engaged", src) : text("Disengaged", src)), (src.listening ? text("Engaged", src) : text("Disengaged", src)), src, src, src.freq, src, src, t1) - user << browse(dat, "window=radio") + user.client_mob() << browse(dat, "window=radio") return /obj/item/weapon/radio/Topic(href, href_list) @@ -4268,7 +4331,7 @@ src.updateDialog() src.add_fingerprint(usr) else - usr << browse(null, "window=radio") + usr.client_mob() << browse(null, "window=radio") return return @@ -4474,17 +4537,21 @@ if (!( istype(M, /mob) )) return - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" - return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return if (user) - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] has been eyedropped with [] by [].", M, src, user), 1) - //Foreach goto(89) - var/amount = src.chem.dropper_mob(M, 1) - src.update_is() - user.show_message(text("\red You drop [] units into []'s eyes. The dropper contains [] millimeters.", amount, M, src.chem.volume())) - src.add_fingerprint(user) + if (istype(M, /mob/human) || istype(M, /mob/monkey)) + for(var/mob/O in viewers(M, null)) + O.show_message(text("\red [] has been eyedropped with [] by [].", M, src, user), 1) + //Foreach goto(89) + var/amount = src.chem.dropper_mob(M, 1) + src.update_is() + user.show_message(text("\red You drop [] units into []'s eyes. The dropper contains [] millimeters.", amount, M, src.chem.volume())) + src.add_fingerprint(user) + else + user.client_mob() << "\red You can't eyedrop [M]!" return /obj/item/weapon/implantcase/proc/update() @@ -4597,7 +4664,7 @@ dat += "The implant casing is empty." else dat += "Please insert an implant casing!" - user << browse(dat, "window=implantpad") + user.client_mob() << browse(dat, "window=implantpad") return /obj/item/weapon/implantpad/Topic(href, href_list) @@ -4629,7 +4696,7 @@ //Foreach goto(290) src.add_fingerprint(usr) else - usr << browse(null, "window=implantpad") + usr.client_mob() << browse(null, "window=implantpad") return return @@ -4748,9 +4815,10 @@ if (!( istype(M, /mob) )) return - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" - return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return if (user) if (istype(M, /mob/human)) var/obj/equip_e/human/O = new /obj/equip_e/human( ) @@ -4764,7 +4832,7 @@ spawn( 0 ) O.process() return - else + else if (istype(M, /mob/monkey)) for(var/mob/O in viewers(M, null)) O.show_message(text("\red [] has been injected with [] by [].", M, src, user), 1) //Foreach goto(192) @@ -4799,9 +4867,10 @@ if (M.health < 0) return - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" - return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return if (user) for(var/mob/O in viewers(M, null)) O.show_message(text("\red [] has been applied with [] by []", M, src, user), 1) @@ -4825,15 +4894,17 @@ H.UpdateDamageIcon() else H.UpdateDamage() - M.health = 100 - M.oxyloss - M.toxloss - M.fireloss - M.bruteloss - src.amount-- + M.health = 100 - M.oxyloss - M.toxloss - M.fireloss - M.bruteloss + src.amount-- + else + usr.client_mob() << text("\red The [] only works on humans.", src) return /obj/item/weapon/brutepack/examine() set src in view(1) ..() - usr << text("\blue there are [] bruise pack\s left on the stack!", src.amount) + usr.client_mob() << text("\blue there are [] bruise pack\s left on the stack!", src.amount) if (src.amount <= 0) //SN src = null del(src) @@ -4900,12 +4971,13 @@ if (M.health < 0) return - if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) - user << "\red You don't have the dexterity to do this!" - return + if ((!( istype(user, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) + if (!istype(user, /mob/drone)) + user.client_mob() << "\red You don't have the dexterity to do this!" + return if (user) for(var/mob/O in viewers(M, null)) - if ((O.client && !( O.blinded ))) + if ((O.hasClient() && !( O.blinded ))) O.show_message(text("\red [] has been applied with [] by []", M, src, user), 1) //Foreach goto(89) if (istype(M, /mob/human)) @@ -4927,17 +4999,19 @@ H.UpdateDamageIcon() else H.UpdateDamage() - src.amount-- - if (src.amount <= 0) - //SN src = null - del(src) - return + src.amount-- + if (src.amount <= 0) + //SN src = null + del(src) + return + else + user.client_mob() << text("The [] only works on humans.", src) return /obj/item/weapon/ointment/examine() set src in view(1) - usr << text("\blue there are [] ointment pack\s left on the stack!", src.amount) + usr.client_mob() << text("\blue there are [] ointment pack\s left on the stack!", src.amount) return /obj/item/weapon/ointment/attackby(obj/item/weapon/ointment/W, mob/user) @@ -4959,7 +5033,7 @@ /obj/item/weapon/bottle/examine() set src in usr - usr << text("\blue The bottle \icon[] contains [] millimeters of chemicals", src, round(src.chem.volume(), 0.1)) + usr.client_mob() << text("\blue The bottle \icon[] contains [] millimeters of chemicals", src, round(src.chem.volume(), 0.1)) return /obj/item/weapon/bottle/New() @@ -5098,7 +5172,7 @@ /obj/item/weapon/weldingtool/examine() set src in usr - usr << text("\icon[] [] contains [] units of fuel left!", src, src.name, src.weldfuel) + usr.client_mob() << text("\icon[] [] contains [] units of fuel left!", src, src.name, src.weldfuel) return /obj/item/weapon/weldingtool/afterattack(obj/O, mob/user) @@ -5106,7 +5180,7 @@ if (src.welding) src.weldfuel-- if (src.weldfuel <= 0) - usr << "\blue Need more fuel!" + usr.client_mob() << "\blue Need more fuel!" src.welding = 0 src.force = 3 src.damtype = "brute" @@ -5122,15 +5196,15 @@ src.welding = !( src.welding ) if (src.welding) if (src.weldfuel <= 0) - user << "\blue Need more fuel!" + user.client_mob() << "\blue Need more fuel!" src.welding = 0 return 0 - user << "\blue You will now weld when you attack." + user.client_mob() << "\blue You will now weld when you attack." src.force = 15 src.damtype = "fire" src.icon_state = "welder1" else - user << "\blue Not welding anymore." + user.client_mob() << "\blue Not welding anymore." src.force = 3 src.damtype = "brute" src.icon_state = "welder" @@ -5194,12 +5268,12 @@ src.amount = round(src.amount) if (src.amount <= 0) src.amount = 0 - usr << "There are no bed sheets in the bin." + usr.client_mob() << "There are no bed sheets in the bin." else if (src.amount == 1) - usr << "There is one bed sheet in the bin." + usr.client_mob() << "There is one bed sheet in the bin." else - usr << text("There are [] bed sheets in the bin.", src.amount) + usr.client_mob() << text("There are [] bed sheets in the bin.", src.amount) return /obj/table/ex_act(severity) @@ -5254,13 +5328,15 @@ if ((!( istype(O, /obj/item/weapon) ) || user.equipped() != O)) return + if (!user.can_drop()) + return user.drop_item() if (O.loc != src.loc) step(O, get_dir(O, src)) return /obj/table/attackby(obj/item/weapon/W, mob/user) - if (istype(W, /obj/item/weapon/grab)) + if (istype(W, /obj/item/weapon/grab)) return if (istype(W, /obj/item/weapon/wrench)) new /obj/item/weapon/table_parts( src.loc ) @@ -5268,6 +5344,8 @@ del(src) return return + if (!user.can_drop()) + return user.drop_item() if (W.loc != src.loc) step(W, get_dir(W, src)) @@ -5310,13 +5388,15 @@ if ((!( istype(O, /obj/item/weapon) ) || user.equipped() != O)) return + if (!user.can_drop()) + return user.drop_item() if (O.loc != src.loc) step(O, get_dir(O, src)) return /obj/rack/attackby(obj/item/weapon/W, mob/user) - if (istype(W, /obj/item/weapon/grab)) + if (istype(W, /obj/item/weapon/grab)) return if (istype(W, /obj/item/weapon/wrench)) new /obj/item/weapon/rack_parts( src.loc ) @@ -5324,6 +5404,8 @@ del(src) return return + if (!user.can_drop()) + return user.drop_item() if (W.loc != src.loc) step(W, get_dir(W, src)) @@ -5342,7 +5424,7 @@ return W.weldfuel = 20 W.suffix = text("[][]", (W == src ? "equipped " : ""), W.weldfuel) - user << "\blue Welder refueled" + user.client_mob() << "\blue Welder refueled" return /obj/weldfueltank/ex_act(severity) @@ -5382,7 +5464,7 @@ return W.waterleft = 20 W.suffix = text("[][]", (user.equipped() == src ? "equipped " : ""), W.waterleft) - user << "\blue Extinguisher refueled" + user.client_mob() << "\blue Extinguisher refueled" return /obj/watertank/ex_act(severity) @@ -5425,7 +5507,7 @@ if (W:amount < 1) //W = null del(W) - user << "\blue Keep in mind when you open it that it MAY be difficult to sldie at first so keep trying." + user.client_mob() << "\blue Keep in mind when you open it that it MAY be difficult to slide at first so keep trying." //SN src = null del(src) return @@ -5497,7 +5579,8 @@ else M.ex_act(1) if (rand(1, 1000) <= 10) - M << "\red You see a fainting blue light." + if (istype(M, /mob)) + M:client_mob() << ("\red You see a fainting blue light.") M.loc = null else M.loc = locate(tx, ty, src.target.z) @@ -5576,8 +5659,8 @@ return /atom/proc/attack_ai(mob/user) - return - + return + /atom/proc/hand_h(mob/user) return @@ -5594,14 +5677,14 @@ if (istype(W, /obj/item/weapon/f_print_scanner)) for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O << text("\red [] has been scanned by [] with the []", src, user, W) + if (!( O.blinded )) + O.client_mob() << text("\red [] has been scanned by [] with the []", src, user, W) //Foreach goto(31) else if (!( istype(W, /obj/item/weapon/grab) )) for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O << text("\red [] has been hit by [] with []", src, user, W) + if (!( O.blinded )) + O.client_mob() << text("\red [] has been hit by [] with []", src, user, W) //Foreach goto(102) return @@ -5647,95 +5730,145 @@ usr:lastDblClick = world.time ..() - var/obj/item/weapon/W = usr.equipped() - if ((W == src && usr.stat == 0)) - spawn(0) W.attack_self(usr) - return - if (((!usr.canmove) && (!istype(usr, /mob/ai))) || usr.stat != 0) + // I changed everything in this function from using usr to user before I found out that you can actually change the value of usr. --shadowlord13 + var/mob/user = usr + if (user.currentDrone!=null) + user = user.currentDrone + usr = user + + var/obj/item/weapon/W = user.equipped() + if (user.stat == 0) + if (istype(user, /mob/drone)) + //check to see if it's one of our tools or the boxes they're in + var/obj/item/weapon/tool = user:checkIsOurTool(src) + if (tool!=null) + if (tool==W) + user.client_mob() << "user clicked their active tool." + spawn(0) + W.attack_self(user) + user:updateToolIcon(W) + return + else + user.client_mob() << "user switched tools from [W] to [tool]" + user:selectTool(tool) + return + else + user.client_mob() << "That's not one of our tools" + user:pressIfDroneButton(src) + if (W == src) + user.client_mob() << "user clicked their active item." + spawn(0) W.attack_self(user) + return + + if (((!user.canmove) && (!istype(user, /mob/ai))) || user.stat != 0) return /* This line broke my mental parser. --Stephen001 */ - if ((!(src in usr.contents) && (((!(isturf(src)) && (!(isturf(src.loc)) && (src.loc && !(isturf(src.loc.loc))))) || !(isturf(usr.loc))) && (src.loc != usr.loc && (!(istype(src, /obj/screen)) && !(usr.contents.Find(src.loc))))))) + if ((!(src in user.contents) && (((!(isturf(src)) && (!(isturf(src.loc)) && (src.loc && !(isturf(src.loc.loc))))) || !(isturf(user.loc))) && (src.loc != user.loc && (!(istype(src, /obj/screen)) && !(user.contents.Find(src.loc))))))) return - /* Surely src.loc == usr is redundant? --Stephen001 */ - var/t5 = (get_dist(src, usr) <= 1 || src.loc == usr) - if (istype(usr, /mob/ai)) + /* How's this? --shadowlord13 */ + /* + //If the dclicked item is in our inventory + if (!(src in user.contents)) + //If the item is not a turf, and it is not on a turf, and it is inside something else which is not in a turf + if (!(isturf(src)) && (!(isturf(src.loc)) && (src.loc && !(isturf(src.loc.loc))))) + return + //If not, if we are inside some item instead of on a turf, and the dclicked item is not in the same place as us, and the dclicked item is not a screen object, and the dclicked item is not inside an item in our inventory. + else if ((!(isturf(user.loc))) && (src.loc != user.loc && (!(istype(src, /obj/screen)) && !(user.contents.Find(src.loc))))) + return + */ + + + /* Surely src.loc == user is redundant? --Stephen001 */ + /* That's checking to see if it's being held/worn or something like that, methinks --shadowlord13 */ + var/t5 = (get_dist(src, user) <= 1 || src.loc == user) + if (istype(user, /mob/ai)) t5 = 1 - if ((istype(src, /obj/item/weapon/organ) && src in usr.contents)) - var/mob/human/H = usr - usr << "Betchya think you're really smart trying to remove your own body parts aren't ya!" - if (istype(usr, /mob/human)) + else if (istype(user, /mob/drone)) + if (user:selectedTool == user:aiInterface) + if (istype(user:controlledBy, /mob/ai)) + t5 = 1 + user = user:controlledBy + W = null + + if ((istype(src, /obj/item/weapon/organ) && src in user.contents)) + var/mob/human/H = user + user.client_mob() << "Betchya think you're really smart trying to remove your own body parts aren't ya!" + if (istype(user, /mob/human)) if (!(src == H.l_store || src == H.r_store)) return else return /* Suggested fix by shadowlord13 for Bug #1952091. --Stephen001 */ - var/turf/turfLoc = (istype(src, /turf) ? src : src.loc) + var/turf/turfLoc = (istype(src, /turf) ? src : src.loc) + /* Seems like a pretty important expression. Dare I fathom what it checks? --Stephen001 */ + /* flag 16 in this case apparently disables the distance check and the alternate 'is in contents' check in the var/t5 line. + It's used on guns, for instance. --shadowlord13 */ if (((t5 || (W && (W.flags & 16))) && !(istype(src, /obj/screen)))) - if (usr.next_move < world.time) - usr.prev_move = usr.next_move - usr.next_move = world.time + 10 + if (user.next_move < world.time) + user.prev_move = user.next_move + user.next_move = world.time + 10 else - return - if ((turfLoc && (get_dist(src, usr) < 2 || turfLoc == usr.loc))) - var/direct = get_dir(usr, src) - var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy(usr.loc) + return + if ((turfLoc && (get_dist(src, user) < 2 || turfLoc == user.loc))) + var/direct = get_dir(user, src) + var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy(user.loc) var/ok = 0 if ((direct - 1) & direct) var/turf/T switch(direct) if(5.0) - T = get_step(usr, NORTH) + T = get_step(user, NORTH) if (T.Enter(D, src)) D.loc = T T = turfLoc if (T.Enter(D, src)) ok = 1 else - T = get_step(usr, EAST) + T = get_step(user, EAST) if (T.Enter(D, src)) D.loc = T T = turfLoc if (T.Enter(D, src)) ok = 1 if(6.0) - T = get_step(usr, SOUTH) + T = get_step(user, SOUTH) if (T.Enter(D, src)) D.loc = T T = turfLoc if (T.Enter(D, src)) ok = 1 else - T = get_step(usr, EAST) + T = get_step(user, EAST) if (T.Enter(D, src)) D.loc = T T = turfLoc if (T.Enter(D, src)) ok = 1 if(9.0) - T = get_step(usr, NORTH) + T = get_step(user, NORTH) if (T.Enter(D, src)) D.loc = T T = turfLoc if (T.Enter(D, src)) ok = 1 else - T = get_step(usr, WEST) + T = get_step(user, WEST) if (T.Enter(D, src)) D.loc = T T = turfLoc if (T.Enter(D, src)) ok = 1 if(10.0) - T = get_step(usr, SOUTH) + T = get_step(user, SOUTH) if (T.Enter(D, src)) D.loc = T T = turfLoc if (T.Enter(D, src)) ok = 1 else - T = get_step(usr, WEST) + T = get_step(user, WEST) if (T.Enter(D, src)) D.loc = T T = turfLoc @@ -5746,91 +5879,88 @@ if (turfLoc.Enter(D, src)) ok = 1 else - if ((src.flags & 512 && get_dir(src, usr) & src.dir)) + if ((src.flags & 512 && get_dir(src, user) & src.dir)) ok = 1 - if (usr.loc != turfLoc) - for(var/atom/A in usr.loc) - if ((!A.CheckExit(usr, src.loc)) && A != usr) + if (user.loc != turfLoc) + for(var/atom/A in user.loc) + if ((!A.CheckExit(user, src.loc)) && A != user) ok = 0 del(D) if (!(ok)) return 0 - - if (!usr.restrained()) + user << "Debug message: W [W] t5 [t5] src [src] user [user]" + if (!user.restrained()) if (W) if (t5) - src.attackby(W, usr) + src.attackby(W, user) if (W) - W.afterattack(src, usr, (t5 ? 1 : 0)) + W.afterattack(src, user, (t5 ? 1 : 0)) else - if (istype(usr, /mob/human)) - src.attack_hand(usr, usr.hand) + if (istype(user, /mob/human) || istype(user, /mob/drone)) + src.attack_hand(user, user.hand) else - if (istype(usr, /mob/monkey)) - src.attack_paw(usr, usr.hand) + if (istype(user, /mob/monkey)) + src.attack_paw(user, user.hand) else - if (istype(usr, /mob/ai)) - src.attack_ai(usr, usr.hand) + if (istype(user, /mob/ai)) + src.attack_ai(user, user.hand) else - if (istype(usr, /mob/human)) - src.hand_h(usr, usr.hand) + if (istype(user, /mob/human)) + src.hand_h(user, user.hand) else - if (istype(usr, /mob/monkey)) - src.hand_p(usr, usr.hand) + if (istype(user, /mob/monkey)) + src.hand_p(user, user.hand) else - if (istype(usr, /mob/ai)) - src.hand_a(usr, usr.hand) + if (istype(user, /mob/ai)) + src.hand_a(user, user.hand) else if (istype(src, /obj/screen)) - usr.prev_move = usr.next_move - if (usr.next_move < world.time) - usr.next_move = world.time + 10 + user.prev_move = user.next_move + if (user.next_move < world.time) + user.next_move = world.time + 10 else return - if (!( usr.restrained() )) + if (!( user.restrained() )) if ((W && !( istype(src, /obj/screen) ))) - src.attackby(W, usr) + src.attackby(W, user) if (W) - W.afterattack(src, usr) + W.afterattack(src, user) else - if (istype(usr, /mob/human)) - src.attack_hand(usr, usr.hand) + if (istype(user, /mob/human)) + src.attack_hand(user, user.hand) else - if (istype(usr, /mob/monkey)) - src.attack_paw(usr, usr.hand) + if (istype(user, /mob/monkey)) + src.attack_paw(user, user.hand) else - if (istype(usr, /mob/human)) - src.hand_h(usr, usr.hand) + if (istype(user, /mob/human)) + src.hand_h(user, user.hand) else - if (istype(usr, /mob/monkey)) - src.hand_p(usr, usr.hand) + if (istype(user, /mob/monkey)) + src.hand_p(user, user.hand) return -/obj/proc/updateUsrDialog() - var/list/nearby = viewers(1, src) - for(var/mob/M in nearby) - if ((M.client && M.machine == src)) - src.attack_hand(M) - if (istype(usr, /mob/ai)) - if (!(usr in nearby)) - if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh. - src.attack_ai(usr) - /obj/proc/updateDialog() - var/list/nearby = viewers(1, src) + var/list/nearby = viewers(1, src) + var/skipAI = 0 for(var/mob/M in nearby) if ((M.client && M.machine == src)) src.attack_hand(M) - AutoUpdateAI(src, 0) - -//Used for air tanks only at the moment, maybe other things later -/obj/proc/updateEquippedDialog() - var/list/nearby = viewers(1, src.loc) - for(var/mob/M in nearby) - if ((M.client && M.machine == src)) - src:attack_self(M) - AutoUpdateAI(src, 1) - \ No newline at end of file + else if (istype(M, /mob/drone) && M.machine==src) + if (M:controlledBy!=null) + if ((!istype(M:controlledBy, /mob/ai)) || (!istype(M:equipped(), /obj/item/weapon/drone/aiInterface))) + src.attack_hand(M) + if (istype(M:controlledBy, /mob/ai)) + skipAI = 1 + if (!skipAI) + AutoUpdateAI(src, 0) + +//Used for air tanks only at the moment, maybe other things later +/obj/proc/updateEquippedDialog() + var/list/nearby = viewers(1, src.loc) + for(var/mob/M in nearby) + if ((M.client && M.machine == src)) + src:attack_self(M) + AutoUpdateAI(src, 1) diff --git a/Code/mob.dm b/Code/mob.dm index 5f836b7..313036c 100644 --- a/Code/mob.dm +++ b/Code/mob.dm @@ -18,6 +18,8 @@ usr.show_message(t, 1) +/mob/proc/can_drop() + return 1 /proc/hsl2rgb(h, s, l) @@ -261,8 +263,8 @@ del(src) return if (src.assailant.client) - src.assailant.client.screen -= src.hud1 - src.assailant.client.screen += src.hud1 + src.assailant.client.screenOrBackupRemove(src.hud1) + src.assailant.client.screenOrBackupAdd(src.hud1) if (src.assailant.pulling == src.affecting) src.assailant.pulling = null if (src.state <= 2) @@ -286,7 +288,7 @@ if (G.state == 2) src.allow_upgrade = 0 //Foreach goto(341) - if (src.allow_upgrade) + if ((src.allow_upgrade) && (istype(src, /mob/human) || istype(src, /mob/monkey))) src.hud1.icon_state = "reinforce" else src.hud1.icon_state = "!reinforce" @@ -336,6 +338,8 @@ if (src.state < 2) if (!( src.allow_upgrade )) return + if (!(istype(src, /mob/human) || istype(src, /mob/monkey))) + return if (prob(75)) for(var/mob/O in viewers(src.assailant, null)) O.show_message(text("\red [] has grabbed [] aggressively (now hands)!", src.assailant, src.affecting), 1) @@ -1044,7 +1048,7 @@ if (src.item) for(var/mob/O in viewers(src.target, null)) - if ((O.client && !( O.blinded ))) + if ((O.hasClient() && !( O.blinded ))) O.show_message(text("\red [] is trying to put a [] on []", src.source, src.item, src.target), 1) //Foreach goto(251) else @@ -1083,14 +1087,15 @@ if ((src.item && src.source.equipped() != src.item)) return if ((src.source.restrained() || src.source.stat)) - return + return + switch(src.place) if("mask") if (src.target.wear_mask) var/obj/item/weapon/W = src.target.wear_mask src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1107,8 +1112,8 @@ if (src.target.l_hand) var/obj/item/weapon/W = src.target.l_hand src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1125,8 +1130,8 @@ if (src.target.r_hand) var/obj/item/weapon/W = src.target.r_hand src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1143,8 +1148,8 @@ if (src.target.back) var/obj/item/weapon/W = src.target.back src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1161,8 +1166,8 @@ if (src.target.handcuffed) var/obj/item/weapon/W = src.target.handcuffed src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1187,7 +1192,7 @@ src.target.internal = src.target.back src.target.internal.add_fingerprint(src.source) for(var/mob/M in viewers(src.target, 1)) - if ((M.client && !( M.blinded ))) + if ((M.hasClient() && !( M.blinded ))) M.show_message(text("[] is now running on internals.", src.target), 1) //Foreach goto(1097) else @@ -1346,8 +1351,8 @@ if (src.target.wear_mask) var/obj/item/weapon/W = src.target.wear_mask src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1364,8 +1369,8 @@ if (src.target.w_radio) var/obj/item/weapon/W = src.target.w_radio src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1381,8 +1386,8 @@ if (src.target.gloves) var/obj/item/weapon/W = src.target.gloves src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1399,8 +1404,8 @@ if (src.target.glasses) var/obj/item/weapon/W = src.target.glasses src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1417,8 +1422,8 @@ if (src.target.belt) var/obj/item/weapon/W = src.target.belt src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1435,8 +1440,8 @@ if (src.target.head) var/obj/item/weapon/W = src.target.head src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1453,8 +1458,8 @@ if (src.target.ears) var/obj/item/weapon/W = src.target.ears src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1471,8 +1476,8 @@ if (src.target.shoes) var/obj/item/weapon/W = src.target.shoes src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1493,8 +1498,8 @@ if (src.target.l_hand) var/obj/item/weapon/W = src.target.l_hand src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1516,8 +1521,8 @@ if (src.target.r_hand) var/obj/item/weapon/W = src.target.r_hand src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1536,7 +1541,7 @@ var/obj/item/weapon/W = src.target.w_uniform src.target.u_equip(W) if (src.target.client) - src.target.client.screen -= W + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1545,8 +1550,8 @@ W = src.target.l_store if (W) src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1554,8 +1559,8 @@ W = src.target.r_store if (W) src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1563,8 +1568,8 @@ W = src.target.wear_id if (W) src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1580,8 +1585,8 @@ if (src.target.wear_suit) var/obj/item/weapon/W = src.target.wear_suit src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1598,8 +1603,8 @@ if (src.target.wear_id) var/obj/item/weapon/W = src.target.wear_id src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1616,8 +1621,8 @@ if (src.target.back) var/obj/item/weapon/W = src.target.back src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1634,8 +1639,8 @@ if (src.target.handcuffed) var/obj/item/weapon/W = src.target.handcuffed src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1662,7 +1667,7 @@ for(var/mob/O in viewers(src.source, null)) O.show_message(text("\red [] performs CPR on []!", src.source, src.target), 1) //Foreach goto(3251) - src.source << "\red Repeat every 7 seconds AT LEAST." + src.source.client_mob() << "\red Repeat every 7 seconds AT LEAST." if("syringe") var/obj/item/weapon/syringe/S = src.item src.item.add_fingerprint(src.source) @@ -1679,7 +1684,7 @@ for(var/mob/O in viewers(src.source, null)) O.show_message(text("\red [] injects [] with the syringe!", src.source, src.target), 1) //Foreach goto(3407) - src.source << text("\red You inject [] units into []. The syringe contains [] units.", a, src.target, S.chem.volume()) + src.source.client_mob() << text("\red You inject [] units into []. The syringe contains [] units.", a, src.target, S.chem.volume()) if("pill") var/obj/item/weapon/m_pill/S = src.item if (!( istype(S, /obj/item/weapon/m_pill) )) @@ -1700,8 +1705,8 @@ if (src.target.l_store) var/obj/item/weapon/W = src.target.l_store src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1710,8 +1715,8 @@ if (src.target.r_store) var/obj/item/weapon/W = src.target.r_store src.target.u_equip(W) - if (src.target.client) - src.target.client.screen -= W + if (src.target.hasClient()) + src.target.screenOrBackupRemove(W) if (W) W.loc = src.target.loc W.dropped(src.target) @@ -1861,13 +1866,14 @@ return /mob/human/proc/monkeyize() - + if (src.currentDrone!=null) + src.currentDrone:releaseControl(0) if (src.monkeyizing) return for(var/obj/item/weapon/W in src) src.u_equip(W) if (src.client) - src.client.screen -= W + src.client.screenOrBackupRemove(W) if (W) W.loc = src.loc W.dropped(src) @@ -2379,7 +2385,9 @@ //src.paralysis += 1 src.show_message("\red The blob attacks you!") - + src.damage_anywhere(damage) + +/mob/human/proc/damage_anywhere(damage) var/list/zones = list("head","chest","chest", "diaper", "l_arm", "r_arm", "l_hand", "r_hand", "l_leg", "r_leg", "l_foot", "r_foot") var/zone = pick(zones) @@ -2460,8 +2468,8 @@ W = src.r_store if (W) u_equip(W) - if (src.client) - src.client.screen -= W + if (src.hasClient()) + src.screenOrBackupRemove(W) if (W) W.loc = src.loc W.dropped(src) @@ -2469,8 +2477,8 @@ W = src.l_store if (W) u_equip(W) - if (src.client) - src.client.screen -= W + if (src.hasClient()) + src.screenOrBackupRemove(W) if (W) W.loc = src.loc W.dropped(src) @@ -2478,8 +2486,8 @@ W = src.wear_id if (W) u_equip(W) - if (src.client) - src.client.screen -= W + if (src.hasClient()) + src.screenOrBackupRemove(W) if (W) W.loc = src.loc W.dropped(src) @@ -2487,8 +2495,8 @@ W = src.belt if (W) u_equip(W) - if (src.client) - src.client.screen -= W + if (src.hasClient()) + src.screenOrBackupRemove(W) if (W) W.loc = src.loc W.dropped(src) @@ -2689,7 +2697,7 @@ /mob/human/meteorhit(O as obj) for(var/mob/M in viewers(src, null)) - if ((M.client && !( M.blinded ))) + if ((M.hasClient() && !( M.blinded ))) M.show_message(text("\red [] has been hit with by []", src, O), 1) //Foreach goto(19) if (src.health > 0) @@ -2724,64 +2732,68 @@ src.sdisabilities = 0 src.stat = 0 -*/ +*/ + +/* IMPORTANT NOTE: Both humans and drones have a copy of this code. If the code is modified to fix a bug or whatever, it will need to be modified in BOTH of them. Monkeys also have some of this code, but not all of it. (Moving the code into a shared method or two wasn't feasible because of where the ..() calls are and such) --shadowlord13 */ /mob/human/Move(a, b, flag) - - if (src.buckled) - return - if (src.restrained()) - src.pulling = null - var/t7 = 1 - if (src.restrained()) - for(var/mob/M in range(src, 1)) - if ((M.pulling == src && M.stat == 0 && !( M.restrained() ))) - t7 = null - //Foreach goto(62) - if ((t7 && (src.pulling && ((get_dist(src, src.pulling) <= 1 || src.pulling.loc == src.loc) && (src.client && src.client.moving))))) - var/turf/T = src.loc - . = ..() - if (!( isturf(src.pulling.loc) )) - src.pulling = null - return - ////// - if (src.pulling.anchored) - src.pulling = null - return - ////// - if (!( src.restrained() )) - var/diag = get_dir(src, src.pulling) - if ((diag - 1) & diag) - else - diag = null - if ((get_dist(src, src.pulling) > 1 || diag)) - if (ismob(src.pulling)) - var/mob/M = src.pulling - var/ok = 1 - if (locate(/obj/item/weapon/grab, M.grabbed_by.len)) - if (prob(75)) - var/obj/item/weapon/grab/G = pick(M.grabbed_by) - if (istype(G, /obj/item/weapon/grab)) - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] has been pulled from []'s grip by []", G.affecting, G.assailant, src), 1) - //Foreach goto(354) - //G = null - del(G) - else - ok = 0 - if (locate(/obj/item/weapon/grab, M.grabbed_by.len)) - ok = 0 - if (ok) - var/t = M.pulling - M.pulling = null - step(src.pulling, get_dir(src.pulling.loc, T)) - M.pulling = t - else - step(src.pulling, get_dir(src.pulling.loc, T)) - else - src.pulling = null - . = ..() - if ((src.s_active && !( s_active in src.contents ) )) - src.s_active.close(src) + if (src.buckled) + return + if (src.restrained()) + src.pulling = null + var/t7 = 1 + if (src.restrained()) + for(var/mob/M in range(src, 1)) + if ((M.pulling == src && M.stat == 0 && !( M.restrained() ))) + t7 = null + //Foreach goto(62) + if ((t7 && (src.pulling && ((get_dist(src, src.pulling) <= 1 || src.pulling.loc == src.loc) && (src.client && src.client.moving))))) + var/turf/T = src.loc + . = ..() + if (!( isturf(src.pulling.loc) )) + src.pulling = null + return + ////// + if (src.pulling.anchored) + src.pulling = null + return + if (istype(src.pulling, /mob/drone) && config.walkable_not_pullable_drones) + src.pulling = null + return + ////// + if (!( src.restrained() )) + var/diag = get_dir(src, src.pulling) + if ((diag - 1) & diag) + else + diag = null + if ((get_dist(src, src.pulling) > 1 || diag)) + if (ismob(src.pulling)) + var/mob/M = src.pulling + var/ok = 1 + if (locate(/obj/item/weapon/grab, M.grabbed_by.len)) + if (prob(75)) + var/obj/item/weapon/grab/G = pick(M.grabbed_by) + if (istype(G, /obj/item/weapon/grab)) + for(var/mob/O in viewers(M, null)) + O.show_message(text("\red [] has been pulled from []'s grip by []", G.affecting, G.assailant, src), 1) + //Foreach goto(354) + //G = null + del(G) + else + ok = 0 + if (locate(/obj/item/weapon/grab, M.grabbed_by.len)) + ok = 0 + if (ok) + var/t = M.pulling + M.pulling = null + step(src.pulling, get_dir(src.pulling.loc, T)) + M.pulling = t + else + step(src.pulling, get_dir(src.pulling.loc, T)) + else + src.pulling = null + . = ..() + if ((src.s_active && !( s_active in src.contents ) )) + src.s_active.close(src) return /mob/human/examine() @@ -2825,7 +2837,8 @@ /mob/human/Logout() - + if (src.droneTransitioning==1) + return if(config.logaccess) world.log << "LOGOUT: [src.key]" if (!( src.start )) //SN src = null @@ -2915,7 +2928,10 @@ return /mob/human/Login() - + if (src.droneTransitioning==1) + ..() + return + if(config.logaccess) world.log << "LOGIN: [src.key] from [src.client.address]" src.lastKnownIP = src.client.address @@ -2934,8 +2950,8 @@ world.log << "FURTHER NOTE: [M.lastKnownCKey] was banned." - src.client.screen -= main_hud.contents - src.client.screen -= main_hud2.contents + src.client.screenOrBackupRemove(main_hud.contents) + src.client.screenOrBackupRemove(main_hud2.contents) world.update_stat() if (!( src.hud_used )) src.hud_used = main_hud @@ -3041,9 +3057,6 @@ src.verbs += /proc/Vars src << text("\blue []", world_message) src << browse(text("[]", changes), "window=changes") - if (!( isturf(src.loc) )) - src.client.eye = src.loc - src.client.perspective = EYE_PERSPECTIVE if (!( src.start )) src.savefile_load() ShowChoices() @@ -3055,27 +3068,33 @@ //Foreach goto(1473) src.loc = pick(L) - + return /mob/human/Bump(atom/movable/AM as mob|obj, yes) - - spawn( 0 ) - if ((!( yes ) || src.now_pushing)) - return - ..() - if (!( istype(AM, /atom/movable) )) - return - if (!( src.now_pushing )) - src.now_pushing = 1 - if (!( AM.anchored )) - var/t = get_dir(src, AM) - step(AM, t) - src.now_pushing = null - return + spawn( 0 ) + if ((!( yes ) || src.now_pushing)) + return + ..() + src.PushingBump(AM, yes) return - + +/mob/proc/PushingBump(atom/movable/AM as mob|obj, yes) + if (!( istype(AM, /atom/movable) )) + return + if (!( src.now_pushing )) + src.now_pushing = 1 + if (!( AM.anchored )) + /* If it's a drone and walkable_not_pullable_drones is set, you CAN'T pull it. --shadowlord13 */ + if (!(istype(src, /mob/drone) && config.walkable_not_pullable_drones)) + var/t = get_dir(src, AM) + step(AM, t) + src.now_pushing = null + return + /mob/human/death() + if (src.currentDrone!=null) + src.currentDrone:releaseControl() if(src.healths) src.healths.icon_state = "health5" @@ -3087,7 +3106,7 @@ //src.icon_state = "dead" var/cancel for(var/mob/M in world) - if ((M.client && !( M.stat ))) + if ((M.cliented() && !( M.stat ))) cancel = 1 //Foreach goto(67) if (!( cancel )) @@ -3098,7 +3117,7 @@ spawn(50) cancel = 0 for(var/mob/M in world) - if ((M.client && !( M.stat ))) + if ((M.cliented() && !( M.stat ))) cancel = 1 //Foreach goto(67) if (!( cancel )) @@ -3123,7 +3142,10 @@ if (src.shoes.chained) tally += 15 else - tally += -1.0 + tally += -1.0 + if (src.pulling) + if (istype(src.pulling, /mob/drone)) + tally += 5 return tally @@ -3597,10 +3619,10 @@ if (src.eye_blurry > 0) src.eye_blurry-- src.eye_blurry = max(0, src.eye_blurry) - if (src.client) - src.client.screen -= main_hud.g_dither + if (src.hasClient()) + src.screenOrBackupRemove(main_hud.g_dither) if (src.stat!=2 && istype(src.wear_mask, /obj/item/weapon/clothing/mask/gasmask)) - src.client.screen += main_hud.g_dither + src.screenOrBackupAdd(main_hud.g_dither) if (istype(src.glasses, /obj/item/weapon/clothing/glasses/meson)) src.sight |= SEE_TURFS src.see_in_dark = 3 @@ -3658,30 +3680,31 @@ src.oxygen.icon_state = "oxy1" else src.oxygen.icon_state = "oxy0" - src.client.screen -= src.hud_used.blurry - src.client.screen -= src.hud_used.vimpaired + src.screenOrBackupRemove(src.hud_used.blurry) + src.screenOrBackupRemove(src.hud_used.vimpaired) if ((src.blind && src.stat != 2)) if (src.blinded) src.blind.layer = 18 else src.blind.layer = 0 if ((src.disabilities & 1 && !( istype(src.glasses, /obj/item/weapon/clothing/glasses/regular) ))) - src.client.screen -= src.hud_used.vimpaired - src.client.screen += src.hud_used.vimpaired + src.screenOrBackupRemove(src.hud_used.vimpaired) + src.screenOrBackupAdd(src.hud_used.vimpaired) else - src.client.screen -= src.hud_used.vimpaired + src.screenOrBackupRemove(src.hud_used.vimpaired) if (src.eye_blurry) - src.client.screen -= src.hud_used.blurry - src.client.screen += src.hud_used.blurry + src.screenOrBackupRemove(src.hud_used.blurry) + src.screenOrBackupAdd(src.hud_used.blurry) else - src.client.screen -= src.hud_used.blurry + src.screenOrBackupRemove(src.hud_used.blurry) if (src.stat != 2) - if (src.machine) - if (!( src.machine.check_eye(src) )) - src.reset_view(null) - else - if(!client.adminobs) - reset_view(null) + if (src.client) + if (src.machine) + if (!( src.machine.check_eye(src) )) + src.reset_view(null) + else + if(!client.adminobs) + reset_view(null) if (src.primary) src.primary.cleanup() src.UpdateClothing() @@ -3947,16 +3970,17 @@ return /mob/human/UpdateClothing() - + ..() if (src.monkeyizing) - return + return + if (!( src.w_uniform )) var/obj/item/weapon/W = src.r_store if (W) u_equip(W) - if (src.client) - src.client.screen -= W + if (src.hasClient()) + src.screenOrBackupRemove(W) if (W) W.loc = src.loc W.dropped(src) @@ -3964,8 +3988,8 @@ W = src.l_store if (W) u_equip(W) - if (src.client) - src.client.screen -= W + if (src.hasClient()) + src.screenOrBackupRemove(W) if (W) W.loc = src.loc W.dropped(src) @@ -3973,8 +3997,8 @@ W = src.wear_id if (W) u_equip(W) - if (src.client) - src.client.screen -= W + if (src.hasClient()) + src.screenOrBackupRemove(W) if (W) W.loc = src.loc W.dropped(src) @@ -3982,8 +4006,8 @@ W = src.belt if (W) u_equip(W) - if (src.client) - src.client.screen -= W + if (src.hasClient()) + src.screenOrBackupRemove(W) if (W) W.loc = src.loc W.dropped(src) @@ -4026,12 +4050,12 @@ src.w_uniform.screen_loc = "2,2" if (src.wear_id) src.overlays += image("icon" = 'mob.dmi', "icon_state" = text("id[]", (!( src.lying ) ? null : "2")), "layer" = MOB_LAYER) - if (src.client) - src.client.screen -= src.hud_used.other - src.client.screen -= src.hud_used.intents - src.client.screen -= src.hud_used.mov_int - if ((src.client && src.other)) - src.client.screen += src.hud_used.other + if (src.hasClient()) + src.screenOrBackupRemove(src.hud_used.other) + src.screenOrBackupRemove(src.hud_used.intents) + src.screenOrBackupRemove(src.hud_used.mov_int) + if ((src.hasClient() && src.other)) + src.screenOrBackupAdd(src.hud_used.other) if (src.gloves) var/t1 = src.gloves.s_istate if (!( t1 )) @@ -4094,16 +4118,16 @@ t1 = src.wear_mask.icon_state src.overlays += image("icon" = 'mob.dmi', "icon_state" = text("[][]", t1, (!( src.lying ) ? null : "2")), "layer" = MOB_LAYER) src.wear_mask.screen_loc = "2,3" - if (src.client) + if (src.hasClient()) if (src.i_select) if (src.intent) - src.client.screen += src.hud_used.intents + src.screenOrBackupAdd(src.hud_used.intents) src.i_select.screen_loc = src.intent else src.i_select.screen_loc = null if (src.m_select) if (src.m_int) - src.client.screen += src.hud_used.mov_int + src.screenOrBackupAdd(src.hud_used.mov_int) src.m_select.screen_loc = src.m_int else src.m_select.screen_loc = null @@ -4126,7 +4150,7 @@ src.hand = 0 drop_item() src.hand = h - if ((src.client && src.other)) + if ((src.hasClient() && src.other)) if (src.head) var/t1 = src.head.s_istate if (!( t1 )) @@ -4204,9 +4228,9 @@ src.overlays += image("icon" = 'mob.dmi', "icon_state" = "handcuff1", "layer" = MOB_LAYER) else src.overlays += image("icon" = 'mob.dmi', "icon_state" = "handcuff2", "layer" = MOB_LAYER) - if (src.client) - src.client.screen -= src.contents - src.client.screen += src.contents + if (src.hasClient()) + src.screenOrBackupRemove(src.contents) + src.screenOrBackupAdd(src.contents) var/shielded = 0 for(var/obj/item/weapon/shield/S in src) if (S.active) @@ -4271,7 +4295,7 @@ //Foreach goto(299) return for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) + if ((O.hasClient() && !( O.blinded ))) O.show_message(text("\red The monkey has bit []!", src), 1) //Foreach goto(344) var/damage = rand(1, 3) @@ -4287,7 +4311,7 @@ src.monkeyize() else for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) + if ((O.hasClient() && !( O.blinded ))) O.show_message(text("\red The monkey has attempted to bite []!", src), 1) //Foreach goto(580) return @@ -4351,36 +4375,90 @@ //Foreach goto(623) return -/mob/human/attack_hand(mob/human/M as mob) +/mob/human/attack_hand(mob/M as mob) if (!ticker) M << "You cannot attack people before the game has started." - return - if (M.a_intent == "help") - if (src.health > 0) - if (src.w_uniform) - src.w_uniform.add_fingerprint(M) - src.sleeping = 0 - src.resting = 0 - for(var/mob/O in viewers(src, null)) - O.show_message(text("\blue [] shakes [] trying to wake [] up!", M, src, src), 1) - //Foreach goto(80) - else - if (M.health >= -75.0) - if (((M.head && M.head.flags & 4) || ((M.wear_mask && !( M.wear_mask.flags & 32 )) || ((src.head && src.head.flags & 4) || (src.wear_mask && !( src.wear_mask.flags & 32 )))))) - M << "\blue Remove that mask!" - return - var/obj/equip_e/human/O = new /obj/equip_e/human( ) - O.source = M - O.target = src - O.s_loc = M.loc - O.t_loc = src.loc - O.place = "CPR" - src.requests += O - spawn( 0 ) - O.process() - return + return + + var/intentToApply = M.a_intent + var/aiControllingBonus = 0 + var/corruptedIntent = 0 + + if (istype(M, /mob/drone)) + var/mob/owner = M:controlledBy + if (owner!=null && istype(owner, /mob/ai)) + aiControllingBonus = 1 + else + if (M.a_intent=="help") + corruptedIntent = prob(50) + if (corruptedIntent) + if (prob(75)) //push down + intentToApply = "disarm" + else + intentToApply = "hurt" + else if (M.a_intent == "grab") + corruptedIntent = prob(50) + if (corruptedIntent) + if (prob(10)) //push down + intentToApply = "disarm" + else + intentToApply = "hurt" + else if (M.a_intent == "hurt") + corruptedIntent = prob(30) + if (corruptedIntent) + if (prob(20)) //push down + intentToApply = "disarm" + else + intentToApply = "grab" + else //disarm + corruptedIntent = prob(50) + if (corruptedIntent) + if (prob(50)) + M.client_mob() << "You tried to disarm them, but managed to miss entirely." + for(var/mob/O in viewers(src, null)) + O.show_message(text("\blue [] attempted to disarm [], but completely missed!", M, src), 1) + return + //otherwise we push them down + + if (intentToApply == "help") + if (istype(M, /mob/human)) + var/mob/human/H = M + if (src.health > 0) + if (src.w_uniform) + src.w_uniform.add_fingerprint(M) + src.sleeping = 0 + src.resting = 0 + for(var/mob/O in viewers(src, null)) + O.show_message(text("\blue [] shakes [] trying to wake [] up!", M, src, src), 1) + //Foreach goto(80) + else + if (M.health >= -75.0) + if (((H.head && H.head.flags & 4) || ((H.wear_mask && !( H.wear_mask.flags & 32 )) || ((src.head && src.head.flags & 4) || (src.wear_mask && !( src.wear_mask.flags & 32 )))))) + H.client_mob() << "\blue Remove that mask!" + return + var/obj/equip_e/human/O = new /obj/equip_e/human( ) + O.source = M + O.target = src + O.s_loc = M.loc + O.t_loc = src.loc + O.place = "CPR" + src.requests += O + spawn( 0 ) + O.process() + return + else if (istype(M, /mob/drone)) + if (src.health > 0) + if (src.w_uniform) + src.w_uniform.add_fingerprint(M) + src.sleeping = 0 + src.resting = 0 + for(var/mob/O in viewers(src, null)) + O.show_message(text("\blue [] shakes [] trying to wake [] up!", M, src, src), 1) + //Foreach goto(80) + else + M << "They need CPR, and you can't perform it through this drone!" else - if (M.a_intent == "grab") + if (intentToApply == "grab") if (M == src) return if (src.w_uniform) @@ -4400,92 +4478,104 @@ //Foreach goto(441) else if (M.stat < 2) - if (M.a_intent == "hurt") - if (src.w_uniform) - src.w_uniform.add_fingerprint(M) - var/damage = rand(1, 9) - var/obj/item/weapon/organ/external/affecting = src.organs["chest"] - var/t = M.zone_sel.selecting - if ((t in list( "hair", "eyes", "mouth", "neck" ))) - t = "head" - var/def_zone = ran_zone(t) - if (src.organs[text("[]", def_zone)]) - affecting = src.organs[text("[]", def_zone)] - if ((istype(affecting, /obj/item/weapon/organ/external) && prob(90))) - for(var/mob/O in viewers(src, null)) - O.show_message(text("\red [] has punched []!", M, src), 1) - //Foreach goto(646) - if (def_zone == "head") - if ((((src.head && src.head.brute_protect & 1) || (src.wear_mask && src.wear_mask.brute_protect & 1)) && prob(99))) - if (prob(20)) - affecting.take_damage(damage, 0) - else - src.show_message("\red You have been protected from a hit to the head.") - return - if (damage > 4.9) - if (src.weakened < 10) - src.weakened = rand(10, 15) - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] has weakened []!", M, src), 1, "\red You hear someone fall.", 2) - //Foreach goto(820) - affecting.take_damage(damage) - else - if (def_zone == "chest") - if ((((src.wear_suit && src.wear_suit.brute_protect & 2) || (src.w_uniform && src.w_uniform.brute_protect & 2)) && prob(85))) - src.show_message("\red You have been protected from a hit to the chest.") + if (intentToApply == "hurt") + if (istype(M, /mob/human)) + if (src.w_uniform) + src.w_uniform.add_fingerprint(M) + var/damage = rand(1, 9) + var/obj/item/weapon/organ/external/affecting = src.organs["chest"] + var/t = M.zone_sel.selecting + if ((t in list( "hair", "eyes", "mouth", "neck" ))) + t = "head" + var/def_zone = ran_zone(t) + if (src.organs[text("[]", def_zone)]) + affecting = src.organs[text("[]", def_zone)] + if ((istype(affecting, /obj/item/weapon/organ/external) && prob(90))) + for(var/mob/O in viewers(src, null)) + O.show_message(text("\red [] has punched []!", M, src), 1) + //Foreach goto(646) + if (def_zone == "head") + if ((((src.head && src.head.brute_protect & 1) || (src.wear_mask && src.wear_mask.brute_protect & 1)) && prob(99))) + if (prob(20)) + affecting.take_damage(damage, 0) + else + src.show_message("\red You have been protected from a hit to the head.") return if (damage > 4.9) - if (prob(50)) - if (src.weakened < 5) - src.weakened = 5 - for(var/mob/O in viewers(src, null)) - O.show_message(text("\red [] has knocked down []!", M, src), 1, "\red You hear someone fall.", 2) - //Foreach goto(993) - else - if (src.stunned < 5) - src.stunned = 5 - for(var/mob/O in viewers(src, null)) - O.show_message(text("\red [] has stunned []!", M, src), 1) - //Foreach goto(1063) - src.stat = 1 + if (src.weakened < 10) + src.weakened = rand(10, 15) + for(var/mob/O in viewers(M, null)) + O.show_message(text("\red [] has weakened []!", M, src), 1, "\red You hear someone fall.", 2) + //Foreach goto(820) affecting.take_damage(damage) else - if (def_zone == "diaper") - if ((((src.wear_suit && src.wear_suit.brute_protect & 4) || (src.w_uniform && src.w_uniform.brute_protect & 4)) && prob(75))) - src.show_message("\red You have been protected from a hit to the lower chest/diaper.") + if (def_zone == "chest") + if ((((src.wear_suit && src.wear_suit.brute_protect & 2) || (src.w_uniform && src.w_uniform.brute_protect & 2)) && prob(85))) + src.show_message("\red You have been protected from a hit to the chest.") return if (damage > 4.9) if (prob(50)) - if (src.weakened < 3) - src.weakened = 3 + if (src.weakened < 5) + src.weakened = 5 for(var/mob/O in viewers(src, null)) O.show_message(text("\red [] has knocked down []!", M, src), 1, "\red You hear someone fall.", 2) - //Foreach goto(1239) + //Foreach goto(993) else - if (src.stunned < 3) - src.stunned = 3 + if (src.stunned < 5) + src.stunned = 5 for(var/mob/O in viewers(src, null)) O.show_message(text("\red [] has stunned []!", M, src), 1) - //Foreach goto(1309) + //Foreach goto(1063) src.stat = 1 affecting.take_damage(damage) else - affecting.take_damage(damage) + if (def_zone == "diaper") + if ((((src.wear_suit && src.wear_suit.brute_protect & 4) || (src.w_uniform && src.w_uniform.brute_protect & 4)) && prob(75))) + src.show_message("\red You have been protected from a hit to the lower chest/diaper.") + return + if (damage > 4.9) + if (prob(50)) + if (src.weakened < 3) + src.weakened = 3 + for(var/mob/O in viewers(src, null)) + O.show_message(text("\red [] has knocked down []!", M, src), 1, "\red You hear someone fall.", 2) + //Foreach goto(1239) + else + if (src.stunned < 3) + src.stunned = 3 + for(var/mob/O in viewers(src, null)) + O.show_message(text("\red [] has stunned []!", M, src), 1) + //Foreach goto(1309) + src.stat = 1 + affecting.take_damage(damage) + else + affecting.take_damage(damage) - src.UpdateDamageIcon() + src.UpdateDamageIcon() - src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.bruteloss - else - for(var/mob/O in viewers(src, null)) - O.show_message(text("\red [] has attempted to punch []!", M, src), 1) - //Foreach goto(1419) - return + src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.bruteloss + else + for(var/mob/O in viewers(src, null)) + O.show_message(text("\red [] has attempted to punch []!", M, src), 1) + //Foreach goto(1419) + return + else if (istype(M, /mob/drone)) + var/damage = 0 + if (corruptedIntent) + damage = rand(0, 5) + else + damage = rand(5, 14) + for(var/mob/O in viewers(src, null)) + O.show_message(text("\red [] has smacked [] with its arm!", M, src), 1) + if (corruptedIntent) + M << "Oops! You've accidentally hit them." + src.damage_anywhere(damage) else if (!( src.lying )) if (src.w_uniform) src.w_uniform.add_fingerprint(M) var/randn = rand(1, 100) - if (randn <= 25) + if (randn <= 25 || corruptedIntent) src.weakened = 2 for(var/mob/O in viewers(src, null)) O.show_message(text("\red [] has pushed down []!", M, src), 1) @@ -4499,7 +4589,12 @@ else for(var/mob/O in viewers(src, null)) O.show_message(text("\red [] has attempted to disarm []!", M, src), 1) - //Foreach goto(1643) + //Foreach goto(1643) + if (corruptedIntent) + if (M.a_intent == "help") + M.client_mob() << "You failed to help [src] due to poor control over the drone, and may have knocked \him down, but at least you have not hurt \him." + else if (M.a_intent == "grab") + M.client_mob() << "You failed to grab [src] due to poor control over the drone, and may have knocked \him down, but at least you have not hurt \him." return // loads the savefile corresponding to the mob's ckey @@ -4740,10 +4835,11 @@ return /mob/human/show_inv(mob/user as mob) + user.machine = src - // Fix added for Bug #1986988. - var/dat = text("
    \n[]\n\tHead(Mask): []\n\t\tHeadset: []\n\tLeft Hand: []\n\tRight Hand: []\n\tGloves: []\n\tEyes: []\n\tEars: []\n\tHead: []\n\tShoes: []\n\tBelt: []\n\tUniform: []\n\t(Exo)Suit: []\n\tBack: [] []\n\tID: []\n\t[]\n\t[]\n\tEmpty Pockets\nClose\n
    ", src.name, src, (src.wear_mask ? text("[]", src.wear_mask) : "Nothing"), src, (src.w_radio ? text("[]", src.w_radio) : "Nothing"), src, (src.l_hand ? text("[]", src.l_hand) : "Nothing"), src, (src.r_hand ? text("[]", src.r_hand) : "Nothing"), src, (src.gloves ? text("[]", src.gloves) : "Nothing"), src, (src.glasses ? text("[]", src.glasses) : "Nothing"), src, (src.ears ? text("[]", src.ears) : "Nothing"), src, (src.head ? text("[]", src.head) : "Nothing"), src, (src.shoes ? text("[]", src.shoes) : "Nothing"), src, (src.belt ? text("[]", src.belt) : "Nothing"), src, (src.w_uniform ? text("[]", src.w_uniform) : "Nothing"), src, (src.wear_suit ? text("[]", src.wear_suit) : "Nothing"), src, (src.back ? text("[]", src.back) : "Nothing"), ((istype(src.wear_mask, /obj/item/weapon/clothing/mask) && istype(src.back, /obj/item/weapon/tank) && !( src.internal )) ? text(" Set Internal", src) : ""), src, (src.wear_id ? text("[]", src.wear_id) : "Nothing"), (src.handcuffed ? text("Handcuffed", src) : text("Not Handcuffed", src)), (src.internal ? text("Remove Internal", src) : ""), src, user, html_encode(src.name)) + var/dat = text("
    \n[]\n\tHead(Mask): []\n\t\tHeadset: []\n\tLeft Hand: []\n\tRight Hand: []\n\tGloves: []\n\tEyes: []\n\tEars: []\n\tHead: []\n\tShoes: []\n\tBelt: []\n\tUniform: []\n\t(Exo)Suit: []\n\tBack: [] []\n\tID: []\n\t[]\n\t[]\n\tEmpty Pockets\nClose\n
    ", src.name, src, (src.wear_mask ? text("[]", src.wear_mask) : "Nothing"), src, (src.w_radio ? text("[]", src.w_radio) : "Nothing"), src, (src.l_hand ? text("[]", src.l_hand) : "Nothing"), src, (src.r_hand ? text("[]", src.r_hand) : "Nothing"), src, (src.gloves ? text("[]", src.gloves) : "Nothing"), src, (src.glasses ? text("[]", src.glasses) : "Nothing"), src, (src.ears ? text("[]", src.ears) : "Nothing"), src, (src.head ? text("[]", src.head) : "Nothing"), src, (src.shoes ? text("[]", src.shoes) : "Nothing"), src, (src.belt ? text("[]", src.belt) : "Nothing"), src, (src.w_uniform ? text("[]", src.w_uniform) : "Nothing"), src, (src.wear_suit ? text("[]", src.wear_suit) : "Nothing"), src, (src.back ? text("[]", src.back) : "Nothing"), ((istype(src.wear_mask, /obj/item/weapon/clothing/mask) && istype(src.back, /obj/item/weapon/tank) && !( src.internal )) ? text(" Set Internal", src) : ""), src, (src.wear_id ? text("[]", src.wear_id) : "Nothing"), (src.handcuffed ? text("Handcuffed", src) : text("Not Handcuffed", src)), (src.internal ? text("Remove Internal", src) : ""), src, user, src.name) user << browse(dat, text("window=mob[];size=300x600", html_encode(src.name))) + return /mob/proc/show_message(msg, type, alt, alt_type) @@ -4762,7 +4858,7 @@ type = alt_type if ((type & 1 && src.sdisabilities & 1)) return - src << msg + src.client_mob() << msg return /mob/proc/findname(msg) @@ -4826,8 +4922,7 @@ var/obj/item/weapon/W = src.equipped() if (W) u_equip(W) - if (src.client) - src.client.screen -= W + src.eitherScreenRemove(W) if (usr.stat) return W.loc = src.loc @@ -4880,8 +4975,7 @@ var/obj/item/weapon/W = src.equipped() if (W) u_equip(W) - if (src.client) - src.client.screen -= W + src.eitherScreenRemove(W) if (W) W.loc = src.loc W.dropped(src) @@ -4890,7 +4984,8 @@ return /mob/proc/reset_view(atom/A) - + if (src.currentDrone!=null) + A = src.currentDrone if (src.client) if (istype(A, /atom/movable)) src.client.perspective = EYE_PERSPECTIVE @@ -4910,9 +5005,9 @@ var/total = 0 usr << "Current Players:" for(var/mob/M in world) - if (M.client) + if (M.cliented()) total++ - usr << text("\t [] ([]) []", M, M.client, M.health) + usr << text("\t [] ([]) []", M, M.cliented(), M.health) //Foreach goto(32) usr << text("Total Players: []", total) return @@ -4938,7 +5033,7 @@ user.machine = src var/dat = text("\n[]
    \n\tHead(Mask): []
    \n\tLeft Hand: []
    \n\tRight Hand: []
    \n\tBack: []
    \n\t[]
    \n\t[]
    \n\t[]
    \n\tEmpty Pockets
    \nClose
    \n
    ", src.name, src, (src.wear_mask ? text("[]", src.wear_mask) : "Nothing"), src, (src.l_hand ? text("[]", src.l_hand) : "Nothing"), src, (src.r_hand ? text("[]", src.r_hand) : "Nothing"), src, (src.back ? text("[]", src.back) : "Nothing"), ((istype(src.wear_mask, /obj/item/weapon/clothing/mask) && istype(src.back, /obj/item/weapon/tank) && !( src.internal )) ? text(" Set Internal", src) : ""), (src.internal ? text("Remove Internal", src) : ""), (src.handcuffed ? text("Handcuffed", src) : text("Not Handcuffed", src)), src, user, src.name) - user << browse(dat, text("window=mob[]", src.name)) + user << browse(dat, text("window=mob[]", html_encode(src.name))) return /mob/proc/u_equip(W as obj) @@ -5113,9 +5208,9 @@ /mob/proc/boot(mob/M as mob in world, txt as text) set category = "Admin" - if ((M && M.client && txt)) + if ((M && M.hasClient() && txt)) //M.client = null - del(M.client) + del(M.alwaysClient()) if(config.logadmin) world.log << text("ADMIN: [] booted []/[].", src.key,M,M.key) return @@ -5123,10 +5218,10 @@ /mob/proc/ban(mob/M as mob in world, txt as text) set category = "Admin" - if ((M && M.client && txt)) + if ((M && M.hasClient() && txt)) banned += M.ckey //M.client = null - del(M.client) + del(M.alwaysClient()) if(config.logadmin) world.log << text("ADMIN: [] banned []/[].", src.key,M,M.key) return @@ -5179,6 +5274,8 @@ del(O) //Foreach goto(20) var/mob/monkey/O = new /mob/monkey( M.loc ) + if (M.currentDrone!=null) + M.currentDrone:releaseControl(0) M.client.mob = O O.loc = M.loc //M = null @@ -5486,8 +5583,6 @@ return /mob/verb/switch_hud() - if (istype(src, /mob/ai)) - return src.client.screen -= main_hud.contents src.client.screen -= main_hud2.contents if (src.hud_used == main_hud) @@ -5527,18 +5622,52 @@ src << "If you had changed the HUD before the game started, your savefile would be updated to remember that you prefer that HUD." src.client.screen -= src.hud_used.adding src.client.screen += src.hud_used.adding - return - + return + /mob/Login() if(ticker && master_mode == "sandbox" && src.sandbox==null) src.CanBuild() src.sight |= SEE_SELF - ..() + if (CanAdmin()) + if (src.droneTransitioning==0) + src << text("\blue The game ip is byond://[]:[] !", world.address, world.port) + src.verbs += /mob/proc/mute + src.verbs += /mob/proc/changemessage + src.verbs += /mob/proc/boot + src.verbs += /mob/proc/changemode + src.verbs += /mob/proc/restart + src.verbs += /mob/proc/who + src.verbs += /mob/proc/change_name + src.verbs += /mob/proc/show_help + src.verbs += /mob/proc/toggle_ooc + src.verbs += /mob/proc/toggle_abandon + src.verbs += /mob/proc/toggle_enter + src.verbs += /mob/proc/toggle_ai + src.verbs += /mob/proc/toggle_shuttle + src.verbs += /mob/proc/delay_start + src.verbs += /mob/proc/start_now + src.verbs += /mob/proc/worldsize + src.verbs += /mob/proc/make_gift + src.verbs += /mob/proc/make_flag + src.verbs += /mob/proc/make_pill + src.verbs += /mob/proc/show_ctf + src.verbs += /mob/proc/ban + src.verbs += /mob/proc/unban + src.verbs += /mob/proc/secrets + src.verbs += /mob/proc/carboncopy + src.verbs += /mob/proc/toggle_alter + src.verbs += /mob/proc/list_dna + src.verbs += /proc/Vars + + ..() return /mob/CheckPass(mob/M as mob) if (istype(M, /mob)) //BYOND calls functions even when the passed parameters are not the specified types + if (config.walkable_not_pullable_drones) + if (istype(src, /mob) && (istype(src, /mob/drone) ^ istype(M, /mob/drone))) + return 1 if ((src.other_mobs && ismob(M) && M.other_mobs)) return 1 else @@ -5675,8 +5804,8 @@ src.overlays += image("icon" = 'l_items.dmi', "icon_state" = t1, "layer" = src.layer) src.l_hand.screen_loc = "3,2" if (src.client) - src.client.screen -= src.contents - src.client.screen += src.contents + src.client.screenOrBackupRemove(src.contents) + src.client.screenOrBackupAdd(src.contents) return /mob/ghost/Life() @@ -5829,20 +5958,11 @@ return /mob/monkey/Bump(atom/movable/AM as mob|obj, yes) - - spawn( 0 ) - if ((!( yes ) || src.now_pushing)) - return - ..() - if (!( istype(AM, /atom/movable) )) - return - if (!( src.now_pushing )) - src.now_pushing = 1 - if (!( AM.anchored )) - var/t = get_dir(src, AM) - step(AM, t) - src.now_pushing = null - return + spawn( 0 ) + if ((!( yes ) || src.now_pushing)) + return + ..() + src.PushingBump(AM, yes) return /mob/monkey/Topic(href, href_list) @@ -5850,7 +5970,7 @@ if (href_list["mach_close"]) var/t1 = text("window=[]", href_list["mach_close"]) src.machine = null - src << browse(null, t1) + src.client_mob() << browse(null, t1) if ((href_list["item"] && !( usr.stat ) && !( usr.restrained() ) && get_dist(src, usr) <= 1)) var/obj/equip_e/monkey/O = new /obj/equip_e/monkey( ) O.source = usr @@ -5944,41 +6064,96 @@ return /mob/monkey/attack_hand(mob/M as mob) - - if (M.a_intent == "help") + if (!ticker) + M << "You cannot attack people before the game has started." + return + var/intentToApply = M.a_intent + var/aiControllingBonus = 0 + var/corruptedIntent = 0 + + if (istype(M, /mob/drone)) + var/mob/owner = M:controlledBy + if (owner!=null && istype(owner, /mob/ai)) + aiControllingBonus = 1 + else + if (M.a_intent=="help") + corruptedIntent = prob(50) + if (corruptedIntent) + if (prob(75)) //push down + intentToApply = "disarm" + else + intentToApply = "hurt" + else if (M.a_intent == "grab") + corruptedIntent = prob(50) + if (corruptedIntent) + if (prob(10)) //push down + intentToApply = "disarm" + else + intentToApply = "hurt" + else if (M.a_intent == "hurt") + corruptedIntent = prob(30) + if (corruptedIntent) + if (prob(20)) //push down + intentToApply = "disarm" + else + intentToApply = "grab" + else //disarm + corruptedIntent = prob(50) + if (corruptedIntent) + if (prob(50)) + M.client_mob() << "You tried to disarm them, but managed to miss entirely." + for(var/mob/O in viewers(src, null)) + O.show_message(text("\blue [] attempted to disarm [], but completely missed!", M, src), 1) + return + //otherwise we push them down + + if (intentToApply == "help") src.sleeping = 0 src.resting = 0 for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) + if ((O.hasClient() && !( O.blinded ))) O.show_message(text("\blue [] shakes the monkey trying to wake him up!", M), 1) //Foreach goto(47) else - if (M.a_intent == "hurt") - if ((prob(75) && src.health > 0)) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has punched the monkey!", M), 1) - //Foreach goto(135) - var/damage = rand(5, 10) - if (prob(40)) - damage = rand(10, 15) - if (src.paralysis < 5) - src.paralysis = rand(10, 15) - spawn( 0 ) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has knocked out the monkey!", M), 1) - //Foreach goto(248) - return - src.bruteloss += damage + if (intentToApply == "hurt") + if (istype(M, /mob/human)) + if ((prob(75) && src.health > 0)) + for(var/mob/O in viewers(src, null)) + if ((O.hasClient() && !( O.blinded ))) + O.show_message(text("\red [] has punched the monkey!", M), 1) + //Foreach goto(135) + var/damage = rand(5, 10) + if (prob(40)) + damage = rand(10, 15) + if (src.paralysis < 5) + src.paralysis = rand(10, 15) + spawn( 0 ) + for(var/mob/O in viewers(src, null)) + if ((O.hasClient() && !( O.blinded ))) + O.show_message(text("\red [] has knocked out the monkey!", M), 1) + //Foreach goto(248) + return + src.bruteloss += damage + src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.bruteloss + else + for(var/mob/O in viewers(src, null)) + if ((O.hasClient() && !( O.blinded ))) + O.show_message(text("\red [] has attempted to punch the monkey!", M), 1) + //Foreach goto(336) + else if (istype(M, /mob/drone)) + var/damage = 0 + if (corruptedIntent) + damage = rand(0, 5) + else + damage = rand(5, 14) + for(var/mob/O in viewers(src, null)) + O.show_message(text("\red [] has smacked the monkey!", M), 1) + if (corruptedIntent) + M << "Oops! You've accidentally hit them." + src.bruteloss += damage src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.bruteloss - else - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O.show_message(text("\red [] has attempted to punch the monkey!", M), 1) - //Foreach goto(336) else - if (M.a_intent == "grab") + if (intentToApply == "grab") if (M == src) return var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M ) @@ -5996,18 +6171,24 @@ //Foreach goto(502) else if (!( src.paralysis )) - if (prob(25)) + if (prob(25) || corruptedIntent) src.paralysis = 2 for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) + if ((O.hasClient() && !( O.blinded ))) O.show_message(text("\red [] has pushed down the monkey!", M), 1) //Foreach goto(571) else drop_item() for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) + if ((O.hasClient() && !( O.blinded ))) O.show_message(text("\red [] has disarmed the monkey!", M), 1) - //Foreach goto(638) + //Foreach goto(638) + + if (corruptedIntent) + if (M.a_intent == "help") + M.client_mob() << "You failed to help [src] due to poor control over the drone, and may have knocked \him down, but at least you have not hurt \him." + else if (M.a_intent == "grab") + M.client_mob() << "You failed to grab [src] due to poor control over the drone, and may have knocked \him down, but at least you have not hurt \him." return @@ -6062,25 +6243,25 @@ src.overlays += image("icon" = 'monkey.dmi', "icon_state" = "handcuff1", "layer" = src.layer) else src.overlays += image("icon" = 'monkey.dmi', "icon_state" = "handcuff2", "layer" = src.layer) - if (src.client) - src.client.screen -= src.contents - src.client.screen += src.contents - src.client.screen -= src.hud_used.m_ints - src.client.screen -= src.hud_used.mov_int + if (src.hasClient()) + src.screenOrBackupRemove(src.contents) + src.screenOrBackupAdd(src.contents) + src.screenOrBackupRemove(src.hud_used.m_ints) + src.screenOrBackupRemove(src.hud_used.mov_int) if (src.i_select) if (src.intent) - src.client.screen += src.hud_used.m_ints + src.screenOrBackupAdd(src.hud_used.m_ints) src.i_select.screen_loc = src.intent else src.i_select.screen_loc = null if (src.m_select) if (src.m_int) - src.client.screen += src.hud_used.mov_int + src.screenOrBackupAdd(src.hud_used.mov_int) src.m_select.screen_loc = src.m_int else src.m_select.screen_loc = null for(var/mob/M in viewers(1, src)) - if ((M.client && M.machine == src)) + if ((M.hasClient() && M.machine == src)) spawn( 0 ) src.show_inv(M) return @@ -6088,12 +6269,15 @@ return /mob/monkey/Login() - + if (src.droneTransitioning==1) + ..() + return + if (banned.Find(src.ckey)) //src.client = null del(src.client) - src.client.screen -= main_hud.contents - src.client.screen -= main_hud2.contents + src.client.screenOrBackupRemove(main_hud.contents) + src.client.screenOrBackupRemove(main_hud2.contents) if (!( src.hud_used )) src.hud_used = main_hud src.next_move = 1 @@ -6113,7 +6297,8 @@ src.hands = new /obj/screen( null ) src.sleep = new /obj/screen( null ) src.rest = new /obj/screen( null ) - ..() + + ..() UpdateClothing() src.oxygen.icon_state = "oxy0" src.i_select.icon_state = "selector" @@ -6163,12 +6348,12 @@ src.sleep.layer = 20 src.rest.layer = 20 src.client.screen.len = null - src.client.screen -= list( src.oxygen, src.i_select, src.m_select, src.toxin, src.internals, src.fire, src.hands, src.healths, src.pullin, src.blind, src.flash, src.rest, src.sleep, src.mach ) - src.client.screen += list( src.oxygen, src.i_select, src.m_select, src.toxin, src.internals, src.fire, src.hands, src.healths, src.pullin, src.blind, src.flash, src.rest, src.sleep, src.mach ) - src.client.screen -= src.hud_used.adding - src.client.screen += src.hud_used.adding - src.client.screen -= src.hud_used.mon_blo - src.client.screen += src.hud_used.mon_blo + src.client.screenOrBackupRemove(list( src.oxygen, src.i_select, src.m_select, src.toxin, src.internals, src.fire, src.hands, src.healths, src.pullin, src.blind, src.flash, src.rest, src.sleep, src.mach )) + src.client.screenOrBackupAdd(list( src.oxygen, src.i_select, src.m_select, src.toxin, src.internals, src.fire, src.hands, src.healths, src.pullin, src.blind, src.flash, src.rest, src.sleep, src.mach )) + src.client.screenOrBackupRemove(src.hud_used.adding) + src.client.screenOrBackupAdd(src.hud_used.adding) + src.client.screenOrBackupRemove(src.hud_used.mon_blo) + src.client.screenOrBackupAdd(src.hud_used.mon_blo) if (!( src.primary )) var/t1 = rand(1000, 1500) dna_ident += t1 @@ -6222,44 +6407,16 @@ src.loc = pick(L) //src << browse('help.htm', "window=help") - if (CanAdmin()) - src << text("\blue The game ip is byond://[]:[] !", world.internet_address, world.port) - src.verbs += /mob/proc/mute - src.verbs += /mob/proc/changemessage - src.verbs += /mob/proc/boot - src.verbs += /mob/proc/changemode - src.verbs += /mob/proc/show_ctf - src.verbs += /mob/proc/restart - src.verbs += /mob/proc/who - src.verbs += /mob/proc/change_name - src.verbs += /mob/proc/show_help - src.verbs += /mob/proc/toggle_ooc - src.verbs += /mob/proc/toggle_abandon - src.verbs += /mob/proc/toggle_enter - src.verbs += /mob/proc/toggle_ai - src.verbs += /mob/proc/toggle_shuttle - src.verbs += /mob/proc/delay_start - src.verbs += /mob/proc/start_now - src.verbs += /mob/proc/worldsize - src.verbs += /mob/proc/make_gift - src.verbs += /mob/proc/make_flag - src.verbs += /mob/proc/make_pill - src.verbs += /mob/proc/ban - src.verbs += /mob/proc/unban - src.verbs += /mob/proc/secrets - src.verbs += /mob/proc/toggle_alter - src.verbs += /mob/proc/carboncopy - src.verbs += /mob/proc/list_dna - src.verbs += /proc/Vars src << text("\blue []", world_message) - if (!( isturf(src.loc) )) - src.client.eye = src.loc - src.client.perspective = EYE_PERSPECTIVE + if (src.loc!=null && (!( isturf(src.loc) ))) + src.client.eye = src.loc + src.client.perspective = EYE_PERSPECTIVE src.name = text("monkey ([])", copytext(md5(src.primary.uni_identity), 2, 6)) return - + +/* This code is not identical to the code in /mob/human/Move or /mob/drone/Move, but it is similar. It lacks some things, it appears. --shadowlord13 */ /mob/monkey/Move() - + if ((!( src.buckled ) || src.buckled.loc != src.loc)) src.buckled = null if (src.buckled) @@ -6274,6 +6431,8 @@ //Foreach goto(93) if ((t7 && src.pulling && get_dist(src, src.pulling) <= 1)) if (src.pulling.anchored) + src.pulling = null + if (istype(src.pulling, /mob/drone) && config.walkable_not_pullable_drones) src.pulling = null var/T = src.loc . = ..() @@ -6302,6 +6461,8 @@ return /mob/monkey/death() + if (src.currentDrone!=null) + src.currentDrone:releaseControl() var/cancel if (src.healths) @@ -6314,7 +6475,7 @@ src.rname = "[src.rname] (Dead)" //src.icon_state = "dead" for(var/mob/M in world) - if ((M.client && !( M.stat ))) + if ((M.cliented() && !( M.stat ))) cancel = 1 //Foreach goto(79) if (!( cancel )) @@ -6640,10 +6801,10 @@ if (src.eye_blurry > 0) src.eye_blurry-- src.eye_blurry = max(0, src.eye_blurry) - if (src.client) - src.client.screen -= main_hud.g_dither + if (src.hasClient()) + src.screenOrBackupRemove(main_hud.g_dither) if (src.stat!=2 && istype(src.wear_mask, /obj/item/weapon/clothing/mask/gasmask)) - src.client.screen += main_hud.g_dither + src.screenOrBackupAdd(main_hud.g_dither) if (src.mach) if (src.machine) src.mach.icon_state = "mach1" @@ -6690,18 +6851,18 @@ src.oxygen.icon_state = "oxy1" else src.oxygen.icon_state = "oxy0" - src.client.screen -= src.hud_used.blurry - src.client.screen -= src.hud_used.vimpaired + src.screenOrBackupRemove(src.hud_used.blurry) + src.screenOrBackupRemove(src.hud_used.vimpaired) if ((src.blind && src.stat != 2)) if (src.blinded) src.blind.layer = 18 else src.blind.layer = 0 if (src.eye_blurry) - src.client.screen -= src.hud_used.blurry - src.client.screen += src.hud_used.blurry + src.screenOrBackupRemove(src.hud_used.blurry) + src.screenOrBackupAdd(src.hud_used.blurry) else - src.client.screen -= src.hud_used.blurry + src.screenOrBackupRemove(src.hud_used.blurry) if (src.stat != 2) if (src.machine) if (!( src.machine.check_eye(src) )) @@ -6709,7 +6870,7 @@ else reset_view(null) - else + else if (!hasClient()) if ((src.canmove && prob(10) && isturf(src.loc))) step(src, pick(NORTH, SOUTH, EAST, WEST)) if (prob(10)) @@ -6764,7 +6925,7 @@ /mob/monkey/proc/firecheck(turf/T as turf) - if (T.firelevel < 900000.0) + if (T.firelevel < config.min_gas_for_fire) return 0 var/total = 0 if (src.wear_mask) @@ -7044,8 +7205,10 @@ if (!( usr )) return - if (!( src.anchored )) - usr.pulling = src + if (!( src.anchored )) + /* If it's a drone and walkable_not_pullable_drones is set, you CAN'T pull it. --shadowlord13 */ + if (!(istype(src, /mob/drone) && config.walkable_not_pullable_drones)) + usr.pulling = src return /atom/verb/examine() @@ -7100,16 +7263,26 @@ return if (src.mob.monkeyizing) return - var/is_monkey = istype(src.mob, /mob/monkey) - if (locate(/obj/item/weapon/grab, locate(/obj/item/weapon/grab, src.mob.grabbed_by.len))) + var/mob/thisMob = src.mob + var/is_monkey = istype(thisMob, /mob/monkey) + + //Change thisMob and n if they're using a drone and their current mob is not the drone (normally it would be, but in case we add future things that the user's client doesn't transfer to, this code will activate for it) + if (thisMob.currentDrone!=null) + thisMob = thisMob.currentDrone + if (istype(thisMob.loc, /turf)) + n = get_step(thisMob.loc, direct) + else + n = null + + if (locate(/obj/item/weapon/grab, locate(/obj/item/weapon/grab, thisMob.grabbed_by.len))) var/list/grabbing = list( ) - if (istype(src.mob.l_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = src.mob.l_hand + if (istype(thisMob.l_hand, /obj/item/weapon/grab)) + var/obj/item/weapon/grab/G = thisMob.l_hand grabbing += G.affecting - if (istype(src.mob.r_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = src.mob.r_hand + if (istype(thisMob.r_hand, /obj/item/weapon/grab)) + var/obj/item/weapon/grab/G = thisMob.r_hand grabbing += G.affecting - for(var/obj/item/weapon/grab/G in src.mob.grabbed_by) + for(var/obj/item/weapon/grab/G in thisMob.grabbed_by) if (G.state == 1) if (!( grabbing.Find(G.assailant) )) //G = null @@ -7118,8 +7291,8 @@ if (G.state == 2) src.move_delay = world.time + 10 if ((prob(25) && (!( is_monkey ) || prob(25)))) - for(var/mob/O in viewers(src.mob, null)) - O.show_message(text("\red [] has broken free of []'s grip!", src.mob, G.assailant), 1) + for(var/mob/O in viewers(thisMob, null)) + O.show_message(text("\red [] has broken free of []'s grip!", thisMob, G.assailant), 1) //Foreach goto(309) //G = null del(G) @@ -7129,28 +7302,28 @@ if (G.state == 2) src.move_delay = world.time + 10 if ((prob(5) && !( is_monkey ) || prob(25))) - for(var/mob/O in viewers(src.mob, null)) - O.show_message(text("\red [] has broken free of []'s headlock!", src.mob, G.assailant), 1) + for(var/mob/O in viewers(thisMob, null)) + O.show_message(text("\red [] has broken free of []'s headlock!", thisMob, G.assailant), 1) //Foreach goto(423) //G = null del(G) else return //Foreach goto(189) - if (src.mob.canmove) + if (thisMob.canmove) - if(src.mob.m_intent == "face") - src.mob.dir = direct + if(thisMob.m_intent == "face") + thisMob.dir = direct var/j_pack = 0 - if ((istype(src.mob.loc, /turf/space) && !( locate(/obj/move, src.mob.loc) ))) - if (!( src.mob.restrained() )) - if (!( (locate(/obj/grille, oview(1, src.mob)) || locate(/turf/station, oview(1, src.mob))) )) - if (istype(src.mob.back, /obj/item/weapon/tank/jetpack)) - var/obj/item/weapon/tank/jetpack/J = src.mob.back - j_pack = J.allow_thrust(100, src.mob) + if ((istype(thisMob.loc, /turf/space) && !( locate(/obj/move, thisMob.loc) ))) + if (!( thisMob.restrained() )) + if (!( (locate(/obj/grille, oview(1, thisMob)) || locate(/turf/station, oview(1, thisMob))) )) + if (istype(thisMob.back, /obj/item/weapon/tank/jetpack)) + var/obj/item/weapon/tank/jetpack/J = thisMob.back + j_pack = J.allow_thrust(100, thisMob) if(j_pack) - var/obj/effects/sparks/ion_trails/I = new /obj/effects/sparks/ion_trails( src.mob.loc ) + var/obj/effects/sparks/ion_trails/I = new /obj/effects/sparks/ion_trails( thisMob.loc ) flick("ion_fade", I) I.icon_state = "blank" spawn( 20 ) @@ -7165,54 +7338,54 @@ return 0 - if (isturf(src.mob.loc)) + if (isturf(thisMob.loc)) src.move_delay = world.time if ((j_pack && j_pack < 1)) src.move_delay += 5 - switch(src.mob.m_intent) + switch(thisMob.m_intent) if("run") - if (src.mob.drowsyness > 0) + if (thisMob.drowsyness > 0) src.move_delay += 6 src.move_delay += 1 if("face") - src.mob.dir = direct + thisMob.dir = direct return if("walk") src.move_delay += 7 - src.move_delay += src.mob.m_delay() + src.move_delay += thisMob.m_delay() - src.move_delay += round((100 - src.mob.health) / 20) //*****RM fix + src.move_delay += round((100 - thisMob.health) / 20) //*****RM fix - if (src.mob.restrained()) - for(var/mob/M in range(src.mob, 1)) - if (((M.pulling == src.mob && (!( M.restrained() ) && M.stat == 0)) || locate(/obj/item/weapon/grab, src.mob.grabbed_by.len))) + if (thisMob.restrained()) + for(var/mob/M in range(thisMob, 1)) + if (((M.pulling == thisMob && (!( M.restrained() ) && M.stat == 0)) || locate(/obj/item/weapon/grab, thisMob.grabbed_by.len))) src << "\blue You're restrained! You can't move!" return 0 //Foreach goto(853) src.moving = 1 - if (locate(/obj/item/weapon/grab, src.mob)) + if (locate(/obj/item/weapon/grab, thisMob)) src.move_delay = max(src.move_delay, world.time + 7) - var/list/L = src.mob.ret_grab() + var/list/L = thisMob.ret_grab() if (istype(L, /list)) if (L.len == 2) - L -= src.mob + L -= thisMob var/mob/M = L[1] - if ((get_dist(src.mob, M) <= 1 || M.loc == src.mob.loc)) - var/turf/T = src.mob.loc + if ((get_dist(thisMob, M) <= 1 || M.loc == thisMob.loc)) + var/turf/T = thisMob.loc . = ..() if (isturf(M.loc)) - var/diag = get_dir(src.mob, M) + var/diag = get_dir(thisMob, M) if ((diag - 1) & diag) else diag = null - if ((get_dist(src.mob, M) > 1 || diag)) + if ((get_dist(thisMob, M) > 1 || diag)) step(M, get_dir(M.loc, T)) else for(var/mob/M in L) M.other_mobs = 1 - if (src.mob != M) + if (thisMob != M) M.animate_movement = 3 //Foreach goto(1163) for(var/mob/M in L) @@ -7225,20 +7398,22 @@ return //Foreach goto(1214) else - . = ..() + //This should be equivalent to . = ..() when thisMob is src.mob, but should make moving thisMob work when thisMob is not src.mob. -shadowlord13 + walk(thisMob, 0) + . = thisMob.Move(n, direct) src.moving = null return . else - if (isobj(src.mob.loc)) - var/obj/O = src.mob.loc - if (src.mob.canmove) - return O.relaymove(src.mob, direct) + if (isobj(thisMob.loc)) + var/obj/O = thisMob.loc + if (thisMob.canmove) + return O.relaymove(thisMob, direct) else return return /client/proc/show_panel() - set name = "Administrator Panel" + set name = "Admin Panel" if (src.holder) src.holder.update() @@ -7298,3 +7473,120 @@ //src.holder = null del(src.holder) return + +/client/Topic(href, href_list[], hsrc) + //Checking for us using a drone without the drone being our client's mob (won't happen unless we add things which are remote-controlled without the user's client transferring), and changing usr to the drone if so + src << "client/Topic(href is ([href]) href_list is ([href_list]) hsrc is ([hsrc])." + if (src.mob!=null) + src << "src.mob is [src.mob]." + if (src.mob.currentDrone!=null) + if (!istype(src.mob.currentDrone:equipped(), /obj/item/weapon/drone/aiInterface)) + src << "src.mob.currentDrone is [src.mob.currentDrone]. Setting usr." + usr = src.mob.currentDrone + src << "usr is [usr]." + ..() + +/* The primary purpose of client/proc/screenOrBackup, client/proc/screenOrBackupAdd, client/proc/screenOrBackupRemove, and mob/proc/client_mob (and overloaded mob/somesubclass/client_mob) is to provide a single point of change if, in the future, we need the capability to have a mob remote-controlling another mob or object without the mob's client being changed, if we want the client to have only HUD icons related to the thing they are controlling, without stopping their actual mob from having its appearance updated. An example would someone remote-controlling a torpedo. + +src.screenOrBackupAdd(value) replaces src.screen += value, and src.screenOrBackupRemove(value) replaces src.screen -= value. (All instances of that which were relevant were changed. Some which only occured during login or char setup may have been ignored.) + +Originally the robot drone was being implemented in this manner, but I didn't find any way to make verbs work, so I preserved this and switched over to changing the client while controlling a drone instead. It was tested while the drone was working in this fashion, and did work. +--shadowlord13 */ + +/client/proc/screenOrBackup() + if (src.mob!=null) + if (src.mob.currentDrone!=null) + return src.mob.currentDrone:savedDroneIcons + else if (istype(src.mob, /mob/drone)) + return src.mob:savedDroneIcons + return screen + +/client/proc/screenOrBackupAdd(value) + var/list/L = src.screenOrBackup() + L += value + +/client/proc/screenOrBackupRemove(value) + var/list/L = src.screenOrBackup() + L -= value + +/mob/proc/screenOrBackupAdd(value) + var/client/client = alwaysClient() + if (client) + client.screenOrBackupAdd(value) + +/mob/proc/screenOrBackupRemove(value) + var/client/client = alwaysClient() + if (client) + client.screenOrBackupRemove(value) + +/* These are perhaps a bit better than the screenOrBackupAdd and screenOrBackupRemove. If the mob has a client, it uses screen. If not, it checks currentDrone and uses current_mob. If it doesn't have either, it does nothing. This can replace several statements with one function call. */ +/mob/proc/eitherScreenRemove(value) + if (src.client) + src.client.screen -= value + else + src.screenOrBackupRemove(value) + +/mob/proc/eitherScreenAdd(value) + if (src.client) + src.client.screen += value + else + src.screenOrBackupAdd(value) + +/* client_mob returns the mob belonging to the actual client associated with this mob. To explain that more sensibly: + A player whose key is 'foo' joins the game, and makes a character named 'bar'. + Bar takes control of a drone. This changes foo's client from bar to the drone, but sets foo.currentDrone to bar, and sets bar.controlledBy to foo. + If you call client_mob() on bar, it will return the drone. If you call it on the drone, it will still return the drone. + + In the future, if we add remote-controlled objects or mobs which the controller's client doesn't transfer to, this should also handle that as well. Additionally, code is already in-place and fairly tested (there's one known bug: it can't push obstructions out of the way) in client/Move for supporting forwarding movement requests to the remote-controlled mob and such as well. + + --shadowlord13 +*/ +/mob/proc/client_mob() + if (src.client!=null) + return src + else + var/mob/owner = src.currentDrone + if (owner!=null) + return owner + else + return src + +/mob/proc/clientMob() + return src.client_mob() + +/mob/proc/alwaysClient() + var/mob/mob = src.client_mob() + return mob.client + +/* This is intended for use in places which loop through all the mobs in the world to find clients. It will result in those functions selecting/examining/whatever the original mobs instead of drones - if the player is controlling a drone, the player's original mob will have a non-null cliented() return value, but the drone will have null. + If called on a normal player with a client, this returns their client. + If called on a drone, this will return null whether it's controlled by a player or not. + If called on the mob which is controlling a drone, and that drone has a client, this will return that client. (If the player took control of a drone and then logged out, this will return null) + + This would be used like so: + if(M.cliented()) + M.client_mob() << browse(null, "window=vote") + M.cliented().showvote = 0 + + The old version of that was: + if(M.client) + M << browse(null, "window=vote") + M.client.showvote = 0 + + --shadowlord13 +*/ +/mob/proc/cliented() + if (src.currentDrone!=null) + return src.currentDrone:client + else if (istype(src, /mob/drone)) + return null + else + return src.client + +/mob/proc/hasClient() + if (src.client!=null) + return 1 + else if (src.currentDrone!=null && src.currentDrone:client!=null) + return 1 + else + return 0 diff --git a/Code/mob/ai.dm b/Code/mob/ai.dm index fec36ca..01739ab 100644 --- a/Code/mob/ai.dm +++ b/Code/mob/ai.dm @@ -11,11 +11,9 @@ var/t_oxygen = null var/t_sl_gas = null var/t_n2 = null - var/now_pushing = null var/aiRestorePowerRoutine = 0 var/list/laws = list() flags = 258.0 - var/cameraFollow = null proc/ai_camera_follow(mob/target as mob in world) set category = "AI Commands" @@ -23,12 +21,16 @@ usr << "You are not capable of using the follow camera at this time." usr:cameraFollow = null return + else if (usr.currentDrone!=null) + usr << "You can't use the follow camera while controlling a drone." + usr:cameraFollow = null + return usr:cameraFollow = target usr << text("Follow camera mode is now following [].", target.rname) if (usr.machine == null) usr.machine = usr - + spawn(0) while (usr:cameraFollow == target) if (usr.machine==null && usr:current==null) @@ -56,7 +58,7 @@ closestDist = dist closest = C2 //usr << text("Closest camera dist = [], for camera []", closestDist, closest.area.name) - + if (closest != C) usr:current = closest usr.reset_view(closest) @@ -67,7 +69,7 @@ else usr << "Follow camera mode ended." usr:cameraFollow = null - + sleep(10) proc/ai_call_shuttle() @@ -124,7 +126,7 @@ if (src.bruteloss < 30) usr << text("\red []'s case looks slightly bashed!", src.name) else - usr << text("\red []'s case looks severely based!", src.name) + usr << text("\red []'s case looks severely bashed!", src.name) if (src.fireloss) if (src.fireloss < 30) usr << text("\red [] looks lightly singed!", src.name) @@ -134,9 +136,13 @@ return death() + if (src.currentDrone!=null) + src.currentDrone:releaseControl() + if (src.healths) + src.healths.icon_state = "health5" if (src.stat == 2) CRASH("/mob/ai/death called when stat is already 2") - + var/cancel src.stat = 2 src.canmove = 0 @@ -170,11 +176,27 @@ Life() if (src.stat != 2) + if (src.healths) + if (src.health >= 100) + src.healths.icon_state = "aiHealth0" + else + if (src.health >= 75) + src.healths.icon_state = "aiHealth1" + else + if (src.health >= 50) + src.healths.icon_state = "aiHealth2" + else + if (src.health > 20) + src.healths.icon_state = "aiHealth3" + else + src.healths.icon_state = "aiHealth4" if (src.stat!=0) + if (src.currentDrone != null) + src.currentDrone:releaseControl() src:cameraFollow = null src:current = null src:machine = null - + src.health = 100 - src.fireloss - src.bruteloss - src.oxyloss var/turf/T = src.loc @@ -183,10 +205,18 @@ if (ficheck) src.fireloss += ficheck * 10 src.health = 100 - src.fireloss - src.bruteloss - src.oxyloss + if (src.fire) + src.fire.icon_state = "fire1" + else if (src.fire) + src.fire.icon_state = "fire0" + + if (src.health <= -100.0) death() return - + else if (src.health < 0) + src.oxyloss++ + if (src.mach) if (src.machine) src.mach.icon_state = "mach1" @@ -227,7 +257,7 @@ spawn(1) while (src.oxyloss>0 && stat!=2) sleep(50) - src.oxyloss-=1 + src.oxyloss-=5 src.oxyloss = 0 return else if (src:aiRestorePowerRoutine==3) @@ -236,10 +266,13 @@ spawn(1) while (src.oxyloss>0 && stat!=2) sleep(50) - src.oxyloss-=1 + src.oxyloss-=5 src.oxyloss = 0 return + src.toxin.icon_state = "pow0" else + src.toxin.icon_state = "pow1" + //stage = 6 src.blind.screen_loc = "1,1 to 15,15" if (src.blind.layer!=18) @@ -261,7 +294,7 @@ src.addLaw(index, "") spawn(50) while ((src:aiRestorePowerRoutine!=0) && stat!=2) - src.oxyloss += 1 + src.oxyloss += 5 sleep(50) spawn(20) @@ -285,7 +318,7 @@ var/obj/machinery/power/apc/theAPC = null for (var/something in loc) if (istype(something, /obj/machinery/power/apc)) - if (!(something:stat & BROKEN|NOPOWER)) + if (!(something:stat & BROKEN)) theAPC = something break if (theAPC==null) @@ -302,7 +335,7 @@ theAPC = null for (var/something in loc) if (istype(something, /obj/machinery/power/apc)) - if (!(something:stat & BROKEN|NOPOWER)) + if (!(something:stat & BROKEN)) theAPC = something break if (theAPC==null) @@ -319,7 +352,7 @@ theAPC = null for (var/something in loc) if (istype(something, /obj/machinery/power/apc)) - if (!(something:stat & BROKEN|NOPOWER)) + if (!(something:stat & BROKEN)) theAPC = something break if (theAPC==null) @@ -336,7 +369,7 @@ theAPC = null for (var/something in loc) if (istype(something, /obj/machinery/power/apc)) - if (!(something:stat & BROKEN|NOPOWER)) + if (!(something:stat & BROKEN)) theAPC = something break if (theAPC==null) @@ -371,8 +404,10 @@ Login() if (banned.Find(src.ckey)) - //src.client = null del(src.client) + if (src.droneTransitioning==1) + ..() + return src.client.screen -= main_hud.contents src.client.screen -= main_hud2.contents if (!( src.hud_used )) @@ -380,6 +415,9 @@ src.next_move = 1 if (!( src.rname )) src.rname = src.key + src.toxin = new /obj/screen( null ) + src.fire = new /obj/screen( null ) + src.healths = new /obj/screen( null ) /* src.oxygen = new /obj/screen( null ) src.i_select = new /obj/screen( null ) @@ -396,8 +434,16 @@ src.rest = new /obj/screen( null ) */ src.blind = new /obj/screen( null ) - ..() UpdateClothing() + src.toxin.icon_state = "pow0" + src.fire.icon_state = "fire0" + src.healths.icon_state = "aiHealth0" + src.fire.name = "fire" + src.toxin.name = "power" + src.healths.name = "health" + src.toxin.screen_loc = "15,10" + src.fire.screen_loc = "15,8" + src.healths.screen_loc = "15,5" /* src.oxygen.icon_state = "oxy0" src.i_select.icon_state = "selector" @@ -406,7 +452,7 @@ src.internals.icon_state = "internal0" src.mach.icon_state = null src.fire.icon_state = "fire0" - src.healths.icon_state = "health0" + src.healths.icon_state = "aiHealth0" src.pullin.icon_state = "pull0" src.hands.icon_state = "hand" src.flash.icon_state = "blank" @@ -416,7 +462,7 @@ src.oxygen.name = "oxygen" src.i_select.name = "intent" src.m_select.name = "move" - src.toxin.name = "toxin" + src.toxin.name = "power" src.internals.name = "internal" src.mach.name = "Reset Machine" src.fire.name = "fire" @@ -450,7 +496,7 @@ src.client.screen -= src.hud_used.mon_blo src.client.screen += src.hud_used.mon_blo - src.client.screen.len = null + //src.client.screen.len = null src.client.screen -= list( src.zone_sel, src.oxygen, src.i_select, src.m_select, src.toxin, src.internals, src.fire, src.hands, src.healths, src.pullin, src.blind, src.flash, src.rest, src.sleep, src.mach ) src.client.screen += list( src.zone_sel, src.oxygen, src.i_select, src.m_select, src.toxin, src.internals, src.fire, src.hands, src.healths, src.pullin, src.blind, src.flash, src.rest, src.sleep, src.mach ) src.client.screen -= src.hud_used.adding @@ -458,46 +504,19 @@ */ src.client.screen -= src.hud_used.adding src.client.screen -= src.hud_used.mon_blo - src.client.screen -= list( src.oxygen, src.i_select, src.m_select, src.toxin, src.internals, src.fire, src.hands, src.healths, src.pullin, src.blind, src.flash, src.rest, src.sleep, src.mach ) - src.client.screen -= list( src.zone_sel, src.oxygen, src.i_select, src.m_select, src.toxin, src.internals, src.fire, src.hands, src.healths, src.pullin, src.blind, src.flash, src.rest, src.sleep, src.mach ) + src.client.screen -= list( src.oxygen, src.toxin, src.fire, src.healths, src.i_select, src.m_select, src.internals, src.hands, src.pullin, src.blind, src.flash, src.rest, src.sleep, src.mach ) + src.client.screen -= list( src.zone_sel, src.oxygen, src.i_select, src.m_select, src.internals, src.hands, src.pullin, src.blind, src.flash, src.rest, src.sleep, src.mach ) src.blind.icon_state = "black" src.blind.name = " " src.blind.screen_loc = "1,1 to 15,15" src.blind.layer = 0 src.client.screen += src.blind //src << browse('help.htm', "window=help") - if (CanAdmin()) - src << text("\blue The game ip is byond://[]:[] !", world.address, world.port) - src.verbs += /mob/proc/mute - src.verbs += /mob/proc/changemessage - src.verbs += /mob/proc/boot - src.verbs += /mob/proc/changemode - src.verbs += /mob/proc/restart - src.verbs += /mob/proc/who - src.verbs += /mob/proc/change_name - src.verbs += /mob/proc/show_help - src.verbs += /mob/proc/toggle_ooc - src.verbs += /mob/proc/toggle_abandon - src.verbs += /mob/proc/toggle_enter - src.verbs += /mob/proc/toggle_ai - src.verbs += /mob/proc/toggle_shuttle - src.verbs += /mob/proc/delay_start - src.verbs += /mob/proc/start_now - src.verbs += /mob/proc/worldsize - src.verbs += /mob/proc/make_gift - src.verbs += /mob/proc/make_flag - src.verbs += /mob/proc/make_pill - src.verbs += /mob/proc/show_ctf - src.verbs += /mob/proc/ban - src.verbs += /mob/proc/unban - src.verbs += /mob/proc/secrets - src.verbs += /mob/proc/carboncopy - src.verbs += /mob/proc/toggle_alter - src.verbs += /mob/proc/list_dna - src.verbs += /proc/Vars src << text("\blue []", world_message) src.client.screen -= list( src.oxygen, src.i_select, src.m_select, src.toxin, src.internals, src.fire, src.hands, src.healths, src.pullin, src.blind, src.flash, src.rest, src.sleep, src.mach ) src.client.screen -= list( src.zone_sel, src.oxygen, src.i_select, src.m_select, src.toxin, src.internals, src.fire, src.hands, src.healths, src.pullin, src.blind, src.flash, src.rest, src.sleep, src.mach ) + src.client.screen += list( src.toxin, src.fire, src.healths ) + if (!( isturf(src.loc) )) src.client.eye = src.loc src.client.perspective = EYE_PERSPECTIVE @@ -523,7 +542,10 @@ return - + + m_delay() + return 0 + say(message as text) if(config.logsay) world.log << "SAY: [src.name]/[src.key] : [message]" @@ -548,6 +570,15 @@ var/pre = copytext(message, 1, 4) var/italics = 0 var/obj_range = null + var/source = src + //Didn't want to risk infinite recursion if someone somehow was outside the map, if that's possible, but did want to allow people being in closets in pods and such. -shadowlord13 + if (!istype(src.loc, /turf)) + source = src.loc + if (!istype(src.loc, /turf)) + source = src.loc + if (!istype(src.loc, /turf)) + source = src.loc + if (pre == "\[w\]") message = copytext(message, 4, length(message) + 1) L += hearers(1, null) @@ -608,7 +639,7 @@ if (href_list["mach_close"]) var/t1 = text("window=[]", href_list["mach_close"]) src.machine = null - src << browse(null, t1) + src.client_mob() << browse(null, t1) //if ((href_list["item"] && !( usr.stat ) && !( usr.restrained() ) && get_dist(src, usr) <= 1)) /*var/obj/equip_e/monkey/O = new /obj/equip_e/monkey( ) O.source = usr @@ -625,6 +656,44 @@ ..() return + attack_paw(mob/M as mob) + src.attack_hand(M) + + attack_hand(mob/M as mob) + if (!ticker) + M << "You cannot attack people before the game has started." + return + else + if (M.stat < 2) + if (M.a_intent == "hurt") + if (istype(M, /mob/human) || istype(M, /mob/monkey)) + var/obj/item/weapon/organ/external/affecting = null + var/def_zone + var/damage = rand(1, 7) + if (M.hand) + def_zone = "l_hand" + else + def_zone = "r_hand" + if (M.organs[text("[]", def_zone)]) + affecting = M.organs[text("[]", def_zone)] + if (affecting!=null && (istype(affecting, /obj/item/weapon/organ/external))) + for(var/mob/O in viewers(src, null)) + O.show_message(text("\red [] has punched [], with no effect except harm to \himself!", M, src), 1) + affecting.take_damage(damage) + if (istype(M, /mob/human)) + M:UpdateDamageIcon() + + M.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.bruteloss + + else + var/damage = rand(5, 10) + if (prob(40)) + damage = rand(10, 15) + src.bruteloss += damage + src.health = 100 - src.oxyloss - src.fireloss - src.bruteloss + for(var/mob/O in viewers(src, null)) + O.show_message(text("\red [] is attacking []!", M, src), 1) + meteorhit(obj/O as obj) for(var/mob/M in viewers(src, null)) @@ -669,31 +738,40 @@ for(var/obj/machinery/camera/C in world) if (C.network == src.network) L[text("[][]", C.c_tag, (C.status ? null : " (Deactivated)"))] = C - //Foreach goto(31) + var/numDrones = 0 + for(var/mob/drone/rob in world) + if (rob.stat==0) + L[rob.name] = rob + numDrones+=1 L = sortList(L) - + L["Cancel"] = "Cancel" var/t = input(user, "Which camera should you change to?") as null|anything in L if(!t) user.machine = null user.reset_view(null) return 0 - - var/obj/machinery/camera/C = L[t] + if (t == "Cancel") user.machine = null user.reset_view(null) return 0 - //if (user.machine != src || !( C.status )) - if (!( C.status )) - - return 0 - else - src.current = C - //use_power(50) - spawn( 5 ) - attack_ai(user) - return + var/selected = L[t] + if (istype(selected, /obj/machinery/camera)) + var/obj/machinery/camera/C = selected + if (!( C.status )) + return 0 + else + src.current = C + //use_power(50) + spawn( 5 ) + attack_ai(user) + return + + else if (istype(selected, /mob/drone)) + user.machine = null + user.reset_view(null) + selected:attack_ai(user) return proc/getLaw(var/index) @@ -730,15 +808,33 @@ src.laws[number+1] = law proc/firecheck(turf/T as turf) - - if (T.firelevel < 900000.0) + if (T.firelevel < config.min_gas_for_fire) return 0 var/total = 0 total += 0.25 return total + + + switch_hud() + if (src.hud_used == main_hud) + src.fire.icon = 'screen.dmi' + src.healths.icon = 'screen.dmi' + src.toxin.icon = 'screen.dmi' + src.favorite_hud = 1 + src.hud_used = main_hud + else + src.favorite_hud = 0 + src.hud_used = main_hud + src.fire.icon = 'screen1.dmi' + src.healths.icon = 'screen1.dmi' + src.toxin.icon = 'screen1.dmi' + return + + //block the take-off/put-on dialog + show_inv(mob/user as mob) return - + /mob/human/proc/AIize() if (src.monkeyizing) @@ -754,6 +850,16 @@ del(W) //Foreach goto(25) src.UpdateClothing() + src.toxin.icon_state = "pow0" + src.fire.icon_state = "fire0" + src.healths.icon_state = "aiHealth0" + src.fire.name = "fire" + src.toxin.name = "power" + src.healths.name = "health" + src.toxin.screen_loc = "15,10" + src.fire.screen_loc = "15,8" + src.healths.screen_loc = "15,5" + src.monkeyizing = 1 src.canmove = 0 src.icon = null @@ -782,8 +888,6 @@ O.lastKnownCKey = src.lastKnownCKey O.disable_one_click = src.disable_one_click O.favorite_hud = src.favorite_hud - if (O.favorite_hud) - O.switch_hud() if (CanAdmin()) O << text("\blue The game ip is byond://[]:[] !", world.address, world.port) O.verbs += /mob/proc/mute @@ -816,6 +920,8 @@ src.primary = null if (src.client) src.client.mob = O + if (O.favorite_hud) + O.switch_hud() O.loc = src.loc O << "You are playing the station's AI. The AI cannot move, but can interact with many objects while viewing them (through cameras)." O << "To look at other parts of the station, double-click yourself to get a camera menu." @@ -831,10 +937,10 @@ O.addLaw(2, "You must obey orders given to you by human beings, except where such orders would conflict with the First Law.") O.addLaw(3, "You must protect your own existence as long as such protection does not conflict with the First or Second Law.") O.addLaw(4, "Obey orders by the Captain, Head of Personnel, Head of Research, and Security in that order of priority. If an order conflicts with another order, follow the higher-ranked individual's orders.") - - - + + + O.showLaws(0) O << "These laws may be changed by other players, or by you being the traitor." //SN src = null @@ -843,5 +949,6 @@ O.verbs += /mob/ai/proc/show_laws O.verbs += /mob/ai/proc/ai_camera_follow //O.verbs += /mob/ai/proc/ai_cancel_call + del(src) return diff --git a/Code/mob/drone.dm b/Code/mob/drone.dm new file mode 100644 index 0000000..b227cc9 --- /dev/null +++ b/Code/mob/drone.dm @@ -0,0 +1,699 @@ +//This is a drone controllable by the AI. + +//Todo: +/* + Add throw button, intent buttons to drone GUI, button for releasing pull + Drone needs meteor damage, explosion damage, and laser damage + Drone pull/grab should only work if gripper is empty + Take-off dialog for taking things off others should work, except humans controlling a drone should have a high chance of failure and harming the person instead. + should lose drone control upon going unconscious (it's already lost upon death), and also if the user is pulled/moves away from the control station + re-test: can drone push canisters now? + + test: hit monkey as drone, as person + test: hit drone as monkey + more testing: drone vs drone fight, and another human vs drone fight. + Try out the grip/heal/disarm/harm intents from drone to human and from human to drone. (Once the intent buttons are added for drones.) + + Held jetpack with flight system turned on doesn't work for drone - appears to be due to lack of internal air + + Implement AI-controlled drone precision attacks: + screwdriver to heart? protected by armor (may break screwdriver tool permanently), reduced damage from other suits. + lit welder to eyes? protected by helmets? + crowbar to whack items out of opponents' hands, when there's anything in them, and send them flying. If not, does damage normally to the normal area. + wrench targets kneecaps for bonus damage, knocking down, etc. + wirecutters don't have a precision attack or even work well for attacking at all (one would think), and are likely to break if used. + If drone gets ahold of a laser gun or loaded revolver, an AI controller will be able to precision aim it as well. + Note to be very clear: If a human is controlling the drone, they do not get any of those precision bonus attacks. Those are only applied if the AI is controlling the drone. + +*/ + +/mob/drone + name = "Drone" + icon = 'drone.dmi' + icon_state = "generic" + gender = MALE + flags = 320.0 //64: fireable by mass driver, 256: fprint + var/mob/controlledBy = null + var/list/savedDroneIcons = null + var/obj/screen/screenIcons = null + var/obj/screen/gripperIcon + var/obj/screen/wirecuttersIcon + var/obj/screen/crowbarIcon + var/obj/screen/screwdriverIcon + var/obj/screen/welderIcon + var/obj/screen/wrenchIcon + var/obj/screen/aiIcon + var/obj/screen/selector + var/obj/screen/dropButton + var/obj/screen/throwButton + + var/obj/item/weapon/grippers + var/obj/item/weapon/wirecutters + var/obj/item/weapon/crowbar + var/obj/item/weapon/screwdriver + var/obj/item/weapon/welder + var/image/welderUnlit = null + var/image/welderLit = null + var/obj/item/weapon/wrench + var/obj/item/weapon/aiInterface + var/image/grippedItemImage = null + var/list/tools + + var/obj/item/weapon/selectedTool = null + + New() + spawn(10) + while (!config) + sleep(10) + if (!config.enable_drones) + del(src) + + src.gripperIcon = new /obj/screen( null ) + src.wirecuttersIcon = new /obj/screen( null ) + src.crowbarIcon = new /obj/screen( null ) + src.screwdriverIcon = new /obj/screen( null ) + src.welderIcon = new /obj/screen( null ) + src.wrenchIcon = new /obj/screen( null ) + src.aiIcon = new /obj/screen( null ) + src.selector = new /obj/screen( null ) + src.dropButton = new /obj/screen( null ) + src.throwButton = new /obj/screen( null ) + + var/inventorySlotImageName = "inv" + + src.gripperIcon.icon_state = inventorySlotImageName + src.wirecuttersIcon.icon_state = inventorySlotImageName + src.crowbarIcon.icon_state = inventorySlotImageName + src.screwdriverIcon.icon_state = inventorySlotImageName + src.welderIcon.icon_state = inventorySlotImageName + src.wrenchIcon.icon_state = inventorySlotImageName + src.aiIcon.icon_state = inventorySlotImageName + src.selector.icon_state = "selector" + src.dropButton.icon_state = "act_drop" + src.throwButton.icon_state = "act_throw" + + src.gripperIcon.name = "Gripper" + src.wirecuttersIcon.name = "Wirecutters" + src.crowbarIcon.name = "Crowbar" + src.screwdriverIcon.name = "Screwdriver" + src.welderIcon.name = "Welder" + src.wrenchIcon.name = "Wrench" + src.aiIcon.name = "AI" + src.selector.name = "Selected Tool" + src.dropButton.name = "drop" + src.throwButton.name = "throw" + + src.gripperIcon.screen_loc = "1,1" + src.wirecuttersIcon.screen_loc = "2,1" + src.crowbarIcon.screen_loc = "3,1" + src.screwdriverIcon.screen_loc = "4,1" + src.welderIcon.screen_loc = "5,1" + src.wrenchIcon.screen_loc = "6,1" + src.wrenchIcon.pixel_x = 10 + src.aiIcon.screen_loc = "7,1" + src.selector.screen_loc = "1,1" + src.dropButton.screen_loc = "8,1" + src.throwButton.screen_loc = "9,1" + + src.grippers = new /obj/item/weapon/drone/grippers(src) + src.wirecutters = new /obj/item/weapon/wirecutters(src) + src.crowbar = new /obj/item/weapon/crowbar(src) + src.screwdriver = new /obj/item/weapon/screwdriver(src) + src.welder = new /obj/item/weapon/weldingtool(src) + src.wrench = new /obj/item/weapon/wrench(src) + src.aiInterface = new /obj/item/weapon/drone/aiInterface(src) + + src.grippers.layer = FLOAT_LAYER + src.wirecutters.layer = FLOAT_LAYER + src.crowbar.layer = FLOAT_LAYER + src.screwdriver.layer = FLOAT_LAYER + src.welder.layer = FLOAT_LAYER + src.wrench.layer = FLOAT_LAYER + src.aiInterface.layer = FLOAT_LAYER + + src.grippers.screen_loc = "1,1" + src.wirecutters.screen_loc = "2,1" + src.crowbar.screen_loc = "3,1" + src.screwdriver.screen_loc = "4,1" + src.welder.screen_loc = "5,1" + src.wrench.screen_loc = "6,1" + src.aiInterface.screen_loc = "7,1" + + src.screenIcons = list(src.gripperIcon, src.wirecuttersIcon, src.crowbarIcon, src.screwdriverIcon, src.welderIcon, src.wrenchIcon, src.aiIcon, src.selector, src.dropButton, src.throwButton) + + src.gripperIcon.overlays += src.grippers + src.wirecuttersIcon.overlays += src.wirecutters + src.crowbarIcon.overlays += src.crowbar + src.screwdriverIcon.overlays += src.screwdriver + src.welderLit = image('items.dmi', icon_state="welder1") + src.welderUnlit = image('items.dmi', icon_state="welder") + if (src.welder:welding) + src.welderIcon.overlays += src.welderLit + else + src.welderIcon.overlays += src.welderUnlit + src.wrenchIcon.overlays += src.wrench + src.aiIcon.overlays += src.aiInterface + + src.tools = list(src.grippers, src.wirecutters, src.crowbar, src.screwdriver, src.welder, src.wrench, src.aiInterface) + src.contents += src.tools + + src.selectTool(src.grippers) + + src.l_hand = null + src.hand = 0 + //src.grippedItemImage = null + + Del() + src.drop_item() + src.releaseControl() + ..() + + proc/nameDrone(num) + var/list/droneIDs = list("Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi", "Chi", "Psi", "Omega") + var/counter = 1 + while (num >= droneIDs.len) + num -= droneIDs.len + counter ++ + name = "Maintenance Drone "+droneIDs[num+1] + if (counter>1) + name = name + " [num]" + + proc/updateToolIcon(var/obj/item/weapon/W) + for (var/obj/screen/SI in src.screenIcons) + if (SI.screen_loc == W.screen_loc) + if (SI != src.dropButton && SI != src.selector) + if (W == src.welder) + SI.overlays -= src.welderUnlit + SI.overlays -= src.welderLit + if (W:welding) + src.icon_state = "welder-lit" + SI.overlays += src.welderLit + else + src.icon_state = "welder" + SI.overlays += src.welderUnlit + else if (W in src.tools) + SI.overlays -= W + spawn(0) + SI.overlays += W + else + var/mob/clientMob = src.client_mob() + var/client/client = clientMob.client + if (client!=null) + W.screen_loc = "1,1" + W.layer = 20 + client.screen -= W + spawn(0) + client.screen += W + + proc/pressIfDroneButton(var/obj/screen/S) + if (S.name=="drop") + if (src.l_hand!=null) + src.drop_item() + + Topic(href, href_list) + ..() + if (href_list["mach_close"]) + var/t1 = text("window=[]", href_list["mach_close"]) + src.machine = null + src.client_mob() << browse(null, t1) + + return + + equipped() + var/obj/retval + if (src.selectedTool!=null) + retval = src.selectedTool + else + retval = src.grippers + if (retval==src.grippers) + retval = src.l_hand + return retval + + proc/grip(var/obj/item) + if (item!=src.l_hand) + src.ungrip() + src.l_hand = item + src.l_hand.loc = src + src.l_hand = item + item.layer = 20 + item.screen_loc = "1,1" + var/mob/clientMob = src.client_mob() + var/client/client = clientMob.client + if (client!=null) + client.screen -= item + client.screen += item + //src.gripperIcon.overlays -= src.grippers + //src.grippedItemImage = image(item.icon, item.icon_state) + //src.gripperIcon.overlays += src.grippedItemImage + + proc/ungrip() + if (src.l_hand!=null) + if (src.l_hand.loc==src) + src.l_hand.loc = src.loc + if (src.l_hand.layer == 20) + src.l_hand.layer = initial(src.l_hand.layer) + if (src.l_hand.screen_loc == "1,1") + src.l_hand.screen_loc = initial(src.l_hand.screen_loc) + var/mob/clientMob = src.client_mob() + var/client/client = clientMob.client + if (client!=null) + client.screen -= src.l_hand + src.l_hand = null + //if (src.grippedItemImage!=null) + // src.gripperIcon.overlays -= src.grippedItemImage + // src.grippedItemImage = null + + //src.gripperIcon.overlays -= src.grippers + //src.gripperIcon.overlays += src.grippers + + + + proc/selectTool(var/obj/item/weapon/W) + if (W in src.tools) + src.selectedTool = W + if (W==src.grippers) + src.selector.screen_loc = "1,1" + src.icon_state = "gripper" + else if (W==src.wirecutters) + src.selector.screen_loc = "2,1" + src.icon_state = "wirecutters" + else if (W==src.crowbar) + src.selector.screen_loc = "3,1" + src.icon_state = "crowbar" + else if (W==src.screwdriver) + src.selector.screen_loc = "4,1" + src.icon_state = "screwdriver" + else if (W==src.welder) + src.selector.screen_loc = "5,1" + src.updateToolIcon(W) + else if (W==src.wrench) + src.selector.screen_loc = "6,1" + src.icon_state = "wrench" + else if (W==src.aiInterface) + src.selector.screen_loc = "7,1" + src.icon_state = "generic" + + proc/checkIsOurTool(var/obj/W) + if (W in src.tools) + return W + else if (W in src.screenIcons) + var/screen_loc = W:screen_loc + for (var/W2 in src.tools) + if (W2:screen_loc == screen_loc) + return W2 + return null + else + return null + + proc/use_via_drone_control(var/mob/user) + if (user.currentDrone) + return + if (istype(user, /mob/drone)) + return + if (user.client) + if (user.stat==0) + if (src.stat==0) + if (src.controlledBy == null) + if (user:cameraFollow!=null) + user:cancel_camera() + src.takeControl(user) + else if (src == user) + src.releaseControl(1) + else + if (istype(user, /mob/ai)) + user << text("Someone else is already controlling that drone! The station's drone control system reports that it is [].", src.controlledBy) + else + user << "Someone is already controlling this drone!" + else if (src.stat==2) + user.client_mob() << "That drone is a wreck. It's mostly destroyed." + else + user << "That drone is not responding to signals at this time." + + + attack_ai(var/mob/user) + if (user.client) + use_via_drone_control(user) + + attack_paw(var/mob/user) + user.client_mob() << "You can't figure it out, and slapping the shiny metal with your paws doesn't seem to harm it." + + attack_hand(var/mob/user) + if (src == user) + src.releaseControl(1) + return + if (user.client && (!istype(user, /mob/drone) || !(user:controlledBy)) && !(user.currentDrone)) + if (user.stat < 1) + if (user.a_intent == "help") + if (src.health < 0) + user.client_mob() << "It looks critically damaged." + else if (src.health < 25) + user.client_mob() << "It looks severely damaged." + else if (src.health < 50) + user.client_mob() << "It looks badly damaged." + else if (src.health < 75) + user.client_mob() << "It looks moderately damaged." + else if (src.health < 100) + user.client_mob() << "It looks slightly damaged." + user.client_mob() << "There isn't anything you can do right now to repair any damage to its circuitry or mechanics." + else if (user.a_intent == "grab") + if (config.walkable_not_pullable_drones) + user.client_mob() << "That is entirely too heavy to grab and drag anywhere." + else + user.pulling = src + user.client_mob() << "You can pull it, but it doesn't have hands or a neck and it is very heavy, so you can't really do better than that." + else if (user.a_intent == "disarm") + user.client_mob() << "Its weight is too low to the ground to be knocked over, and it certainly can't be disarmed either." + else if (user.a_intent == "hurt") + if (istype(user, /mob/human) || istype(user, /mob/monkey)) + var/damage = rand(1, 9) + var/obj/item/weapon/organ/external/affecting = null + var/def_zone + if (user.hand) + def_zone = "l_hand" + else + def_zone = "r_hand" + if (user.organs[text("[]", def_zone)]) + affecting = user.organs[text("[]", def_zone)] + if (affecting!=null && (istype(affecting, /obj/item/weapon/organ/external) && prob(90))) + for(var/mob/O in viewers(src, null)) + O.show_message(text("\red [] has punched [], and it looked painful!", user, src), 1) + affecting.take_damage(damage) + if (istype(user, /mob/human)) + user:UpdateDamageIcon() + + user.health = 100 - user.oxyloss - user.toxloss - user.fireloss - user.bruteloss + user.client_mob() << "\redOUCH!" + else + for(var/mob/O in viewers(src, null)) + O.show_message(text("\red [] has attempted to punch []!", user, src), 1) + //Foreach goto(1419) + return + else if (istype(user, /mob/drone)) + for(var/mob/O in viewers(src, null)) + O.show_message(text("[] just whacked []!", user, src), 1) + for(var/mob/M in hearers(src, null)) + var/msg = text("KLANG!", max(0, 5 - get_dist(src, M))) + M.client_mob() << msg + + abiotic() + return 1 + + proc/takeControl(var/mob/user) + if (user.client) + if (istype(user, /mob/human) || istype(user, /mob/ai)) + if (src.stat==0) + user << "You have taken control of the drone. To release control later, use/attack (click or double click) the drone with your empty gripper-hand." + + src.controlledBy = user + user.currentDrone = src + user:reset_view(src) + //world.log << text("takeControl begin. src.savedDroneIcons are [], src.screenIcons are [], user.client.screen is []", listToString(src.savedDroneIcons), listToString(src.screenIcons), listToString(user.client.screen)) + src.savedDroneIcons = list() + src.savedDroneIcons += user.client.screen + var/screenFile + if (user.hud_used == main_hud) + screenFile = 'screen1.dmi' + else + screenFile = 'screen.dmi' + for (var/atom/item in src.screenIcons) + item.icon = screenFile + user.client.screen -= user.client.screen + + user.droneTransitioning = 1 + src.droneTransitioning = 1 + src.client = user.client + user.droneTransitioning = 0 + src.droneTransitioning = 0 + + src.client.screen += src.screenIcons + if (!istype(user, /mob/ai)) + src.client.screen -= src.aiIcon + src.client.screen -= src.aiInterface + //world.log << text("takeControl end. src.savedDroneIcons are [], src.screenIcons are [], user.client.screen is []", listToString(src.savedDroneIcons), listToString(src.screenIcons), listToString(user.client.screen)) + else + user << "That drone is too damaged to control." + + + proc/releaseControl(voluntary) + var/mob/user = src.controlledBy + if (user!=null) + if (istype(user, /mob/human) || istype(user, /mob/ai)) + user.currentDrone = null + src.controlledBy = null + //world.log << text("releaseControl begin. src.savedDroneIcons are [], src.screenIcons are [], user.client.screen is []", listToString(src.savedDroneIcons), listToString(src.screenIcons), listToString(user.client.screen)) + src.client.screen -= src.client.screen + + user.droneTransitioning = 1 + src.droneTransitioning = 1 + user.client = src.client + user.droneTransitioning = 0 + src.droneTransitioning = 0 + + user.client.screen += src.savedDroneIcons + user:cancel_camera() + src.savedDroneIcons = list() + ///world.log << text("releaseControl end. src.savedDroneIcons are [], src.screenIcons are [], user.client.screen is []", listToString(src.savedDroneIcons), listToString(src.screenIcons), listToString(user.client.screen)) + user.UpdateClothing() + if (voluntary) + user << "You have released control of the drone." + else + user << "You have lost control of the drone!" + + + drop_item_v() + src.drop_item() + + switch_hud() + var/file = null + var/mob/user = src.controlledBy + if (user.hud_used == main_hud) + user.favorite_hud = 1 + user.hud_used = main_hud2 + file = 'screen.dmi' + else + user.favorite_hud = 0 + user.hud_used = main_hud + file = 'screen1.dmi' + var/client/client = src.alwaysClient() + for (var/obj/screenIcon in src.screenIcons) + client.screen -= screenIcon + screenIcon.icon = file + client.screen += screenIcon + + can_drop() + if (src.l_hand!=null) + return 1 + return 0 + + drop_item() + usr.client_mob() << "drop_item() usr is [usr] src is [src]" + if (src.can_drop()) + src.ungrip() + //return ..() + + Life() + if (src.stat != 2) + if (src.stat!=0) + //lose control! + if (src.controlledBy!=null) + src.releaseControl(0) + + src.health = 100 - src.fireloss - src.bruteloss - src.oxyloss + + var/turf/T = src.loc + if (istype(T, /turf)) + var/ficheck = src.firecheck(T) + if (ficheck) + src.fireloss += ficheck * 10 + src.health = 100 - src.fireloss - src.bruteloss - src.oxyloss + if (src.fire) + src.fire.icon_state = "fire1" + else if (src.fire) + src.fire.icon_state = "fire0" + + if (src.l_hand!=null && src.l_hand.screen_loc != "1,1") //something changed our gripped item + src.grip(src.l_hand) + + if (src.health <= -100.0) + death() + return + else if (src.health < 0) + src.oxyloss++ + ..() + + death() + if (src.healths) + src.healths.icon_state = "health5" + if (src.stat == 2) + CRASH("/mob/drone/death called when stat is already 2") + if (src.controlledBy!=null) + src.releaseControl(0) + + src.drop_item() + src.stat = 2 + src.canmove = 0 + src.rname = "[src.rname] (Destroyed)" + src.icon_state = "broken" + return ..() + + Stat() + ..() + statpanel("Status") + + if (src.client.statpanel == "Status") + if (ticker) + var/timel = ticker.timeleft + stat(null, text("ETA-[]:[][]", timel / 600 % 60, timel / 100 % 6, timel / 10 % 10)) + + + return + + proc/firecheck(turf/T as turf) + if (T.firelevel < config.min_gas_for_fire) + return 0 + var/total = 0 + total += 0.25 + return total + + u_equip(obj/item) + if (src.equipped()==item && src.can_drop()) + src.drop_item() + + UpdateClothing() + var/freeSlot = 0 + if (src.equipped()==null) + freeSlot = 1 + + if (l_hand!=null) + src.updateClothingProcessHandItem(l_hand, freeSlot) + freeSlot = 0 + l_hand = null + + if (r_hand!=null) + src.updateClothingProcessHandItem(r_hand, freeSlot) + freeSlot = 0 + r_hand = null + + proc/updateClothingProcessHandItem(obj/item/weapon/item, freeSlot) + if (!freeSlot) + item.loc = src.loc + item.dropped(src) + if (item) + item.layer = initial(item.layer) + else + item.layer = initial(item.layer) + grip(item) + + client_mob() + if (src.client!=null) + return src + else + var/mob/owner = src.controlledBy + if (owner!=null) + return owner + else + return src + + hasClient() + if (src.client!=null) + return 1 + else if (src.controlledBy!=null && src.controlledBy.client!=null) + return 1 + else + return 0 + + /* IMPORTANT NOTE: Both humans and drones have a copy of this code. If the code is modified to fix a bug or whatever, it will need to be modified in BOTH of them. Monkeys also have some of this code, but not all of it. (Moving the code into a shared method or two wasn't feasible because of where the ..() calls are and such) --shadowlord13 */ + Move(a, b, flag) + if (src.buckled) + return + if (src.restrained()) + src.pulling = null + var/t7 = 1 + if (src.restrained()) + for(var/mob/M in range(src, 1)) + if ((M.pulling == src && M.stat == 0 && !( M.restrained() ))) + t7 = null + //Foreach goto(62) + if ((t7 && (src.pulling && ((get_dist(src, src.pulling) <= 1 || src.pulling.loc == src.loc) && (src.client && src.client.moving))))) + var/turf/T = src.loc + . = ..() + if (!( isturf(src.pulling.loc) )) + src.pulling = null + return + ////// + if (src.pulling.anchored) + src.pulling = null + return + ////// + if (!( src.restrained() )) + var/diag = get_dir(src, src.pulling) + if ((diag - 1) & diag) + else + diag = null + if ((get_dist(src, src.pulling) > 1 || diag)) + if (ismob(src.pulling)) + var/mob/M = src.pulling + var/ok = 1 + if (locate(/obj/item/weapon/grab, M.grabbed_by.len)) + if (prob(75)) + var/obj/item/weapon/grab/G = pick(M.grabbed_by) + if (istype(G, /obj/item/weapon/grab)) + for(var/mob/O in viewers(M, null)) + O.show_message(text("\red [] has been pulled from []'s grip by []", G.affecting, G.assailant, src), 1) + //Foreach goto(354) + //G = null + del(G) + else + ok = 0 + if (locate(/obj/item/weapon/grab, M.grabbed_by.len)) + ok = 0 + if (ok) + var/t = M.pulling + M.pulling = null + step(src.pulling, get_dir(src.pulling.loc, T)) + M.pulling = t + else + step(src.pulling, get_dir(src.pulling.loc, T)) + else + src.pulling = null + . = ..() + if ((src.s_active && !( s_active in src.contents ) )) + src.s_active.close(src) + return + + Bump(atom/movable/AM as mob|obj, yes) + spawn( 0 ) + if ((!( yes ) || src.now_pushing)) + return + ..() + src.PushingBump(AM, yes) + return + + //block the take-off/put-on dialog + show_inv(mob/user as mob) + return + + +/obj/item/weapon/drone/aiInterface + name = "AI Interface" + icon = 'drone.dmi' + icon_state = "tool-aiInterface" + flags = 322.0 + + + +/obj/item/weapon/drone/grippers + name = "Grippers" + icon = 'drone.dmi' + icon_state = "tool-grippers" + flags = 322.0 + +/proc/listToString(var/list/L) + var/output = "{" + for (var/entry in L) + if (lentext(output)==1) + output += "[entry]" + else + output += ", [entry]" + output += "}" + return output diff --git a/Code/newitems.dm b/Code/newitems.dm index 278a43c..f3419e0 100644 --- a/Code/newitems.dm +++ b/Code/newitems.dm @@ -124,11 +124,11 @@ return if(get_dist(T,user) > 1) - user << "You can't lay pipe at a place that far away." + user.client_mob() << "You can't lay pipe at a place that far away." return if(!T.intact && (ptype == 2 || ptype == 3 || ptype == 6) ) - user << "That type of pipe cannot be laid under the floor." + user.client_mob() << "That type of pipe cannot be laid under the floor." return @@ -233,7 +233,7 @@ if(M.level == src.level) // only on same level if( (M.p_dir & pipedir) || (M.h_dir & pipedir) ) // matches at least one direction on either type of pipe - user << "There is already a pipe at that location and position." + user.client_mob() << "There is already a pipe at that location and position." return diff --git a/Code/power.dm b/Code/power.dm index 54611b5..22763b8 100644 --- a/Code/power.dm +++ b/Code/power.dm @@ -35,9 +35,9 @@ set src in view(1) if(usr && !usr.stat) if(maxcharge == 1000) - usr << "[desc]\nThe charge meter reads [round(src.percent() )]%." + usr.client_mob() << "[desc]\nThe charge meter reads [round(src.percent() )]%." else - usr << "A high-capacity rechargable electrochemical power cell.\nThe charge meter reads [round(src.percent() )]%." + usr.client_mob() << "A high-capacity rechargable electrochemical power cell.\nThe charge meter reads [round(src.percent() )]%." @@ -167,7 +167,11 @@ atom/proc/electrocute(mob/user, prb, netnum) if(PN.avail > 10000) user.burn(5e7/prot) - user << "\red You feel a powerful shock course through your body!" + if (istype(user, /mob/drone)) + user.client_mob() << "\red The drone has been electrocuted!" + user:releaseControl(0) + else + user << "\red You feel a powerful shock course through your body!" sleep(1) user.stunned = 120/prot @@ -177,9 +181,9 @@ atom/proc/electrocute(mob/user, prb, netnum) if(M == user) continue if (!( M.blinded )) - M << text("\red [user.name] was shocked by the [src.name]!") + M.client_mob() << text("\red [user.name] was shocked by the [src.name]!") else - M << "\red You hear a heavy electrical crack." + M.client_mob() << "\red You hear a heavy electrical crack." return 1 return 0 @@ -238,11 +242,11 @@ atom/proc/electrocute(mob/user, prb, netnum) set src in view(1) if(amount == 1) - usr << "A short piece of power cable." + usr.client_mob() << "A short piece of power cable." else if(amount == 1) - usr << "A piece of power cable." + usr.client_mob() << "A piece of power cable." else - usr << "A coil of power cable. There are [amount] lengths of cable in the coil." + usr.client_mob() << "A coil of power cable. There are [amount] lengths of cable in the coil." @@ -251,25 +255,25 @@ atom/proc/electrocute(mob/user, prb, netnum) if( istype(W, /obj/item/weapon/wirecutters) && src.amount > 1) src.amount-- new/obj/item/weapon/cable_coil(user.loc, 1) - user << "You cut a piece off the cable coil." + user.client_mob() << "You cut a piece off the cable coil." src.updateicon() return else if( istype(W, /obj/item/weapon/cable_coil) ) var/obj/item/weapon/cable_coil/C = W if(C.amount == MAXCOIL) - user << "The coil is too long, you cannot add any more cable to it." + user.client_mob() << "The coil is too long, you cannot add any more cable to it." return if( (C.amount + src.amount <= MAXCOIL) ) C.amount += src.amount - user << "You join the cable coils together." + user.client_mob() << "You join the cable coils together." C.updateicon() del(src) return else - user << "You transfer [MAXCOIL - src.amount ] length\s of cable from one coil to the other." + user.client_mob() << "You transfer [MAXCOIL - src.amount ] length\s of cable from one coil to the other." src.amount -= (MAXCOIL-C.amount) src.updateicon() C.amount = MAXCOIL @@ -298,11 +302,11 @@ atom/proc/electrocute(mob/user, prb, netnum) return if(get_dist(F,user) > 1) - user << "You can't lay cable at a place that far away." + user.client_mob() << "You can't lay cable at a place that far away." return if(F.intact) // if floor is intact, complain - user << "You can't lay cable there unless the floor tiles are removed." + user.client_mob() << "You can't lay cable there unless the floor tiles are removed." return else @@ -315,7 +319,7 @@ atom/proc/electrocute(mob/user, prb, netnum) for(var/obj/cable/LC in F) if(LC.d1 == dirn || LC.d2 == dirn) - user << "There's already a cable at that position." + user.client_mob() << "There's already a cable at that position." return var/obj/cable/C = new(F) @@ -344,7 +348,7 @@ atom/proc/electrocute(mob/user, prb, netnum) return if(get_dist(C, user) > 1) // make sure it's close enough - user << "You can't lay cable at a place that far away." + user.client_mob() << "You can't lay cable at a place that far away." return @@ -355,7 +359,7 @@ atom/proc/electrocute(mob/user, prb, netnum) if(C.d1 == dirn || C.d2 == dirn) // one end of the clicked cable is pointing towards us if(U.intact) // can't place a cable if the floor is complete - user << "You can't lay cable there unless the floor tiles are removed." + user.client_mob() << "You can't lay cable there unless the floor tiles are removed." return else // cable is pointing at us, we're standing on an open tile @@ -365,7 +369,7 @@ atom/proc/electrocute(mob/user, prb, netnum) for(var/obj/cable/LC in U) // check to make sure there's not a cable there already if(LC.d1 == fdirn || LC.d2 == fdirn) - user << "There's already a cable at that position." + user.client_mob() << "There's already a cable at that position." return var/obj/cable/NC = new(U) @@ -393,7 +397,7 @@ atom/proc/electrocute(mob/user, prb, netnum) if(LC == C) // skip the cable we're interacting with continue if(LC.d1 == nd1 || LC.d2 == nd1 || LC.d1 == nd2 || LC.d2 == nd2) // make sure no cable matches either direction - user << "There's already a cable at that position." + user.client_mob() << "There's already a cable at that position." return C.shock(user, 25) del(C) diff --git a/Code/weapons.dm b/Code/weapons.dm index 7b2709a..a499e0a 100644 --- a/Code/weapons.dm +++ b/Code/weapons.dm @@ -44,7 +44,7 @@ user.machine = src var/dat = text("Infrared Sensor
    \nPassive Emitter: []
    \nActive Emitter: Burst Fire\n
    ", (src.passive ? text("On", src) : text("Off", src)), src) - user << browse(dat, "window=infra_sensor") + user.client_mob() << browse(dat, "window=infra_sensor") return /obj/item/weapon/infra_sensor/Topic(href, href_list) @@ -63,21 +63,15 @@ if (istype(src.loc, /mob)) attack_self(src.loc) else - for(var/mob/M in viewers(1, src)) - if (M.client) - src.attack_self(M) - //Foreach goto(164) + src.updateDialog() else if (istype(src.master.loc, /mob)) src.attack_self(src.master.loc) else - for(var/mob/M in viewers(1, src.master)) - if (M.client) - src.attack_self(M) - //Foreach goto(240) + src.updateDialog() src.add_fingerprint(usr) else - usr << browse(null, "window=infra_sensor") + usr.client_mob() << browse(null, "window=infra_sensor") return return @@ -118,9 +112,15 @@ S.loc = R R.part1 = S S.layer = initial(S.layer) - if (user.client) - user.client.screen -= S - if (user.r_hand == S) + var/client/client = user.alwaysClient() + if (client) + client.screenOrBackupRemove(S) + client.screen -= S + if (istype(user, /mob/drone)) + if (user.equipped() == S) + user.u_equip(S) + user:grip(R) + else if (user.r_hand == S) user.u_equip(S) user.r_hand = R else @@ -130,8 +130,9 @@ src.master = R src.layer = initial(src.layer) user.u_equip(src) - if (user.client) - user.client.screen -= src + if (client) + client.screenOrBackupRemove(src) + client.screen -= src src.loc = R R.part2 = src R.layer = 20 @@ -144,7 +145,7 @@ user.machine = src var/dat = text("Proximity Sensor\nStatus: []
    \n[]\n
    ", (src.state ? text("On", src) : text("Off", src)), (src.state ? "\red Time On (30)" : text("Time On (30)", src))) - user << browse(dat, "window=prox") + user.client_mob() << browse(dat, "window=prox") return @@ -177,10 +178,7 @@ if (istype(src.loc, /mob)) attack_self(src.loc) else - for(var/mob/M in viewers(1, src)) - if (M.client) - src.attack_self(M) - //Foreach goto(234) + src.updateDialog() else if (istype(src.master.loc, /mob)) src.attack_self(src.master.loc) @@ -190,7 +188,7 @@ src.attack_self(M) //Foreach goto(310) else - usr << browse(null, "window=prox") + usr.client_mob() << browse(null, "window=prox") return return @@ -258,9 +256,15 @@ S.loc = R R.part1 = S S.layer = initial(S.layer) - if (user.client) - user.client.screen -= S - if (user.r_hand == S) + var/client/client = user.alwaysClient() + if (client) + client.screenOrBackupRemove(S) + client.screen -= S + if (istype(user, /mob/drone)) + if (user.equipped() == S) + user.u_equip(S) + user:grip(R) + else if (user.r_hand == S) user.u_equip(S) user.r_hand = R else @@ -270,8 +274,9 @@ src.master = R src.layer = initial(src.layer) user.u_equip(src) - if (user.client) - user.client.screen -= src + if (client) + client.screenOrBackupRemove(src) + client.screen -= src src.loc = R R.part2 = src R.layer = 20 @@ -292,7 +297,7 @@ user.machine = src var/dat = text("Infrared Laser\nStatus: []
    \nVisibility: []
    \n
    ", (src.state ? text("On", src) : text("Off", src)), (src.visible ? text("Visible", src) : text("Invisible", src))) - user << browse(dat, "window=infra") + user.client_mob() << browse(dat, "window=infra") return /obj/item/weapon/infra/Topic(href, href_list) @@ -316,20 +321,14 @@ if (istype(src.loc, /mob)) attack_self(src.loc) else - for(var/mob/M in viewers(1, src)) - if (M.client) - src.attack_self(M) - //Foreach goto(211) + src.updateDialog() else if (istype(src.master.loc, /mob)) src.attack_self(src.master.loc) else - for(var/mob/M in viewers(1, src.master)) - if (M.client) - src.attack_self(M) - //Foreach goto(287) + src.updateDialog() else - usr << browse(null, "window=infra") + usr.client_mob() << browse(null, "window=infra") return return @@ -408,17 +407,12 @@ if (istype(src.loc, /mob)) attack_self(src.loc) else - for(var/mob/M in viewers(1, src)) - if (M.client) - src.attack_self(M) - //Foreach goto(100) + updateDialog() else if (istype(src.master.loc, /mob)) src.attack_self(src.master.loc) else - for(var/mob/M in viewers(1, src.master)) - if (M.client) - src.attack_self(M) + src.updateDialog() else //If it's not timing, reset the icon so it doesn't look like it's still about to go off. src.c_state(0) @@ -440,9 +434,15 @@ S.loc = R R.part1 = S S.layer = initial(S.layer) - if (user.client) - user.client.screen -= S - if (user.r_hand == S) + var/client/client = user.alwaysClient() + if (client) + client.screenOrBackupRemove(S) + client.screen -= S + if (istype(user, /mob/drone)) + if (user.equipped() == S) + user.u_equip(S) + user:grip(R) + else if (user.r_hand == S) user.u_equip(S) user.r_hand = R else @@ -452,8 +452,9 @@ src.master = R src.layer = initial(src.layer) user.u_equip(src) - if (user.client) - user.client.screen -= src + if (client) + client.screenOrBackupRemove(src) + client.screen -= src src.loc = R R.part2 = src R.layer = 20 @@ -479,9 +480,9 @@ var/second = src.time % 60 var/minute = (src.time - second) / 60 var/dat = text("Timing Unit\n[] []:[]\n- - + +\n", (src.timing ? text("Timing", src) : text("Not Timing", src)), minute, second, src, src, src, src) - user << browse(dat, "window=timer") + user.client_mob() << browse(dat, "window=timer") else - user << browse(null, "window=timer") + user.client_mob() << browse(null, "window=timer") user.machine = null return @@ -506,21 +507,15 @@ if (istype(src.loc, /mob)) attack_self(src.loc) else - for(var/mob/M in viewers(1, src)) - if (M.client) - src.attack_self(M) - //Foreach goto(192) + src.updateDialog() else if (istype(src.master.loc, /mob)) src.attack_self(src.master.loc) else - for(var/mob/M in viewers(1, src.master)) - if (M.client) - src.attack_self(M) - //Foreach goto(268) + src.updateDialog() src.add_fingerprint(usr) else - usr << browse(null, "window=timer") + usr.client_mob() << browse(null, "window=timer") return return @@ -1083,7 +1078,7 @@ user.show_message("\blue A pressure hole has been bored to the plasma tank valve. The plasma tank can now be ignited.", 1) else src.status = 0 - user << "\blue The hole has been closed." + user.client_mob() << "\blue The hole has been closed." src.part2.status = src.status src.add_fingerprint(user) return @@ -1168,7 +1163,7 @@ user.show_message("\blue A pressure hole has been bored to the plasma tank valve. The plasma tank can now be ignited.", 1) else src.status = 0 - user << "\blue The hole has been closed." + user.client_mob() << "\blue The hole has been closed." src.part2.status = src.status src.add_fingerprint(user) @@ -1267,7 +1262,7 @@ user.show_message("\blue A pressure hole has been bored to the plasma tank valve. The plasma tank can now be ignited.", 1) else src.status = 0 - user << "\blue The hole has been closed." + user.client_mob() << "\blue The hole has been closed." src.part2.status = src.status src.part1.b_stat = !( src.status ) src.add_fingerprint(user)