Merge remote-tracking branch 'upstream/dev' into CultPorting

This commit is contained in:
PsiOmega
2015-04-14 15:54:22 +02:00
58 changed files with 2538 additions and 5003 deletions
+67 -3
View File
@@ -55,6 +55,21 @@
//Inbuilt devices.
var/obj/item/clothing/shoes/magboots/boots = null // Deployable boots, if any.
var/obj/item/clothing/head/helmet/helmet = null // Deployable helmet, if any.
var/obj/item/weapon/tank/tank = null // Deployable tank, if any.
/obj/item/clothing/suit/space/void/examine(user)
..(user)
if(boots || helmet || tank)
var/D = "Installed equipment: "
var/first = 1
for(var/obj/item/I in list(helmet,boots,tank))
if (I)
D += "[first?"":", "]\the [I]\icon[I]"
first = 0
D += "."
user << D
if(tank && in_range(src,user))
user << "<span class='notice'>The wrist-mounted pressure gauge reads [max(round(tank.air_contents.return_pressure()),0)] kPa remaining in \the [tank].</span>"
/obj/item/clothing/suit/space/void/refit_for_species(var/target_species)
..()
@@ -87,6 +102,13 @@
M << "Your suit's boots deploy with a hiss."
boots.canremove = 0
if(tank)
if(H.s_store) //In case someone finds a way.
M << "Alarmingly, the valve on your suit's installed tank fails to engage."
else if (H.equip_to_slot_if_possible(tank, slot_s_store))
M << "The valve on your suit's installed tank safely engages."
tank.canremove = 0
/obj/item/clothing/suit/space/void/dropped()
..()
@@ -108,6 +130,10 @@
H.drop_from_inventory(boots)
boots.loc = src
if(tank)
tank.canremove = 1
tank.loc = src
/obj/item/clothing/suit/space/void/verb/toggle_helmet()
set name = "Toggle Helmet"
@@ -127,7 +153,7 @@
if(H.wear_suit != src) return
if(H.head == helmet)
H << "\blue You retract your suit helmet."
H << "<span class='notice'>You retract your suit helmet.</span>"
helmet.canremove = 1
H.drop_from_inventory(helmet)
helmet.loc = src
@@ -138,9 +164,32 @@
if(H.equip_to_slot_if_possible(helmet, slot_head))
helmet.pickup(H)
helmet.canremove = 0
H << "<font color='blue'><b>You deploy your suit helmet, sealing you off from the world.</b></font>"
H << "<span class='info'>You deploy your suit helmet, sealing you off from the world.</span>"
helmet.update_light(H)
/obj/item/clothing/suit/space/void/verb/eject_tank()
set name = "Eject Tank"
set category = "Object"
set src in usr
if(!istype(src.loc,/mob/living)) return
if(!tank)
usr << "There is no tank inserted."
return
var/mob/living/carbon/human/H = usr
if(!istype(H)) return
if(H.stat) return
if(H.wear_suit != src) return
H << "<span class='info'>You press the emergency release, ejecting \the [tank] from your suit.</span>"
tank.canremove = 1
H.drop_from_inventory(tank)
src.tank = null
/obj/item/clothing/suit/space/void/attackby(obj/item/W as obj, mob/user as mob)
if(!istype(user,/mob/living)) return
@@ -150,7 +199,11 @@
return
if(istype(W,/obj/item/weapon/screwdriver))
if(helmet)
if(tank)
user << "You pop \the [tank] out of \the [src]'s storage compartment."
tank.loc = get_turf(src)
src.tank = null
else if(helmet)
user << "You detatch \the [helmet] from \the [src]'s helmet mount."
helmet.loc = get_turf(src)
src.helmet = null
@@ -179,5 +232,16 @@
W.loc = src
boots = W
return
else if(istype(W,/obj/item/weapon/tank))
if(tank)
user << "\The [src] already has an airtank installed."
else if(istype(W,/obj/item/weapon/tank/phoron))
user << "\The [W] cannot be inserted into \the [src]'s storage compartment."
else
user << "You insert \the [W] into \the [src]'s storage compartment."
user.drop_item()
W.loc = src
tank = W
return
..()
+4 -4
View File
@@ -13,7 +13,8 @@
/obj/item/weapon/reagent_containers/food/snacks/grown/New(newloc,planttype)
..()
if(!dried_type)
dried_type = type
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
@@ -354,9 +355,8 @@
seed.do_sting(H,src,pick("r_hand","l_hand"))
/obj/item/weapon/reagent_containers/food/snacks/grown/dropped(mob/user)
if(!..() || !seed)
return
if(seed.get_trait(TRAIT_BIOLUM))
..()
if(seed && seed.get_trait(TRAIT_BIOLUM))
user.SetLuminosity(user.luminosity - seed.get_trait(TRAIT_BIOLUM))
SetLuminosity(seed.get_trait(TRAIT_BIOLUM))
@@ -214,25 +214,18 @@
w_uniform.add_fingerprint(M)
var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
if(istype(r_hand,/obj/item/weapon/gun) || istype(l_hand,/obj/item/weapon/gun))
var/obj/item/weapon/gun/W = null
var/chance = 0
var/list/holding = list(get_active_hand() = 40, get_inactive_hand = 20)
if (istype(l_hand,/obj/item/weapon/gun))
W = l_hand
chance += hand ? 40 : 20
else if (istype(r_hand,/obj/item/weapon/gun))
W = r_hand
chance += !hand ? 40 : 20
if (prob(chance))
visible_message("<span class='danger'>[src]'s [W.name] goes off during struggle!")
//See if they have any guns that might go off
for(var/obj/item/weapon/gun/W in holding)
if(W && prob(holding[W]))
var/list/turfs = list()
for(var/turf/T in view())
turfs += T
var/turf/target = pick(turfs)
return W.afterattack(target,src)
if(turfs.len)
var/turf/target = pick(turfs)
visible_message("<span class='danger'>[src]'s [W] goes off during the struggle!</span>")
return W.afterattack(target,src)
var/randn = rand(1, 100)
if(!(species.flags & NO_SLIP) && randn <= 25)
@@ -245,39 +238,25 @@
visible_message("<span class='warning'>[M] attempted to push [src]!</span>")
return
var/talked = 0 // BubbleWrap
if(randn <= 60)
//BubbleWrap: Disarming breaks a pull
if(pulling)
visible_message("\red <b>[M] has broken [src]'s grip on [pulling]!</B>")
talked = 1
stop_pulling()
//See about breaking grips or pulls
if(break_all_grabs(M))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
return
//BubbleWrap: Disarming also breaks a grab - this will also stop someone being choked, won't it?
if(istype(l_hand, /obj/item/weapon/grab))
var/obj/item/weapon/grab/lgrab = l_hand
if(lgrab.affecting)
visible_message("\red <b>[M] has broken [src]'s grip on [lgrab.affecting]!</B>")
talked = 1
spawn(1)
del(lgrab)
if(istype(r_hand, /obj/item/weapon/grab))
var/obj/item/weapon/grab/rgrab = r_hand
if(rgrab.affecting)
visible_message("\red <b>[M] has broken [src]'s grip on [rgrab.affecting]!</B>")
talked = 1
spawn(1)
del(rgrab)
//End BubbleWrap
if(!talked) //BubbleWrap
drop_item()
visible_message("\red <B>[M] has disarmed [src]!</B>")
//Actually disarm them
for(var/obj/item/I in holding)
if(I)
drop_from_inventory(I)
visible_message("<span class='danger'>[M] has disarmed [src]!</span>")
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
return
//if M (and only M) has a grab on src, start dislocating limbs
if(grab_joint(M))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
return
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("\red <B>[M] attempted to disarm [src]!</B>")
return
@@ -302,7 +281,9 @@
return 1
/mob/living/carbon/human/proc/attack_joint(var/obj/item/W, var/mob/living/user, var/def_zone)
var/target_zone = def_zone? check_zone(def_zone) : get_zone_with_miss_chance(user.zone_sel.selecting, src)
if(!def_zone) def_zone = user.zone_sel.selecting
var/target_zone = get_zone_with_miss_chance(check_zone(def_zone), src)
if(user == src) // Attacking yourself can't miss
target_zone = user.zone_sel.selecting
if(!target_zone)
@@ -312,6 +293,56 @@
return null
var/dislocation_str
if(prob(W.force))
dislocation_str = "[src]'s [organ.joint] [pick("gives way","caves in","crumbles","collapses")] with a grisly crunch!"
dislocation_str = "[src]'s [organ.joint] [pick("gives way","caves in","crumbles","collapses")]!"
organ.dislocate()
return dislocation_str
//Used to attack a joint through grabbing
/mob/living/carbon/human/proc/grab_joint(var/mob/living/user, var/def_zone)
var/has_grab = 0
for(var/obj/item/weapon/grab/G in list(user.l_hand, user.r_hand))
if(G.affecting == src && G.state == GRAB_NECK)
has_grab = 1
break
if(!has_grab)
return 0
if(!def_zone) def_zone = user.zone_sel.selecting
var/target_zone = check_zone(def_zone)
if(!target_zone)
return 0
var/obj/item/organ/external/organ = get_organ(check_zone(target_zone))
if(!organ || organ.is_dislocated() || organ.dislocated == -1)
return 0
user.visible_message("<span class='warning'>[user] begins to dislocate [src]'s [organ.joint]!</span>")
if(do_after(user, 100))
organ.dislocate()
src.visible_message("<span class='danger'>[src]'s [organ.joint] [pick("gives way","caves in","crumbles","collapses")]!</span>")
return 1
return 0
//Breaks all grips and pulls that the mob currently has.
/mob/living/carbon/human/proc/break_all_grabs(mob/living/carbon/user)
var/success = 0
if(pulling)
visible_message("<span class='danger'>[user] has broken [src]'s grip on [pulling]!</span>")
success = 1
stop_pulling()
if(istype(l_hand, /obj/item/weapon/grab))
var/obj/item/weapon/grab/lgrab = l_hand
if(lgrab.affecting)
visible_message("<span class='danger'>[user] has broken [src]'s grip on [lgrab.affecting]!</span>")
success = 1
spawn(1)
del(lgrab)
if(istype(r_hand, /obj/item/weapon/grab))
var/obj/item/weapon/grab/rgrab = r_hand
if(rgrab.affecting)
visible_message("<span class='danger'>[user] has broken [src]'s grip on [rgrab.affecting]!</span>")
success = 1
spawn(1)
del(rgrab)
return success
@@ -72,7 +72,7 @@
var/obj/item/organ/external/E = organs_by_name[limb_tag]
if(!E || (E.status & (ORGAN_DESTROYED|ORGAN_DEAD)))
stance_damage += 2 // let it fail even if just foot&leg
else if (E.is_malfunctioning() || (E.is_broken() && !(E.status & ORGAN_SPLINTED)) || (E.status & ORGAN_MUTATED))
else if (E.is_malfunctioning() || E.is_broken() || !E.is_usable())
stance_damage += 1
else if (E.is_dislocated())
stance_damage += 0.5
+1 -5
View File
@@ -36,12 +36,8 @@
if(istype(src,/mob/living/carbon/human))
var/mob/living/carbon/human/M = src
for(var/obj/item/organ/external/organ in M.organs)
if (!organ)
continue
else if(organ.status & ORGAN_BROKEN || organ.open)
if(organ && (organ.is_broken() || organ.open))
src.traumatic_shock += 30
if(organ.status & ORGAN_SPLINTED)
src.traumatic_shock -= 25
if(src.traumatic_shock < 0)
src.traumatic_shock = 0
+2 -1
View File
@@ -376,7 +376,8 @@ default behaviour is:
/mob/living/proc/revive()
rejuvenate()
buckled = initial(src.buckled)
if(buckled)
buckled.unbuckle_mob()
if(iscarbon(src))
var/mob/living/carbon/C = src
+6 -4
View File
@@ -46,7 +46,7 @@ var/list/ai_verbs_default = list(
density = 1
status_flags = CANSTUN|CANPARALYSE|CANPUSH
shouldnt_see = list(/obj/effect/rune)
var/list/network = list("SS13")
var/list/network = list("Exodus")
var/obj/machinery/camera/camera = null
var/list/connected_robots = list()
var/aiRestorePowerRoutine = 0
@@ -530,6 +530,8 @@ var/list/ai_verbs_default = list(
view_core()
return
src.network = network
for(var/obj/machinery/camera/C in cameranet.cameras)
if(!C.can_use())
continue
@@ -691,14 +693,14 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/proc/check_unable(var/flags = 0)
if(stat == DEAD)
usr << "\red You are dead!"
src << "<span class='warning'>You are dead!</span>"
return 1
if((flags & AI_CHECK_WIRELESS) && src.control_disabled)
usr << "\red Wireless control is disabled!"
src << "<span class='warning'>Wireless control is disabled!</span>"
return 1
if((flags & AI_CHECK_RADIO) && src.aiRadio.disabledAi)
src << "\red System Error - Transceiver Disabled!"
src << "<span class='warning'>System Error - Transceiver Disabled!</span>"
return 1
return 0
@@ -14,7 +14,7 @@
lawupdate = 0
density = 1
req_access = list(access_engine, access_robotics)
integrated_light_power = 2
integrated_light_power = 3
local_transmit = 1
mob_bump_flag = SIMPLE_ANIMAL
@@ -24,6 +24,11 @@
//Used for self-mailing.
var/mail_destination = ""
var/obj/machinery/drone_fabricator/master_fabricator
var/law_type = /datum/ai_laws/drone
var/module_type = /obj/item/weapon/robot_module/drone
var/can_pull_size = 2
var/can_pull_mobs
holder_type = /obj/item/weapon/holder/drone
@@ -36,9 +41,6 @@
add_language("Robot Talk", 0)
add_language("Drone Talk", 1)
if(camera && "Robots" in camera.network)
camera.add_network("Engineering")
//They are unable to be upgraded, so let's give them a bit of a better battery.
cell.maxcharge = 10000
cell.charge = 10000
@@ -52,16 +54,18 @@
C.max_damage = 10
verbs -= /mob/living/silicon/robot/verb/Namepick
module = new /obj/item/weapon/robot_module/drone(src)
//Some tidying-up.
flavor_text = "It's a tiny little repair drone. The casing is stamped with an NT logo and the subscript: 'NanoTrasen Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'"
updateicon()
/mob/living/silicon/robot/drone/init()
laws = new /datum/ai_laws/drone()
if(!laws) laws = new law_type
if(!module) module = new module_type(src)
aiCamera = new/obj/item/device/camera/siliconcam/drone_camera(src)
flavor_text = "It's a tiny little repair drone. The casing is stamped with an NT logo and the subscript: 'NanoTrasen Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'"
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0)
spawn(1)
if(camera && ("Robots" in camera.network))
camera.add_network("Engineering")
//Redefining some robot procs...
/mob/living/silicon/robot/drone/SetName(pickedName as text)
@@ -91,26 +95,26 @@
/mob/living/silicon/robot/drone/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/borg/upgrade/))
user << "\red The maintenance drone chassis not compatible with \the [W]."
user << "<span class='danger'>\The [src] is not compatible with \the [W].</span>"
return
else if (istype(W, /obj/item/weapon/crowbar))
user << "The machine is hermetically sealed. You can't open the case."
user << "<span class='danger'>\The [src] is hermetically sealed. You can't open the case.</span>"
return
else if (istype(W, /obj/item/weapon/card/emag))
if(!client || stat == 2)
user << "\red There's not much point subverting this heap of junk."
user << "<span class='danger'>There's not much point subverting this heap of junk.</span>"
return
if(emagged)
src << "\red [user] attempts to load subversive software into you, but your hacked subroutined ignore the attempt."
user << "\red You attempt to subvert [src], but the sequencer has no effect."
src << "<span class='danger'>\The [user] attempts to load subversive software into you, but your hacked subroutines ignore the attempt.</span>"
user << "<span class='danger'>You attempt to subvert [src], but the sequencer has no effect.</span>"
return
user << "\red You swipe the sequencer across [src]'s interface and watch its eyes flicker."
src << "\red You feel a sudden burst of malware loaded into your execute-as-root buffer. Your tiny brain methodically parses, loads and executes the script."
user << "<span class='danger'>You swipe the sequencer across [src]'s interface and watch its eyes flicker.</span>"
src << "<span class='danger'>You feel a sudden burst of malware loaded into your execute-as-root buffer. Your tiny brain methodically parses, loads and executes the script.</span>"
var/obj/item/weapon/card/emag/emag = W
emag.uses--
@@ -130,7 +134,7 @@
src << "<b>Obey these laws:</b>"
laws.show_laws(src)
src << "\red \b ALERT: [user.real_name] is your new master. Obey your new laws and his commands."
src << "<span class='danger'>ALERT: [user.real_name] is your new master. Obey your new laws and his commands.</span>"
return
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
@@ -138,14 +142,14 @@
if(stat == 2)
if(!config.allow_drone_spawn || emagged || health < -35) //It's dead, Dave.
user << "\red The interface is fried, and a distressing burned smell wafts from the robot's interior. You're not rebooting this one."
user << "<span class='danger'>The interface is fried, and a distressing burned smell wafts from the robot's interior. You're not rebooting this one.</span>"
return
if(!allowed(usr))
user << "\red Access denied."
user << "<span class='danger'>Access denied.</span>"
return
user.visible_message("\red \the [user] swipes \his ID card through \the [src], attempting to reboot it.", "\red You swipe your ID card through \the [src], attempting to reboot it.")
user.visible_message("<span class='danger'>\The [user] swipes \his ID card through \the [src], attempting to reboot it.</span>", "<span class='danger'>>You swipe your ID card through \the [src], attempting to reboot it.</span>")
var/drones = 0
for(var/mob/living/silicon/robot/drone/D in world)
if(D.key && D.client)
@@ -155,7 +159,7 @@
return
else
user.visible_message("\red \the [user] swipes \his ID card through \the [src], attempting to shut it down.", "\red You swipe your ID card through \the [src], attempting to shut it down.")
user.visible_message("<span class='danger'>\The [user] swipes \his ID card through \the [src], attempting to shut it down.</span>", "<span class='danger'>You swipe your ID card through \the [src], attempting to shut it down.</span>")
if(emagged)
return
@@ -163,7 +167,7 @@
if(allowed(usr))
shut_down()
else
user << "\red Access denied."
user << "<span class='danger'>Access denied.</span>"
return
@@ -185,7 +189,7 @@
//Drones killed by damage will gib.
/mob/living/silicon/robot/drone/handle_regular_status_updates()
if(health <= -35 && src.stat != 2)
if((health <= -35 || (master_fabricator && src.z != master_fabricator.z)) && src.stat != 2)
timeofdeath = world.time
death() //Possibly redundant, having trouble making death() cooperate.
gib()
@@ -194,32 +198,31 @@
//DRONE MOVEMENT.
/mob/living/silicon/robot/drone/Process_Spaceslipping(var/prob_slip)
//TODO: Consider making a magboot item for drones to equip. ~Z
return 0
//CONSOLE PROCS
/mob/living/silicon/robot/drone/proc/law_resync()
if(stat != 2)
if(emagged)
src << "\red You feel something attempting to modify your programming, but your hacked subroutines are unaffected."
src << "<span class='danger'>You feel something attempting to modify your programming, but your hacked subroutines are unaffected.</span>"
else
src << "\red A reset-to-factory directive packet filters through your data connection, and you obediently modify your programming to suit it."
src << "<span class='danger'>A reset-to-factory directive packet filters through your data connection, and you obediently modify your programming to suit it.</span>"
full_law_reset()
show_laws()
/mob/living/silicon/robot/drone/proc/shut_down()
if(stat != 2)
if(emagged)
src << "\red You feel a system kill order percolate through your tiny brain, but it doesn't seem like a good idea to you."
src << "<span class='danger'>You feel a system kill order percolate through your tiny brain, but it doesn't seem like a good idea to you.</span>"
else
src << "\red You feel a system kill order percolate through your tiny brain, and you obediently destroy yourself."
src << "<span class='danger'>You feel a system kill order percolate through your tiny brain, and you obediently destroy yourself.</span>"
death()
/mob/living/silicon/robot/drone/proc/full_law_reset()
clear_supplied_laws()
clear_inherent_laws()
clear_ion_laws()
laws = new /datum/ai_laws/drone
laws = new law_type
//Reboot procs.
@@ -267,17 +270,32 @@
..()
else if(istype(AM,/obj/item))
var/obj/item/O = AM
if(O.w_class > 2)
if(O.w_class > can_pull_size)
src << "<span class='warning'>You are too small to pull that.</span>"
return
else
..()
else
src << "<span class='warning'>You are too small to pull that.</span>"
return
if(!can_pull_mobs)
src << "<span class='warning'>You are too small to pull that.</span>"
return
/mob/living/silicon/robot/drone/add_robot_verbs()
src.verbs |= silicon_verbs_subsystems
/mob/living/silicon/robot/drone/remove_robot_verbs()
src.verbs -= silicon_verbs_subsystems
/mob/living/silicon/robot/drone/construction
law_type = /datum/ai_laws/construction_drone
module_type = /obj/item/weapon/robot_module/drone/construction
can_pull_size = 5
can_pull_mobs = 1
/mob/living/silicon/robot/drone/construction/init()
..()
flavor_text = "It's a bulky construction drone stamped with a Sol Central glyph."
/mob/living/silicon/robot/drone/construction/updatename()
real_name = "construction drone ([rand(100,999)])"
name = real_name
@@ -19,7 +19,7 @@
return
if(!allowed(user))
user << "\red Access denied."
user << "<span class='danger'>Access denied.</span>"
return
user.set_machine(src)
@@ -27,6 +27,8 @@
dat += "<B>Maintenance Units</B><BR>"
for(var/mob/living/silicon/robot/drone/D in world)
if(D.z != src.z)
continue
dat += "<BR>[D.real_name] ([D.stat == 2 ? "<font color='red'>INACTIVE" : "<font color='green'>ACTIVE"]</FONT>)"
dat += "<font dize = 9><BR>Cell charge: [D.cell.charge]/[D.cell.maxcharge]."
dat += "<BR>Currently located in: [get_area(D)]."
@@ -46,7 +48,7 @@
return
if(!allowed(usr))
usr << "\red Access denied."
usr << "<span class='danger'>Access denied.</span>"
return
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
@@ -61,11 +63,11 @@
return
drone_call_area = t_area
usr << "\blue You set the area selector to [drone_call_area]."
usr << "<span class='notice'>You set the area selector to [drone_call_area].</span>"
else if (href_list["ping"])
usr << "\blue You issue a maintenance request for all active drones, highlighting [drone_call_area]."
usr << "<span class='notice'>You issue a maintenance request for all active drones, highlighting [drone_call_area].</span>"
for(var/mob/living/silicon/robot/drone/D in world)
if(D.client && D.stat == 0)
D << "-- Maintenance drone presence requested in: [drone_call_area]."
@@ -75,7 +77,7 @@
var/mob/living/silicon/robot/drone/D = locate(href_list["resync"])
if(D.stat != 2)
usr << "\red You issue a law synchronization directive for the drone."
usr << "<span class='danger'>You issue a law synchronization directive for the drone.</span>"
D.law_resync()
else if (href_list["shutdown"])
@@ -83,7 +85,7 @@
var/mob/living/silicon/robot/drone/D = locate(href_list["shutdown"])
if(D.stat != 2)
usr << "\red You issue a kill command for the unfortunate drone."
usr << "<span class='danger'>You issue a kill command for the unfortunate drone.</span>"
message_admins("[key_name_admin(usr)] issued kill order for drone [key_name_admin(D)] from control console.")
log_game("[key_name(usr)] issued kill order for [key_name(src)] from control console.")
D.shut_down()
@@ -98,10 +100,10 @@
continue
dronefab = fab
usr << "\blue Drone fabricator located."
usr << "<span class='notice'>Drone fabricator located.</span>"
return
usr << "\red Unable to locate drone fabricator."
usr << "<span class='danger'>Unable to locate drone fabricator.</span>"
else if (href_list["toggle_fab"])
@@ -110,10 +112,10 @@
if(get_dist(src,dronefab) > 3)
dronefab = null
usr << "\red Unable to locate drone fabricator."
usr << "<span class='danger'>Unable to locate drone fabricator.</span>"
return
dronefab.produce_drones = !dronefab.produce_drones
usr << "\blue You [dronefab.produce_drones ? "enable" : "disable"] drone production in the nearby fabricator."
usr << "<span class='notice'>You [dronefab.produce_drones ? "enable" : "disable"] drone production in the nearby fabricator.</span>"
src.updateUsrDialog()
@@ -2,10 +2,12 @@
//Limited use.
/obj/item/weapon/gripper
name = "magnetic gripper"
desc = "A simple grasping tool for synthetic assets."
desc = "A simple grasping tool specialized in construction and engineering work."
icon = 'icons/obj/device.dmi'
icon_state = "gripper"
flags = NOBLUDGEON
//Has a list of items that it can hold.
var/list/can_hold = list(
/obj/item/weapon/cell,
@@ -28,8 +30,14 @@
var/obj/item/wrapped = null // Item currently being held.
var/force_holder = null //
// VEEEEERY limited version for mining borgs. Basically only for swapping cells and upgrading the drills.
/obj/item/weapon/gripper/miner
name = "drill maintenance gripper"
desc = "A simple grasping tool for the maintenance of heavy drilling machines."
icon_state = "gripper-mining"
can_hold = list(
/obj/item/weapon/cell,
/obj/item/weapon/stock_parts
@@ -38,14 +46,58 @@
/obj/item/weapon/gripper/paperwork
name = "paperwork gripper"
desc = "A simple grasping tool for clerical work."
icon = 'icons/obj/device.dmi'
icon_state = "gripper"
can_hold = list(
/obj/item/weapon/clipboard,
/obj/item/weapon/paper,
/obj/item/weapon/paper_bundle,
/obj/item/weapon/card/id
/obj/item/weapon/card/id,
/obj/item/weapon/book,
/obj/item/weapon/newspaper
)
/obj/item/weapon/gripper/research //A general usage gripper, used for toxins/robotics/xenobio/etc
name = "scientific gripper"
icon_state = "gripper-sci"
desc = "A simple grasping tool suited to assist in a wide array of research applications."
can_hold = list(
/obj/item/weapon/cell,
/obj/item/weapon/stock_parts,
/obj/item/device/mmi,
/obj/item/robot_parts,
/obj/item/borg/upgrade,
/obj/item/device/flash, //to build borgs
/obj/item/organ/brain, //to insert into MMIs.
/obj/item/stack/cable_coil, //again, for borg building
/obj/item/weapon/circuitboard,
/obj/item/slime_extract,
/obj/item/weapon/reagent_containers/glass,
/obj/item/weapon/reagent_containers/food/snacks/monkeycube
)
/obj/item/weapon/gripper/service //Used to handle food, drinks, and seeds.
name = "service gripper"
icon_state = "gripper"
desc = "A simple grasping tool used to perform tasks in the service sector, such as handling food, drinks, and seeds."
can_hold = list(
/obj/item/weapon/reagent_containers/glass,
/obj/item/weapon/reagent_containers/food,
/obj/item/seeds,
/obj/item/weapon/grown
)
/obj/item/weapon/gripper/no_use //Used when you want to hold and put items in other things, but not able to 'use' the item
/obj/item/weapon/gripper/no_use/loader //This is used to disallow building with metal.
name = "sheet loader"
desc = "A specialized loading device, designed to pick up and insert sheets of materials inside machines."
icon_state = "gripper-sheet"
can_hold = list(
/obj/item/stack/sheet
)
/obj/item/weapon/gripper/attack_self(mob/user as mob)
@@ -53,6 +105,9 @@
return wrapped.attack_self(user)
return ..()
/obj/item/weapon/gripper/no_use/attack_self(mob/user as mob)
return
/obj/item/weapon/gripper/verb/drop_item()
set name = "Drop Item"
@@ -75,7 +130,12 @@
//update_icon()
/obj/item/weapon/gripper/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
return (wrapped ? wrapped.attack(M,user) : 0)
if(wrapped) //The force of the wrapped obj gets set to zero during the attack() and afterattack().
force_holder = wrapped.force
wrapped.force = 0.0
wrapped.attack(M,user)
return 1
return 0
/obj/item/weapon/gripper/afterattack(var/atom/target, var/mob/living/user, proximity, params)
@@ -97,6 +157,9 @@
if(!resolved && wrapped && target)
wrapped.afterattack(target,user,1)
//wrapped's force was set to zero. This resets it to the value it had before.
wrapped.force = force_holder
force_holder = null
//If wrapped was neither deleted nor put into target, put it back into the gripper.
if(wrapped && user && (wrapped.loc == user))
wrapped.loc = src
@@ -145,6 +208,21 @@
user.visible_message("<span class='danger'>[user] removes the power cell from [A]!</span>", "You remove the power cell.")
else if(istype(target,/mob/living/silicon/robot))
var/mob/living/silicon/robot/A = target
if(A.opened)
if(A.cell)
wrapped = A.cell
A.cell.add_fingerprint(user)
A.cell.updateicon()
A.updateicon()
A.cell.loc = src
A.cell = null
user.visible_message("<span class='danger'>[user] removes the power cell from [A]!</span>", "You remove the power cell.")
//TODO: Matter decompiler.
/obj/item/weapon/matter_decompiler
@@ -1,3 +1,10 @@
/proc/count_drones()
var/drones = 0
for(var/mob/living/silicon/robot/drone/D in world)
if(D.key && D.client)
drones++
return drones
/obj/machinery/drone_fabricator
name = "drone fabricator"
desc = "A large automated factory for producing maintenance drones."
@@ -8,13 +15,20 @@
idle_power_usage = 20
active_power_usage = 5000
var/fabricator_tag = "Exodus"
var/drone_progress = 0
var/produce_drones = 1
var/time_last_drone = 500
var/drone_type = /mob/living/silicon/robot/drone
icon = 'icons/obj/machines/drone_fab.dmi'
icon_state = "drone_fab_idle"
/obj/machinery/drone_fabricator/derelict
name = "construction drone fabricator"
fabricator_tag = "Derelict"
drone_type = /mob/living/silicon/robot/drone/construction
/obj/machinery/drone_fabricator/New()
..()
@@ -48,13 +62,6 @@
if(produce_drones && drone_progress >= 100 && istype(user,/mob/dead) && config.allow_drone_spawn && count_drones() < config.max_maint_drones)
user << "<BR><B>A drone is prepared. Select 'Join As Drone' from the Ghost tab to spawn as a maintenance drone.</B>"
/obj/machinery/drone_fabricator/proc/count_drones()
var/drones = 0
for(var/mob/living/silicon/robot/drone/D in world)
if(D.key && D.client)
drones++
return drones
/obj/machinery/drone_fabricator/proc/create_drone(var/client/player)
if(stat & NOPOWER)
@@ -71,13 +78,12 @@
flick("h_lathe_leave",src)
time_last_drone = world.time
var/mob/living/silicon/robot/drone/new_drone = new(get_turf(src))
var/mob/living/silicon/robot/drone/new_drone = new drone_type(get_turf(src))
new_drone.transfer_personality(player)
new_drone.master_fabricator = src
drone_progress = 0
/mob/dead/verb/join_as_drone()
set category = "Ghost"
@@ -86,11 +92,11 @@
if(ticker.current_state < GAME_STATE_PLAYING)
src << "\red The game hasn't started yet!"
src << "<span class='danger'>The game hasn't started yet!</span>"
return
if(!(config.allow_drone_spawn))
src << "\red That verb is not currently permitted."
src << "<span class='danger'>That verb is not currently permitted.</span>"
return
if (!src.stat)
@@ -100,14 +106,14 @@
return 0 //something is terribly wrong
if(jobban_isbanned(src,"Cyborg"))
usr << "\red You are banned from playing synthetics and cannot spawn as a drone."
usr << "<span class='danger'>You are banned from playing synthetics and cannot spawn as a drone.</span>"
return
var/deathtime = world.time - src.timeofdeath
if(istype(src,/mob/dead/observer))
var/mob/dead/observer/G = src
if(G.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
usr << "\blue <B>Upon using the antagHUD you forfeighted the ability to join the round.</B>"
usr << "<span class='notice'>Upon using the antagHUD you forfeighted the ability to join the round.</span>"
return
var/deathtimeminutes = round(deathtime / 600)
@@ -125,16 +131,18 @@
usr << "You must wait 10 minutes to respawn as a drone!"
return
var/list/all_fabricators = list()
for(var/obj/machinery/drone_fabricator/DF in world)
if(DF.stat & NOPOWER || !DF.produce_drones)
continue
if(DF.count_drones() >= config.max_maint_drones)
src << "\red There are too many active drones in the world for you to spawn."
return
if(DF.drone_progress >= 100)
DF.create_drone(src.client)
return
all_fabricators[DF.fabricator_tag] = DF
src << "\red There are no available drone spawn points, sorry."
if(!all_fabricators.len)
src << "<span class='danger'>There are no available drone spawn points, sorry.</span>"
return
var/choice = input(src,"Which fabricator do you wish to use?") as null|anything in all_fabricators
if(choice)
var/obj/machinery/drone_fabricator/chosen_fabricator = all_fabricators[choice]
chosen_fabricator.create_drone(src.client)
+15 -3
View File
@@ -265,7 +265,8 @@
module_sprites["Bro"] = "Brobot"
module_sprites["Rich"] = "maximillion"
module_sprites["Default"] = "Service2"
module_sprites["Drone"] = "drone-service" // How does this even work...? Oh well.
module_sprites["Drone - Service"] = "drone-service"
module_sprites["Drone - Hydro"] = "drone-hydro"
if("Clerical")
module = new /obj/item/weapon/robot_module/clerical(src)
@@ -277,6 +278,12 @@
module_sprites["Default"] = "Service2"
module_sprites["Drone"] = "drone-service"
if("Research")
module = new /obj/item/weapon/robot_module/research(src)
module.channels = list("Science" = 1)
module_sprites["Droid"] = "droid-science"
module_sprites["Drone"] = "drone-science"
if("Miner")
module = new /obj/item/weapon/robot_module/miner(src)
module.channels = list("Supply" = 1)
@@ -296,7 +303,8 @@
module_sprites["Standard"] = "surgeon"
module_sprites["Advanced Droid"] = "droid-medical"
module_sprites["Needles"] = "medicalrobot"
module_sprites["Drone" ] = "drone-medical"
module_sprites["Drone - Medical" ] = "drone-medical"
module_sprites["Drone - Chemistry" ] = "drone-chemistry"
if("Surgeon")
module = new /obj/item/weapon/robot_module/surgeon(src)
@@ -731,7 +739,7 @@
else
user << "Unable to locate a radio."
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) // trying to unlock the interface with an ID card
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)||istype(W, /obj/item/weapon/card/robot)) // trying to unlock the interface with an ID card
if(emagged)//still allow them to open the cover
user << "The interface seems slightly damaged"
if(opened)
@@ -868,6 +876,10 @@
//if they are holding or wearing a card that has access, that works
if(check_access(H.get_active_hand()) || check_access(H.wear_id))
return 1
else if(istype(M, /mob/living/silicon/robot))
var/mob/living/silicon/robot/R = M
if(check_access(R.get_active_hand()) || istype(R.get_active_hand(), /obj/item/weapon/card/robot))
return 1
return 0
/mob/living/silicon/robot/proc/check_access(obj/item/weapon/card/id/I)
@@ -1,3 +1,138 @@
//A portable analyzer, for research borgs. This is better then giving them a gripper which can hold anything and letting them use the normal analyzer.
/obj/item/weapon/portable_destructive_analyzer
name = "Portable Destructive Analyzer"
icon = 'icons/obj/items.dmi'
icon_state = "portable_analyzer"
desc = "Similar to the stationary version, this rather unwieldy device allows you to break down objects in the name of science."
var/min_reliability = 90 //Can't upgrade, call it laziness or a drawback
var/datum/research/techonly/files //The device uses the same datum structure as the R&D computer/server.
//This analyzer can only store tech levels, however.
var/obj/item/weapon/loaded_item //What is currently inside the analyzer.
/obj/item/weapon/portable_destructive_analyzer/New()
..()
files = new /datum/research/techonly(src) //Setup the research data holder.
/obj/item/weapon/portable_destructive_analyzer/attack_self(user as mob)
var/response = alert(user, "Analyzing the item inside will *DESTROY* the item for good.\n\
Syncing to the research server will send the data that is stored inside to research.\n\
Ejecting will place the loaded item onto the floor.",
"What would you like to do?", "Analyze", "Sync", "Eject")
if(response == "Analyze")
if(loaded_item)
var/confirm = alert(user, "This will destroy the item inside forever. Are you sure?","Confirm Analyze","Yes","No")
if(confirm == "Yes") //This is pretty copypasta-y
user << "You activate the analyzer's microlaser, analyzing \the [loaded_item] and breaking it down."
flick("portable_analyzer_scan", src)
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
if(loaded_item.reliability >= min_reliability)
var/list/temp_tech = ConvertReqString2List(loaded_item.origin_tech)
for(var/T in temp_tech)
files.UpdateTech(T, temp_tech[T])
user << "\The [loaded_item] had level [temp_tech[T]] in [T]."
loaded_item = null
for(var/obj/I in contents)
for(var/mob/M in I.contents)
M.death()
if(istype(I,/obj/item/stack/sheet))//Only deconsturcts one sheet at a time instead of the entire stack
var/obj/item/stack/sheet/S = I
if(S.get_amount() > 1)
S.use(1)
loaded_item = S
else
del(S)
desc = initial(desc)
icon_state = initial(icon_state)
else
del(I)
desc = initial(desc)
icon_state = initial(icon_state)
else
return
else
user << "The [src] is empty. Put something inside it first."
if(response == "Sync")
var/success = 0
for(var/obj/machinery/r_n_d/server/S in machines)
if(S.disabled)
continue
for(var/datum/tech/T in files.known_tech) //Uploading
S.files.AddTech2Known(T)
for(var/datum/tech/T in S.files.known_tech) //Downloading
files.AddTech2Known(T)
success = 1
files.RefreshResearch()
if(success)
user << "You connect to the research server, push your data upstream to it, then pull the resulting merged data from the master branch."
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1)
else
user << "Reserch server ping response timed out. Unable to connect. Please contact the system administrator."
playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 1)
if(response == "Eject")
if(loaded_item)
loaded_item.loc = get_turf(src)
desc = initial(desc)
icon_state = initial(icon_state)
loaded_item = null
else
user << "The [src] is already empty."
/obj/item/weapon/portable_destructive_analyzer/afterattack(var/atom/target, var/mob/living/user, proximity)
if(!target)
return
if(!proximity)
return
if(!isturf(target.loc)) // Don't load up stuff if it's inside a container or mob!
return
if(istype(target,/obj/item))
if(loaded_item)
user << "Your [src] already has something inside. Analyze or eject it first."
return
var/obj/item/I = target
I.loc = src
loaded_item = I
for(var/mob/M in viewers())
M.show_message(text("<span class='notice'>[user] adds the [I] to the [src].</span>"), 1)
desc = initial(desc) + "<br>It is holding \the [loaded_item]."
flick("portable_analyzer_load", src)
icon_state = "portable_analyzer_full"
//This is used to unlock other borg covers.
/obj/item/weapon/card/robot //This is not a child of id cards, as to avoid dumb typechecks on computers.
name = "access code transmission device"
icon_state = "id-robot"
desc = "A circuit grafted onto the bottom of an ID card. It is used to transmit access codes into other robot chassis, \
allowing you to lock and unlock other robots' panels."
/obj/item/weapon/card/id/robot/attack_self() //override so borgs can't flash their IDs.
return
/obj/item/weapon/card/id/robot/read()
usr << "The ID card does not appear to have any writing on it."
return
//A harvest item for serviceborgs.
/obj/item/weapon/robot_harvester
name = "auto harvester"
desc = "A hand-held harvest tool that resembles a sickle. It uses energy to cut plant matter very efficently."
icon = 'icons/obj/weapons.dmi'
icon_state = "autoharvester"
/obj/item/weapon/robot_harvester/afterattack(var/atom/target, var/mob/living/user, proximity)
if(!target)
return
if(!proximity)
return
if(istype(target,/obj/machinery/portable_atmospherics/hydroponics))
var/obj/machinery/portable_atmospherics/hydroponics/T = target
T.harvest(user)
else
user << "Harvesting \a [target] is not the purpose of this tool. The [src] is for plants being grown."
// A special tray for the service droid. Allow droid to pick up and drop items as if they were using the tray normally
// Click on table to unload, click on item to load. Otherwise works identically to a tray.
// Unlike the base item "tray", robotrays ONLY pick up food, drinks and condiments.
@@ -314,8 +314,13 @@
/obj/item/weapon/robot_module/butler/New()
..()
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/weapon/reagent_containers/food/drinks/cans/beer(src)
src.modules += new /obj/item/weapon/reagent_containers/food/condiment/enzyme(src)
src.modules += new /obj/item/weapon/gripper/service(src)
src.modules += new /obj/item/weapon/reagent_containers/glass/bucket(src)
src.modules += new /obj/item/weapon/minihoe(src)
src.modules += new /obj/item/weapon/hatchet(src)
src.modules += new /obj/item/device/analyzer/plant_analyzer(src)
src.modules += new /obj/item/weapon/storage/bag/plants(src)
src.modules += new /obj/item/weapon/robot_harvester(src)
var/obj/item/weapon/rsf/M = new /obj/item/weapon/rsf(src)
M.stored_matter = 30
@@ -358,6 +363,7 @@
src.modules += new /obj/item/weapon/pen/robopen(src)
src.modules += new /obj/item/weapon/form_printer(src)
src.modules += new /obj/item/weapon/gripper/paperwork(src)
src.modules += new /obj/item/weapon/hand_labeler(src)
src.emag = new /obj/item/weapon/stamp/denied(src)
/obj/item/weapon/robot_module/clerical/add_languages(var/mob/living/silicon/robot/R)
@@ -395,6 +401,38 @@
src.emag = new /obj/item/weapon/pickaxe/plasmacutter(src)
return
/obj/item/weapon/robot_module/research
name = "research module"
/obj/item/weapon/robot_module/research/New()
..()
src.modules += new /obj/item/device/flash(src)
src.modules += new /obj/item/weapon/portable_destructive_analyzer(src)
src.modules += new /obj/item/weapon/gripper/research(src)
src.modules += new /obj/item/weapon/gripper/no_use/loader(src)
src.modules += new /obj/item/device/robotanalyzer(src)
src.modules += new /obj/item/weapon/card/robot(src)
src.modules += new /obj/item/weapon/wrench(src)
src.modules += new /obj/item/weapon/screwdriver(src)
src.modules += new /obj/item/weapon/crowbar(src)
src.modules += new /obj/item/weapon/scalpel(src)
src.modules += new /obj/item/weapon/circular_saw(src)
src.modules += new /obj/item/weapon/extinguisher/mini(src)
src.modules += new /obj/item/weapon/reagent_containers/syringe(src)
src.modules += new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
src.emag = new /obj/item/weapon/hand_tele(src)
var/datum/matter_synth/nanite = new /datum/matter_synth/nanite(10000)
synths += nanite
var/obj/item/stack/nanopaste/N = new /obj/item/stack/nanopaste(src)
N.uses_charge = 1
N.charge_costs = list(1000)
N.synths = list(nanite)
src.modules += N
return
/obj/item/weapon/robot_module/syndicate
name = "illegal robot module"
@@ -446,7 +484,7 @@
src.modules += new /obj/item/device/multitool(src)
src.modules += new /obj/item/device/lightreplacer(src)
src.modules += new /obj/item/weapon/gripper(src)
src.modules += new /obj/item/weapon/reagent_containers/spray/cleaner/drone(src)
src.modules += new /obj/item/weapon/soap(src)
src.emag = new /obj/item/weapon/pickaxe/plasmacutter(src)
src.emag.name = "Plasma Cutter"
@@ -504,16 +542,19 @@
P.synths = list(plastic)
src.modules += P
/obj/item/weapon/robot_module/drone/construction
name = "construction drone module"
/obj/item/weapon/robot_module/drone/construction/New()
..()
src.modules += new /obj/item/weapon/rcd/borg(src)
/obj/item/weapon/robot_module/drone/add_languages(var/mob/living/silicon/robot/R)
return //not much ROM to spare in that tiny microprocessor!
/obj/item/weapon/robot_module/drone/respawn_consumable(var/mob/living/silicon/robot/R, var/amount)
var/obj/item/weapon/reagent_containers/spray/cleaner/C = locate() in src.modules
C.reagents.add_reagent("cleaner", 3 * amount)
var/obj/item/device/lightreplacer/LR = locate() in src.modules
LR.Charge(R, amount)
..()
return
@@ -521,7 +562,5 @@
/obj/item/proc/is_robot_module()
if (!istype(src.loc, /mob/living/silicon/robot))
return 0
var/mob/living/silicon/robot/R = src.loc
return (src in R.module.modules)
+2
View File
@@ -65,6 +65,8 @@
if(cameranet && !cameranet.checkTurfVis(get_turf(src_object)))
return apc_override ? STATUS_INTERACTIVE : STATUS_CLOSE
return STATUS_INTERACTIVE
else if(get_dist(src_object, src) <= client.view) // View does not return what one would expect while installed in an inteliCard
return STATUS_INTERACTIVE
return STATUS_CLOSE
+1 -1
View File
@@ -146,7 +146,7 @@ var/list/organ_cache = list()
return damage >= min_bruised_damage
/obj/item/organ/proc/is_broken()
return (damage >= min_broken_damage || (status & ORGAN_CUT_AWAY) || ((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED)))
return (damage >= min_broken_damage || (status & ORGAN_CUT_AWAY) || (status & ORGAN_BROKEN))
//Germs
/obj/item/organ/proc/handle_antibiotics()
+6 -2
View File
@@ -340,8 +340,12 @@ This function completely restores a damaged organ to perfect condition.
PROCESSING & UPDATING
****************************************************/
//Determines if we even need to process this organ.
//external organs handle brokenness a bit differently when it comes to damage. Instead brute_dam is checked inside process()
//this also ensures that an external organ cannot be "broken" without broken_description being set.
/obj/item/organ/external/is_broken()
return ((status & ORGAN_CUT_AWAY) || ((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED)))
//Determines if we even need to process this organ.
/obj/item/organ/external/proc/need_process()
if(status && status != ORGAN_ROBOT) // If it's robotic, that's fine it will have a status.
return 1
@@ -817,7 +821,7 @@ Note that amputating the affected organ does in fact remove the infection from t
name = "[R.company] [initial(name)]"
desc = "[R.desc]"
dislocated = -1
dislocated = -1 //TODO, make robotic limbs a separate type, remove snowflake
cannot_break = 1
get_icon()
for (var/obj/item/organ/external/T in children)
+15 -1
View File
@@ -324,7 +324,17 @@
if(href_list["write"])
var/id = href_list["write"]
//var/t = strip_html_simple(input(usr, "What text do you wish to add to " + (id=="end" ? "the end of the paper" : "field "+id) + "?", "[name]", null),8192) as message
var/t = sanitize(input("Enter what you want to write:", "Write", null, null) as message, MAX_PAPER_MESSAGE_LEN, extra = 0)
var/textlimit = MAX_PAPER_MESSAGE_LEN - length(info)
if(textlimit <= 0)
usr << "<span class='info'>There isn't enough space left on \the [src] to write anything.</span>"
return
var/t = sanitize(input("Enter what you want to write:", "Write", null, null) as message, textlimit, extra = 0)
if(!t)
return
var/obj/item/i = usr.get_active_hand() // Check to see if he still got that darn pen, also check if he's using a crayon or pen.
var/iscrayon = 0
if(!istype(i, /obj/item/weapon/pen))
@@ -347,6 +357,9 @@
message_admins("PAPER: [usr] ([usr.ckey]) tried to use forbidden word in [src]: [bad].")
return
*/
var last_fields_value = fields
//t = html_encode(t)
t = replacetext(t, "\n", "<BR>")
t = parsepencode(t, i, usr, iscrayon) // Encode everything from pencode to html
@@ -354,6 +367,7 @@
if(fields > 50)//large amount of fields creates a heavy load on the server, see updateinfolinks() and addtofield()
usr << "<span class='warning'>Too many fields. Sorry, you can't do this.</span>"
fields = last_fields_value
return
if(id!="end")
-934
View File
@@ -1,934 +0,0 @@
///////////////////////////////
//CABLE STRUCTURE
///////////////////////////////
////////////////////////////////
// Definitions
////////////////////////////////
/* Cable directions (d1 and d2)
9 1 5
\ | /
8 - 0 - 4
/ | \
10 2 6
If d1 = 0 and d2 = 0, there's no cable
If d1 = 0 and d2 = dir, it's a O-X cable, getting from the center of the tile to dir (knot cable)
If d1 = dir1 and d2 = dir2, it's a full X-X cable, getting from dir1 to dir2
By design, d1 is the smallest direction and d2 is the highest
*/
/obj/structure/cable
level = 1
anchored =1
var/datum/powernet/powernet
name = "power cable"
desc = "A flexible superconducting cable for heavy-duty power transfer"
icon = 'icons/obj/power_cond_white.dmi'
icon_state = "0-1"
var/d1 = 0
var/d2 = 1
layer = 2.44 //Just below unary stuff, which is at 2.45 and above pipes, which are at 2.4
color = COLOR_RED
var/obj/machinery/power/breakerbox/breaker_box
/obj/structure/cable/drain_power(var/drain_check, var/surge, var/amount = 0)
if(drain_check)
return 1
var/datum/powernet/PN = get_powernet()
if(!PN) return 0
return PN.draw_power(amount)
/obj/structure/cable/yellow
color = COLOR_YELLOW
/obj/structure/cable/green
color = COLOR_GREEN
/obj/structure/cable/blue
color = COLOR_BLUE
/obj/structure/cable/pink
color = COLOR_PINK
/obj/structure/cable/orange
color = COLOR_ORANGE
/obj/structure/cable/cyan
color = COLOR_CYAN
/obj/structure/cable/white
color = COLOR_WHITE
/obj/structure/cable/New()
..()
// ensure d1 & d2 reflect the icon_state for entering and exiting cable
var/dash = findtext(icon_state, "-")
d1 = text2num( copytext( icon_state, 1, dash ) )
d2 = text2num( copytext( icon_state, dash+1 ) )
var/turf/T = src.loc // hide if turf is not intact
if(level==1) hide(T.intact)
cable_list += src //add it to the global cable list
/obj/structure/cable/Del() // called when a cable is deleted
if(powernet)
cut_cable_from_powernet() // update the powernets
cable_list -= src //remove it from global cable list
..() // then go ahead and delete the cable
///////////////////////////////////
// General procedures
///////////////////////////////////
//If underfloor, hide the cable
/obj/structure/cable/hide(var/i)
if(level == 1 && istype(loc, /turf))
invisibility = i ? 101 : 0
updateicon()
/obj/structure/cable/proc/updateicon()
icon_state = "[d1]-[d2]"
alpha = invisibility ? 127 : 255
// returns the powernet this cable belongs to
/obj/structure/cable/proc/get_powernet() //TODO: remove this as it is obsolete
return powernet
//Telekinesis has no effect on a cable
/obj/structure/cable/attack_tk(mob/user)
return
// Items usable on a cable :
// - Wirecutters : cut it duh !
// - Cable coil : merge cables
// - Multitool : get the power currently passing through the cable
//
/obj/structure/cable/attackby(obj/item/W, mob/user)
var/turf/T = src.loc
if(T.intact)
return
if(istype(W, /obj/item/weapon/wirecutters))
///// Z-Level Stuff
if(src.d1 == 12 || src.d2 == 12)
user << "<span class='warning'>You must cut this cable from above.</span>"
return
///// Z-Level Stuff
if(breaker_box)
user << "\red This cable is connected to nearby breaker box. Use breaker box to interact with it."
return
if (shock(user, 50))
return
if(src.d1) // 0-X cables are 1 unit, X-X cables are 2 units long
new/obj/item/stack/cable_coil(T, 2, color)
else
new/obj/item/stack/cable_coil(T, 1, color)
for(var/mob/O in viewers(src, null))
O.show_message("<span class='warning'>[user] cuts the cable.</span>", 1)
///// Z-Level Stuff
if(src.d1 == 11 || src.d2 == 11)
var/turf/controllerlocation = locate(1, 1, z)
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
if(controller.down)
var/turf/below = locate(src.x, src.y, controller.down_target)
for(var/obj/structure/cable/c in below)
if(c.d1 == 12 || c.d2 == 12)
c.Del()
///// Z-Level Stuff
investigate_log("was cut by [key_name(usr, usr.client)] in [user.loc.loc]","wires")
del(src) // qdel
return
else if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/coil = W
if (coil.get_amount() < 1)
user << "Not enough cable"
return
coil.cable_join(src, user)
else if(istype(W, /obj/item/device/multitool))
if(powernet && (powernet.avail > 0)) // is it powered?
user << "<span class='warning'>[powernet.avail]W in power network.</span>"
else
user << "<span class='warning'>The cable is not powered.</span>"
shock(user, 5, 0.2)
else
if (W.flags & CONDUCT)
shock(user, 50, 0.7)
src.add_fingerprint(user)
// shock the user with probability prb
/obj/structure/cable/proc/shock(mob/user, prb, var/siemens_coeff = 1.0)
if(!prob(prb))
return 0
if (electrocute_mob(user, powernet, src, siemens_coeff))
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
if(usr.stunned)
return 1
return 0
//explosion handling
/obj/structure/cable/ex_act(severity)
switch(severity)
if(1.0)
del(src) // qdel
if(2.0)
if (prob(50))
new/obj/item/stack/cable_coil(src.loc, src.d1 ? 2 : 1, color)
del(src) // qdel
if(3.0)
if (prob(25))
new/obj/item/stack/cable_coil(src.loc, src.d1 ? 2 : 1, color)
del(src) // qdel
return
obj/structure/cable/proc/cableColor(var/colorC)
var/color_n = "#DD0000"
if(colorC)
color_n = colorC
color = color_n
/////////////////////////////////////////////////
// Cable laying helpers
////////////////////////////////////////////////
//handles merging diagonally matching cables
//for info : direction^3 is flipping horizontally, direction^12 is flipping vertically
/obj/structure/cable/proc/mergeDiagonalsNetworks(var/direction)
//search for and merge diagonally matching cables from the first direction component (north/south)
var/turf/T = get_step(src, direction&3)//go north/south
for(var/obj/structure/cable/C in T)
if(!C)
continue
if(src == C)
continue
if(C.d1 == (direction^3) || C.d2 == (direction^3)) //we've got a diagonally matching cable
if(!C.powernet) //if the matching cable somehow got no powernet, make him one (should not happen for cables)
var/datum/powernet/newPN = new()
newPN.add_cable(C)
if(powernet) //if we already have a powernet, then merge the two powernets
merge_powernets(powernet,C.powernet)
else
C.powernet.add_cable(src) //else, we simply connect to the matching cable powernet
//the same from the second direction component (east/west)
T = get_step(src, direction&12)//go east/west
for(var/obj/structure/cable/C in T)
if(!C)
continue
if(src == C)
continue
if(C.d1 == (direction^12) || C.d2 == (direction^12)) //we've got a diagonally matching cable
if(!C.powernet) //if the matching cable somehow got no powernet, make him one (should not happen for cables)
var/datum/powernet/newPN = new()
newPN.add_cable(C)
if(powernet) //if we already have a powernet, then merge the two powernets
merge_powernets(powernet,C.powernet)
else
C.powernet.add_cable(src) //else, we simply connect to the matching cable powernet
// merge with the powernets of power objects in the given direction
/obj/structure/cable/proc/mergeConnectedNetworks(var/direction)
var/fdir = (!direction)? 0 : turn(direction, 180) //flip the direction, to match with the source position on its turf
if(!(d1 == direction || d2 == direction)) //if the cable is not pointed in this direction, do nothing
return
var/turf/TB = get_step(src, direction)
for(var/obj/structure/cable/C in TB)
if(!C)
continue
if(src == C)
continue
if(C.d1 == fdir || C.d2 == fdir) //we've got a matching cable in the neighbor turf
if(!C.powernet) //if the matching cable somehow got no powernet, make him one (should not happen for cables)
var/datum/powernet/newPN = new()
newPN.add_cable(C)
if(powernet) //if we already have a powernet, then merge the two powernets
merge_powernets(powernet,C.powernet)
else
C.powernet.add_cable(src) //else, we simply connect to the matching cable powernet
// merge with the powernets of power objects in the source turf
/obj/structure/cable/proc/mergeConnectedNetworksOnTurf()
var/list/to_connect = list()
if(!powernet) //if we somehow have no powernet, make one (should not happen for cables)
var/datum/powernet/newPN = new()
newPN.add_cable(src)
//first let's add turf cables to our powernet
//then we'll connect machines on turf with a node cable is present
for(var/AM in loc)
if(istype(AM,/obj/structure/cable))
var/obj/structure/cable/C = AM
if(C.d1 == d1 || C.d2 == d1 || C.d1 == d2 || C.d2 == d2) //only connected if they have a common direction
if(C.powernet == powernet) continue
if(C.powernet)
merge_powernets(powernet, C.powernet)
else
powernet.add_cable(C) //the cable was powernetless, let's just add it to our powernet
else if(istype(AM,/obj/machinery/power/apc))
var/obj/machinery/power/apc/N = AM
if(!N.terminal) continue // APC are connected through their terminal
if(N.terminal.powernet == powernet)
continue
to_connect += N.terminal //we'll connect the machines after all cables are merged
else if(istype(AM,/obj/machinery/power)) //other power machines
var/obj/machinery/power/M = AM
if(M.powernet == powernet)
continue
to_connect += M //we'll connect the machines after all cables are merged
//now that cables are done, let's connect found machines
for(var/obj/machinery/power/PM in to_connect)
if(!PM.connect_to_network())
PM.disconnect_from_network() //if we somehow can't connect the machine to the new powernet, remove it from the old nonetheless
//////////////////////////////////////////////
// Powernets handling helpers
//////////////////////////////////////////////
//if powernetless_only = 1, will only get connections without powernet
/obj/structure/cable/proc/get_connections(var/powernetless_only = 0)
. = list() // this will be a list of all connected power objects
var/turf/T
///// Z-Level Stuff
if (d1 == 11 || d1 == 12)
var/turf/controllerlocation = locate(1, 1, z)
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
if(controller.up && d1 == 12)
T = locate(src.x, src.y, controller.up_target)
if(T)
. += power_list(T, src, 11, 1)
if(controller.down && d1 == 11)
T = locate(src.x, src.y, controller.down_target)
if(T)
. += power_list(T, src, 12, 1)
///// Z-Level Stuff
//get matching cables from the first direction
else if(d1) //if not a node cable
T = get_step(src, d1)
if(T)
. += power_list(T, src, turn(d1, 180), powernetless_only) //get adjacents matching cables
if(d1&(d1-1)) //diagonal direction, must check the 4 possibles adjacents tiles
T = get_step(src,d1&3) // go north/south
if(T)
. += power_list(T, src, d1 ^ 3, powernetless_only) //get diagonally matching cables
T = get_step(src,d1&12) // go east/west
if(T)
. += power_list(T, src, d1 ^ 12, powernetless_only) //get diagonally matching cables
. += power_list(loc, src, d1, powernetless_only) //get on turf matching cables
///// Z-Level Stuff
if(d2 == 11 || d2 == 12)
var/turf/controllerlocation = locate(1, 1, z)
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
if(controller.up && d2 == 12)
T = locate(src.x, src.y, controller.up_target)
if(T)
. += power_list(T, src, 11, 1)
if(controller.down && d2 == 11)
T = locate(src.x, src.y, controller.down_target)
if(T)
. += power_list(T, src, 12, 1)
///// Z-Level Stuff
else
//do the same on the second direction (which can't be 0)
T = get_step(src, d2)
if(T)
. += power_list(T, src, turn(d2, 180), powernetless_only) //get adjacents matching cables
if(d2&(d2-1)) //diagonal direction, must check the 4 possibles adjacents tiles
T = get_step(src,d2&3) // go north/south
if(T)
. += power_list(T, src, d2 ^ 3, powernetless_only) //get diagonally matching cables
T = get_step(src,d2&12) // go east/west
if(T)
. += power_list(T, src, d2 ^ 12, powernetless_only) //get diagonally matching cables
. += power_list(loc, src, d2, powernetless_only) //get on turf matching cables
return .
//should be called after placing a cable which extends another cable, creating a "smooth" cable that no longer terminates in the centre of a turf.
//needed as this can, unlike other placements, disconnect cables
/obj/structure/cable/proc/denode()
var/turf/T1 = loc
if(!T1) return
var/list/powerlist = power_list(T1,src,0,0) //find the other cables that ended in the centre of the turf, with or without a powernet
if(powerlist.len>0)
var/datum/powernet/PN = new()
propagate_network(powerlist[1],PN) //propagates the new powernet beginning at the source cable
if(PN.is_empty()) //can happen with machines made nodeless when smoothing cables
del(PN) // qdel
// cut the cable's powernet at this cable and updates the powergrid
/obj/structure/cable/proc/cut_cable_from_powernet()
var/turf/T1 = loc
var/list/P_list
if(!T1) return
if(d1)
T1 = get_step(T1, d1)
P_list = power_list(T1, src, turn(d1,180),0,cable_only = 1) // what adjacently joins on to cut cable...
P_list += power_list(loc, src, d1, 0, cable_only = 1)//... and on turf
if(P_list.len == 0)//if nothing in both list, then the cable was a lone cable, just delete it and its powernet
powernet.remove_cable(src)
for(var/obj/machinery/power/P in T1)//check if it was powering a machine
if(!P.connect_to_network()) //can't find a node cable on a the turf to connect to
P.disconnect_from_network() //remove from current network (and delete powernet)
return
// remove the cut cable from its turf and powernet, so that it doesn't get count in propagate_network worklist
loc = null
powernet.remove_cable(src) //remove the cut cable from its powernet
var/datum/powernet/newPN = new()// creates a new powernet...
propagate_network(P_list[1], newPN)//... and propagates it to the other side of the cable
// Disconnect machines connected to nodes
if(d1 == 0) // if we cut a node (O-X) cable
for(var/obj/machinery/power/P in T1)
if(!P.connect_to_network()) //can't find a node cable on a the turf to connect to
P.disconnect_from_network() //remove from current network
///////////////////////////////////////////////
// The cable coil object, used for laying cable
///////////////////////////////////////////////
////////////////////////////////
// Definitions
////////////////////////////////
#define MAXCOIL 30
/obj/item/stack/cable_coil
name = "cable coil"
icon = 'icons/obj/power.dmi'
icon_state = "coil"
amount = MAXCOIL
max_amount = MAXCOIL
color = COLOR_RED
//item_color = COLOR_RED Use regular "color" var instead. No need to have it duplicate in two vars. Causes confusion.
desc = "A coil of power cable."
throwforce = 10
w_class = 2.0
throw_speed = 2
throw_range = 5
matter = list("metal" = 50, "glass" = 20)
flags = CONDUCT
slot_flags = SLOT_BELT
item_state = "coil"
attack_verb = list("whipped", "lashed", "disciplined", "flogged")
/obj/item/stack/cable_coil/cyborg
name = "cable coil synthesizer"
desc = "A device that makes cable."
gender = NEUTER
matter = null
uses_charge = 1
charge_costs = list(1)
stacktype = /obj/item/stack/cable_coil
/obj/item/stack/cable_coil/suicide_act(mob/user)
if(locate(/obj/item/weapon/stool) in user.loc)
user.visible_message("<span class='suicide'>[user] is making a noose with the [src.name]! It looks like \he's trying to commit suicide.</span>")
else
user.visible_message("<span class='suicide'>[user] is strangling \himself with the [src.name]! It looks like \he's trying to commit suicide.</span>")
return(OXYLOSS)
/obj/item/stack/cable_coil/New(loc, length = MAXCOIL, var/param_color = null)
..()
src.amount = length
if (param_color) // It should be red by default, so only recolor it if parameter was specified.
color = param_color
pixel_x = rand(-2,2)
pixel_y = rand(-2,2)
update_icon()
update_wclass()
///////////////////////////////////
// General procedures
///////////////////////////////////
//you can use wires to heal robotics
/obj/item/stack/cable_coil/attack(mob/M as mob, mob/user as mob)
if(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
<<<<<<< HEAD
var/datum/organ/external/S = H.get_organ(user.zone_sel.selecting)
if(!(S.status & ORGAN_ROBOT) || user.a_intent != I_HELP)
=======
var/obj/item/organ/external/S = H.get_organ(user.zone_sel.selecting)
if(!(S.status & ORGAN_ROBOT) || user.a_intent != "help")
>>>>>>> d77010221cbd08f6373edebee25d727b6409413b
return ..()
if(H.species.flags & IS_SYNTHETIC)
if(M == user)
user << "\red You can't repair damage to your own body - it's against OH&S."
return
if(S.burn_dam > 0 && use(1))
S.heal_damage(0,15,0,1)
user.visible_message("\red \The [user] repairs some burn damage on \the [M]'s [S.name] with \the [src].")
return
else
user << "Nothing to fix!"
else
return ..()
/obj/item/stack/cable_coil/update_icon()
if (!color)
color = pick(COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_ORANGE, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN)
if(amount == 1)
icon_state = "coil1"
name = "cable piece"
else if(amount == 2)
icon_state = "coil2"
name = "cable piece"
else
icon_state = "coil"
name = "cable coil"
/obj/item/stack/cable_coil/proc/update_wclass()
if(amount == 1)
w_class = 1.0
else
w_class = 2.0
/obj/item/stack/cable_coil/examine(mob/user)
if(get_dist(src, user) > 1)
return
if(get_amount() == 1)
user << "A short piece of power cable."
else if(get_amount() == 2)
user << "A piece of power cable."
else
user << "A coil of power cable. There are [get_amount()] lengths of cable in the coil."
/obj/item/stack/cable_coil/verb/make_restraint()
set name = "Make Cable Restraints"
set category = "Object"
var/mob/M = usr
if(ishuman(M) && !M.restrained() && !M.stat && !M.paralysis && ! M.stunned)
if(!istype(usr.loc,/turf)) return
if(src.amount <= 14)
usr << "\red You need at least 15 lengths to make restraints!"
return
var/obj/item/weapon/handcuffs/cable/B = new /obj/item/weapon/handcuffs/cable(usr.loc)
B.color = color
usr << "<span class='notice'>You wind some cable together to make some restraints.</span>"
src.use(15)
else
usr << "\blue You cannot do that."
..()
/obj/item/stack/cable_coil/cyborg/verb/set_colour()
set name = "Change Colour"
set category = "Object"
var/list/possible_colours = list ("Yellow", "Green", "Pink", "Blue", "Orange", "Cyan", "Red")
var/selected_type = input("Pick new colour.", "Cable Colour", null, null) as null|anything in possible_colours
if(selected_type)
switch(selected_type)
if("Yellow")
color = COLOR_YELLOW
if("Green")
color = COLOR_GREEN
if("Pink")
color = COLOR_PINK
if("Blue")
color = COLOR_BLUE
if("Orange")
color = COLOR_ORANGE
if("Cyan")
color = COLOR_CYAN
else
color = COLOR_RED
usr << "You change your cable coil's colour to [selected_type]"
// Items usable on a cable coil :
// - Wirecutters : cut them duh !
// - Cable coil : merge cables
/obj/item/stack/cable_coil/attackby(obj/item/weapon/W, mob/user)
..()
if( istype(W, /obj/item/weapon/wirecutters) && src.get_amount() > 1)
src.use(1)
new/obj/item/stack/cable_coil(user.loc, 1,color)
user << "You cut a piece off the cable coil."
src.update_icon()
return
else if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if(C.get_amount() >= get_max_amount())
user << "The coil is too long, you cannot add any more cable to it."
return
if( (C.get_amount() + src.get_amount() <= get_max_amount()) )
user << "You join the cable coils together."
C.give(src.get_amount()) // give it cable
src.use(src.get_amount()) // make sure this one cleans up right
return
else
var/amt = get_max_amount() - C.get_amount()
user << "You transfer [amt] length\s of cable from one coil to the other."
C.give(amt)
src.use(amt)
return
//remove cables from the stack
/* This is probably reduntant
/obj/item/stack/cable_coil/use(var/used)
if(src.amount < used)
return 0
else if (src.amount == used)
if(ismob(loc)) //handle mob icon update
var/mob/M = loc
M.unEquip(src)
qdel(src)
return 1
else
amount -= used
update_icon()
return 1
*/
/obj/item/stack/cable_coil/use(var/used)
. = ..()
update_icon()
return
//add cables to the stack
/obj/item/stack/cable_coil/proc/give(var/extra)
if(amount + extra > MAXCOIL)
amount = MAXCOIL
else
amount += extra
update_icon()
///////////////////////////////////////////////
// Cable laying procedures
//////////////////////////////////////////////
// called when cable_coil is clicked on a turf/simulated/floor
/obj/item/stack/cable_coil/proc/turf_place(turf/simulated/floor/F, mob/user)
if(!isturf(user.loc))
return
if(get_amount() < 1) // Out of cable
user << "There is no cable left."
return
if(get_dist(F,user) > 1) // Too far
user << "You can't lay cable at a place that far away."
return
if(F.intact) // Ff floor is intact, complain
user << "You can't lay cable there unless the floor tiles are removed."
return
else
var/dirn
if(user.loc == F)
dirn = user.dir // if laying on the tile we're on, lay in the direction we're facing
else
dirn = get_dir(F, user)
for(var/obj/structure/cable/LC in F)
if((LC.d1 == dirn && LC.d2 == 0 ) || ( LC.d2 == dirn && LC.d1 == 0))
user << "<span class='warning'>There's already a cable at that position.</span>"
return
///// Z-Level Stuff
// check if the target is open space
if(istype(F, /turf/simulated/floor/open))
for(var/obj/structure/cable/LC in F)
if((LC.d1 == dirn && LC.d2 == 11 ) || ( LC.d2 == dirn && LC.d1 == 11))
user << "<span class='warning'>There's already a cable at that position.</span>"
return
var/turf/simulated/floor/open/temp = F
var/obj/structure/cable/C = new(F)
var/obj/structure/cable/D = new(temp.floorbelow)
C.cableColor(color)
C.d1 = 11
C.d2 = dirn
C.add_fingerprint(user)
C.updateicon()
var/datum/powernet/PN = new()
PN.add_cable(C)
C.mergeConnectedNetworks(C.d2)
C.mergeConnectedNetworksOnTurf()
D.cableColor(color)
D.d1 = 12
D.d2 = 0
D.add_fingerprint(user)
D.updateicon()
PN.add_cable(D)
D.mergeConnectedNetworksOnTurf()
// do the normal stuff
else
///// Z-Level Stuff
for(var/obj/structure/cable/LC in F)
if((LC.d1 == dirn && LC.d2 == 0 ) || ( LC.d2 == dirn && LC.d1 == 0))
user << "There's already a cable at that position."
return
var/obj/structure/cable/C = new(F)
C.cableColor(color)
//set up the new cable
C.d1 = 0 //it's a O-X node cable
C.d2 = dirn
C.add_fingerprint(user)
C.updateicon()
//create a new powernet with the cable, if needed it will be merged later
var/datum/powernet/PN = new()
PN.add_cable(C)
C.mergeConnectedNetworks(C.d2) //merge the powernet with adjacents powernets
C.mergeConnectedNetworksOnTurf() //merge the powernet with on turf powernets
if(C.d2 & (C.d2 - 1))// if the cable is layed diagonally, check the others 2 possible directions
C.mergeDiagonalsNetworks(C.d2)
use(1)
if (C.shock(user, 50))
if (prob(50)) //fail
new/obj/item/stack/cable_coil(C.loc, 1, C.color)
del(C) // qdel
// called when cable_coil is click on an installed obj/cable
// or click on a turf that already contains a "node" cable
/obj/item/stack/cable_coil/proc/cable_join(obj/structure/cable/C, mob/user)
var/turf/U = user.loc
if(!isturf(U))
return
var/turf/T = C.loc
if(!isturf(T) || T.intact) // sanity checks, also stop use interacting with T-scanner revealed cable
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."
return
if(U == T) //if clicked on the turf we're standing on, try to put a cable in the direction we're facing
turf_place(T,user)
return
var/dirn = get_dir(C, user)
// one end of the clicked cable is pointing towards us
if(C.d1 == dirn || C.d2 == dirn)
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."
return
else
// cable is pointing at us, we're standing on an open tile
// so create a stub pointing at the clicked cable on our tile
var/fdirn = turn(dirn, 180) // the opposite direction
for(var/obj/structure/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."
return
var/obj/structure/cable/NC = new(U)
NC.cableColor(color)
NC.d1 = 0
NC.d2 = fdirn
NC.add_fingerprint()
NC.updateicon()
//create a new powernet with the cable, if needed it will be merged later
var/datum/powernet/newPN = new()
newPN.add_cable(NC)
NC.mergeConnectedNetworks(NC.d2) //merge the powernet with adjacents powernets
NC.mergeConnectedNetworksOnTurf() //merge the powernet with on turf powernets
if(NC.d2 & (NC.d2 - 1))// if the cable is layed diagonally, check the others 2 possible directions
NC.mergeDiagonalsNetworks(NC.d2)
use(1)
if (NC.shock(user, 50))
if (prob(50)) //fail
new/obj/item/stack/cable_coil(NC.loc, 1, NC.color)
del(NC) // qdel
return
// exisiting cable doesn't point at our position, so see if it's a stub
else if(C.d1 == 0)
// if so, make it a full cable pointing from it's old direction to our dirn
var/nd1 = C.d2 // these will be the new directions
var/nd2 = dirn
if(nd1 > nd2) // swap directions to match icons/states
nd1 = dirn
nd2 = C.d2
for(var/obj/structure/cable/LC in T) // check to make sure there's no matching cable
if(LC == C) // skip the cable we're interacting with
continue
if((LC.d1 == nd1 && LC.d2 == nd2) || (LC.d1 == nd2 && LC.d2 == nd1) ) // make sure no cable matches either direction
user << "There's already a cable at that position."
return
C.cableColor(color)
C.d1 = nd1
C.d2 = nd2
C.add_fingerprint()
C.updateicon()
C.mergeConnectedNetworks(C.d1) //merge the powernets...
C.mergeConnectedNetworks(C.d2) //...in the two new cable directions
C.mergeConnectedNetworksOnTurf()
if(C.d1 & (C.d1 - 1))// if the cable is layed diagonally, check the others 2 possible directions
C.mergeDiagonalsNetworks(C.d1)
if(C.d2 & (C.d2 - 1))// if the cable is layed diagonally, check the others 2 possible directions
C.mergeDiagonalsNetworks(C.d2)
use(1)
if (C.shock(user, 50))
if (prob(50)) //fail
new/obj/item/stack/cable_coil(C.loc, 2, C.color)
del(C) // qdel
return
C.denode()// this call may have disconnected some cables that terminated on the centre of the turf, if so split the powernets.
return
//////////////////////////////
// Misc.
/////////////////////////////
/obj/item/stack/cable_coil/cut
item_state = "coil2"
/obj/item/stack/cable_coil/cut/New(loc)
..()
src.amount = rand(1,2)
pixel_x = rand(-2,2)
pixel_y = rand(-2,2)
update_icon()
update_wclass()
/obj/item/stack/cable_coil/yellow
color = COLOR_YELLOW
/obj/item/stack/cable_coil/blue
color = COLOR_BLUE
/obj/item/stack/cable_coil/green
color = COLOR_GREEN
/obj/item/stack/cable_coil/pink
color = COLOR_PINK
/obj/item/stack/cable_coil/orange
color = COLOR_ORANGE
/obj/item/stack/cable_coil/cyan
color = COLOR_CYAN
/obj/item/stack/cable_coil/white
color = COLOR_WHITE
/obj/item/stack/cable_coil/random/New()
color = pick(COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN)
..()
+2 -2
View File
@@ -195,7 +195,7 @@
else
I.lower_aim()
return
if(m_intent == "run" && T.client.target_can_move == 1 && T.client.target_can_run == 0)
if(iscarbon(src) && m_intent == "run" && T.client.target_can_move == 1 && T.client.target_can_run == 0)
src << "<span class='danger'>Your move intent is now set to walk, as your targeter permits it.</span>" //Self explanitory.
set_m_intent("walk")
@@ -406,4 +406,4 @@ client/verb/AllowTargetRun()
if(target_can_radio)
M << "Your character may now <b>use the radio</b> at the discretion of their targeter."
else
M << "<span class='danger'><b>Your character will now be shot if they use the radio.</b></span>"
M << "<span class='danger'><b>Your character will now be shot if they use the radio.</b></span>"
+38 -33
View File
@@ -104,46 +104,51 @@ using metal and glass, it uses glass and reagents (usually sulfuric acis).
return 1
if(O.is_open_container())
return 0
if(!istype(O, /obj/item/stack/sheet/glass) && !istype(O, /obj/item/stack/sheet/mineral/gold) && !istype(O, /obj/item/stack/sheet/mineral/diamond) && !istype(O, /obj/item/stack/sheet/mineral/uranium))
user << "<span class='notice'>You cannot insert this item into \the [src]!</span>"
return 1
// if(!istype(O, /obj/item/stack/sheet/glass) && !istype(O, /obj/item/stack/sheet/mineral/gold) && !istype(O, /obj/item/stack/sheet/mineral/diamond) && !istype(O, /obj/item/stack/sheet/mineral/uranium))
// user << "<span class='notice'>You cannot insert this item into \the [src]!</span>"
// return 1
if(stat)
return 1
if(busy)
user << "<span class='notice'>\The [src] is busy. Please wait for completion of previous operation.</span>"
return 1
var/obj/item/stack/sheet/stack = O
if((TotalMaterials() + stack.perunit) > max_material_amount)
user << "<span class='notice'>\The [src] is full. Please remove glass from \the [src] in order to insert more.</span>"
return 1
var/amount = round(input("How many sheets do you want to add?") as num)
if(amount < 0)
amount = 0
if(amount == 0)
return
if(amount > stack.amount)
amount = min(stack.amount, round((max_material_amount - TotalMaterials()) / stack.perunit))
if(istype(O, /obj/item/stack/sheet/glass) || istype(O, /obj/item/stack/sheet/mineral/gold) || istype(O, /obj/item/stack/sheet/mineral/diamond) || istype(O, /obj/item/stack/sheet/mineral/uranium))
busy = 1
use_power(max(1000, (3750 * amount / 10)))
var/stacktype = stack.type
stack.use(amount)
if(do_after(usr, 16))
user << "<span class='notice'>You add [amount] sheets to \the [src].</span>"
switch(stacktype)
if(/obj/item/stack/sheet/glass)
g_amount += amount * 3750
if(/obj/item/stack/sheet/mineral/gold)
gold_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/diamond)
diamond_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/uranium)
uranium_amount += amount * 2000
else
new stacktype(loc, amount)
busy = 0
updateUsrDialog()
var/obj/item/stack/sheet/stack = O
if((TotalMaterials() + stack.perunit) > max_material_amount)
user << "<span class='notice'>\The [src] is full. Please remove glass from \the [src] in order to insert more.</span>"
return 1
var/amount = round(input("How many sheets do you want to add?") as num)
if(amount < 0)
amount = 0
if(amount == 0)
return
if(amount > stack.amount)
amount = min(stack.amount, round((max_material_amount - TotalMaterials()) / stack.perunit))
busy = 1
use_power(max(1000, (3750 * amount / 10)))
var/stacktype = stack.type
stack.use(amount)
if(do_after(usr, 16))
user << "<span class='notice'>You add [amount] sheets to \the [src].</span>"
switch(stacktype)
if(/obj/item/stack/sheet/glass)
g_amount += amount * 3750
if(/obj/item/stack/sheet/mineral/gold)
gold_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/diamond)
diamond_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/uranium)
uranium_amount += amount * 2000
else
new stacktype(loc, amount)
busy = 0
updateUsrDialog()
..()
//This is to stop these machines being hackable via clicking.
/obj/machinery/r_n_d/circuit_imprinter/attack_hand(mob/user as mob)
@@ -13,7 +13,7 @@ Note: Must be placed within 3 tiles of the R&D Console
var/obj/item/weapon/loaded_item = null
var/decon_mod = 1
var/min_reliability = 90
use_power = 1
idle_power_usage = 30
active_power_usage = 2500
@@ -38,12 +38,6 @@ Note: Must be placed within 3 tiles of the R&D Console
del(src)
return
/obj/machinery/r_n_d/destructive_analyzer/proc/ConvertReqString2List(var/list/source_list)
var/list/temp_list = params2list(source_list)
for(var/O in temp_list)
temp_list[O] = text2num(temp_list[O])
return temp_list
/obj/machinery/r_n_d/destructive_analyzer/update_icon()
if(panel_open)
icon_state = "d_analyzer_t"
+43 -45
View File
@@ -116,9 +116,6 @@ Note: Must be placed west/left of and R&D console to function.
if(busy)
user << "<span class='notice'>\The [src] is busy. Please wait for completion of previous operation.</span>"
return 1
if(!istype(O, /obj/item/stack/sheet))
user << "<span class='notice'>You cannot insert this item into \the [src]!</span>"
return 1
if(stat)
return 1
if(istype(O,/obj/item/stack/sheet))
@@ -127,51 +124,52 @@ Note: Must be placed west/left of and R&D console to function.
user << "<span class='notice'>\The [src]'s material bin is full. Please remove material before adding more.</span>"
return 1
var/obj/item/stack/sheet/stack = O
var/amount = round(input("How many sheets do you want to add?") as num)//No decimals
if(!O)
return
if(amount < 0)//No negative numbers
amount = 0
if(amount == 0)
return
if(amount > stack.get_amount())
amount = stack.get_amount()
if(max_material_storage - TotalMaterials() < (amount * stack.perunit))//Can't overfill
amount = min(stack.amount, round((max_material_storage - TotalMaterials()) / stack.perunit))
var/obj/item/stack/sheet/stack = O
var/amount = round(input("How many sheets do you want to add?") as num)//No decimals
if(!O)
return
if(amount < 0)//No negative numbers
amount = 0
if(amount == 0)
return
if(amount > stack.get_amount())
amount = stack.get_amount()
if(max_material_storage - TotalMaterials() < (amount * stack.perunit))//Can't overfill
amount = min(stack.amount, round((max_material_storage - TotalMaterials()) / stack.perunit))
overlays += "protolathe_[stack.name]"
sleep(10)
overlays -= "protolathe_[stack.name]"
overlays += "protolathe_[stack.name]"
sleep(10)
overlays -= "protolathe_[stack.name]"
icon_state = "protolathe"
busy = 1
use_power(max(1000, (3750 * amount / 10)))
var/stacktype = stack.type
stack.use(amount)
if(do_after(user, 16))
user << "<span class='notice'>You add [amount] sheets to \the [src].</span>"
icon_state = "protolathe"
switch(stacktype)
if(/obj/item/stack/sheet/metal)
m_amount += amount * 3750
if(/obj/item/stack/sheet/glass)
g_amount += amount * 3750
if(/obj/item/stack/sheet/mineral/gold)
gold_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/silver)
silver_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/phoron)
phoron_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/uranium)
uranium_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/diamond)
diamond_amount += amount * 2000
else
new stacktype(loc, amount)
busy = 0
updateUsrDialog()
return
busy = 1
use_power(max(1000, (3750 * amount / 10)))
var/stacktype = stack.type
stack.use(amount)
if(do_after(user, 16))
user << "<span class='notice'>You add [amount] sheets to \the [src].</span>"
icon_state = "protolathe"
switch(stacktype)
if(/obj/item/stack/sheet/metal)
m_amount += amount * 3750
if(/obj/item/stack/sheet/glass)
g_amount += amount * 3750
if(/obj/item/stack/sheet/mineral/gold)
gold_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/silver)
silver_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/phoron)
phoron_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/uranium)
uranium_amount += amount * 2000
if(/obj/item/stack/sheet/mineral/diamond)
diamond_amount += amount * 2000
else
new stacktype(loc, amount)
busy = 0
updateUsrDialog()
return
..()
//This is to stop these machines being hackable via clicking.
/obj/machinery/r_n_d/protolathe/attack_hand(mob/user as mob)
+2 -2
View File
@@ -256,7 +256,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
screen = 1.0
return
if(linked_destroy.loaded_item.reliability >= linked_destroy.min_reliability)
var/list/temp_tech = linked_destroy.ConvertReqString2List(linked_destroy.loaded_item.origin_tech)
var/list/temp_tech = ConvertReqString2List(linked_destroy.loaded_item.origin_tech)
for(var/T in temp_tech)
files.UpdateTech(T, temp_tech[T])
if(linked_destroy.loaded_item.reliability < 100 && linked_destroy.loaded_item.crit_fail)
@@ -753,7 +753,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
dat += "Name: [linked_destroy.loaded_item.name]<BR>"
dat += "Origin Tech:"
dat += "<UL>"
var/list/temp_tech = linked_destroy.ConvertReqString2List(linked_destroy.loaded_item.origin_tech)
var/list/temp_tech = ConvertReqString2List(linked_destroy.loaded_item.origin_tech)
for(var/T in temp_tech)
dat += "<LI>[CallTechName(T)] [temp_tech[T]]"
for(var/datum/tech/F in files.known_tech)
+6
View File
@@ -59,6 +59,12 @@ research holder datum.
possible_designs += new D(src)
RefreshResearch()
/datum/research/techonly
/datum/research/techonly/New()
for(var/T in typesof(/datum/tech) - /datum/tech)
possible_tech += new T(src)
RefreshResearch()
//Checks to see if tech has all the required pre-reqs.