Merge remote-tracking branch 'upstream/master'

Conflicts:
	code/modules/recycling/sortingmachinery.dm
This commit is contained in:
Tastyfish
2012-01-11 00:26:42 -05:00
19 changed files with 500 additions and 70 deletions
@@ -1311,6 +1311,19 @@ datum
..()
return
tramadol
name = "Tramadol"
id = "tramadol"
description = "A simple, yet effective painkiller."
reagent_state = LIQUID
color = "#C8A5DC"
oxycodone
name = "Oxycodone"
id = "oxycodone"
description = "An effective and very addictive painkiller."
reagent_state = LIQUID
color = "#C805DC"
impedrezene
name = "Impedrezene"
@@ -70,6 +70,13 @@ datum
required_reagents = list("radium" = 1, "phosphorus" = 1, "chlorine" = 1)
result_amount = 3
tramadol
name = "Tramadol"
id = "tramadol"
result = "tramadol"
required_reagents = list("inaprovaline" = 1, "ethanol" = 1, "oxygen" = 1)
result_amount = 3
//cyanide
// name = "Cyanide"
// id = "cyanide"
+23
View File
@@ -675,6 +675,21 @@
R.my_atom = src
attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/packageWrap))
if(istype(src.loc,/obj/item/weapon/storage) || istype(src.loc,/obj/item/clothing/suit/storage/)) //Taking stuff out of storage duplicates it.
user << "\blue Do not do this, it is broken as all hell. Take it out of the container first."
return
for(var/obj/item/T in user) //Lets remove it from their inventory
if(T == src)
user.remove_from_mob(T)
break
var/obj/item/weapon/packageWrap/O = W
if (O.amount > 1)
var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(src.loc))
P.wrapped = src
src.loc = P
O.amount -= 1
return
attack_self(mob/user as mob)
return
@@ -2711,6 +2726,14 @@
..()
reagents.add_reagent("kelotane", 30)
/obj/item/weapon/reagent_containers/pill/tramadol
name = "Tramadol pill"
desc = "A simple painkiller."
icon_state = "pill8"
New()
..()
reagents.add_reagent("tramadol", 30)
/obj/item/weapon/reagent_containers/pill/inaprovaline
name = "Inaprovaline pill"
desc = "Used to stabilize patients."
+10 -3
View File
@@ -8,8 +8,12 @@
src.traumatic_shock -= 10
if(reagents.has_reagent("inaprovaline"))
src.traumatic_shock -= 25
if(reagents.has_reagent("synaptizine"))
src.traumatic_shock -= 100 // make synaptizine function as good painkiller
if(reagents.has_reagent("tramadol"))
src.traumatic_shock -= 80 // make synaptizine function as good painkiller
if(reagents.has_reagent("oxycodone"))
src.traumatic_shock -= 200 // make synaptizine function as good painkiller
if(src.slurring)
src.traumatic_shock -= 20
// broken or ripped off organs will add quite a bit of pain
if(istype(src,/mob/living/carbon/human))
@@ -19,7 +23,10 @@
if(organ.destroyed || organ.open)
src.traumatic_shock += 60
else if(organ.broken)
src.traumatic_shock += 40
src.traumatic_shock += 30
if(src.traumatic_shock < 0)
src.traumatic_shock = 0
return src.traumatic_shock
@@ -12,7 +12,7 @@
m_amt = 1850
level = 2
var/ptype = 0
// 0=straight, 1=bent, 2=junction-j1, 3=junction-j2, 4=junction-y, 5=trunk
// 0=straight, 1=bent, 2=junction-j1, 3=junction-j2, 4=junction-y, 5=trunk, 6=junction-j1s, 7=junction-j2s
var/dpdir = 0 // directions as disposalpipe
var/base_state = "pipe-s"
@@ -42,6 +42,12 @@
if(5)
base_state = "pipe-t"
dpdir = dir
if(6)
base_state = "pipe-j1s"
dpdir = dir | right | flip
if(7)
base_state = "pipe-j2s"
dpdir = dir | left | flip
icon_state = "con[base_state]"
@@ -93,6 +99,8 @@
return /obj/structure/disposalpipe/junction
if(5)
return /obj/structure/disposalpipe/trunk
if(6,7)
return /obj/structure/disposalpipe/sortjunction
return
@@ -142,6 +150,15 @@
var/obj/structure/disposalpipe/P = new pipetype(src.loc)
P.base_icon_state = base_state
P.dir = dir
if(ptype >= 6)
var/obj/structure/disposalpipe/sortjunction/V = P
V.posdir = dir
if(ptype == 6)
V.sortdir = turn(dir, -90)
V.negdir = turn(dir, 180)
else
V.sortdir = turn(dir, 90)
V.negdir = turn(dir, 180)
P.dpdir = dpdir
P.updateicon()
del(src)
+161 -44
View File
@@ -20,6 +20,7 @@
var/obj/structure/disposalpipe/trunk/trunk = null // the attached pipe trunk
var/flushing = 0 // true if flushing in progress
var/timeleft = 0 //used to give a delay after the last item was put in before flushing
var/islarge = 0 //If there is a crate, lets not add a second.
// create a new disposal
// find the attached trunk (if present) and init gas resvr.
@@ -112,41 +113,83 @@
// mouse drop another mob or self
//
MouseDrop_T(mob/target, mob/user)
if (!istype(target) || target.buckled || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || istype(user, /mob/living/silicon/ai))
MouseDrop_T(var/atom/movable/T, mob/user)
if (istype(T,/mob))
var/mob/target = T
if (!istype(target) || target.buckled || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || istype(user, /mob/living/silicon/ai))
return
if(src.islarge == 1)
user << "They won't fit with that crate in there!"
return
var/msg
for (var/mob/V in viewers(usr))
if(target == user && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
V.show_message("[usr] starts climbing into the disposal.", 3)
if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
if(target.anchored) return
V.show_message("[usr] starts stuffing [target.name] into the disposal.", 3)
if(!do_after(usr, 20))
return
if(target == user && !user.stat && !user.weakened && !user.stunned && !user.paralysis) // if drop self, then climbed in // must be awake, not stunned or whatever
msg = "[user.name] climbs into the [src]."
user << "You climb into the [src]."
else if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
msg = "[user.name] stuffs [target.name] into the [src]!"
user << "You stuff [target.name] into the [src]!"
else
return
if (target.client)
target.client.perspective = EYE_PERSPECTIVE
target.client.eye = src
target.loc = src
for (var/mob/C in viewers(src))
if(C == user)
continue
C.show_message(msg, 3)
timeleft = 5
update()
return
if(istype(T,/obj/effect/bigDelivery))
if (T.anchored || get_dist(user, src) > 1 || get_dist(src,T) > 2 )
return
if(src.islarge == 1)
user << "[T] won't fit with that crate in there!"
return
for(var/mob/M in viewers(src))
if(M == user)
user << "You start to shove \the [T] into the [src]."
continue
M.show_message("[user.name] looks like they're trying to place \the [T] into the [src].", 5)
if(!do_after(usr, 20))
return
user << "Your back is starting to hurt!"
sleep(5)
if(prob(50))
user << "No way can you get this thing in there."
return
if(!do_after(usr, 20))
return
T.loc = src
src.islarge = 1
for(var/mob/M in viewers(src))
if(M == user)
user << "You shove \the [T] into the [src]."
continue
M.show_message("[user.name] manages to stuff \the [T] into the [src]. Impressive!", 5)
return
var/msg
for (var/mob/V in viewers(usr))
if(target == user && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
V.show_message("[usr] starts climbing into the disposal.", 3)
if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
if(target.anchored) return
V.show_message("[usr] starts stuffing [target.name] into the disposal.", 3)
if(!do_after(usr, 20))
return
if(target == user && !user.stat && !user.weakened && !user.stunned && !user.paralysis) // if drop self, then climbed in
// must be awake, not stunned or whatever
msg = "[user.name] climbs into the [src]."
user << "You climb into the [src]."
else if(target != user && !user.restrained() && !user.stat && !user.weakened && !user.stunned && !user.paralysis)
msg = "[user.name] stuffs [target.name] into the [src]!"
user << "You stuff [target.name] into the [src]!"
else
return
if (target.client)
target.client.perspective = EYE_PERSPECTIVE
target.client.eye = src
target.loc = src
for (var/mob/C in viewers(src))
if(C == user)
continue
C.show_message(msg, 3)
timeleft = 5
update()
return
// can breath normally in the disposal
alter_health()
@@ -364,6 +407,8 @@
flush = 0
if(mode == 2) // if was ready,
mode = 1 // switch to charging
if(islarge)
islarge = 0
update()
return
@@ -517,10 +562,6 @@
src.destinationTag = T.sortTag
else if (!src.destinationTag)
src.destinationTag = null
else if (istype(AM, /mob)) //If there is a mob somewhere in there....
if(prob(10))
src.destinationTag = "Mail Office"
// start the movement process
// argument is the disposal unit the holder started in
@@ -685,7 +726,7 @@
M.weakened += 4
M << "\red You're gonna remember that one in the morning!"
M:UpdateDamageIcon()
M:UpdateDamage()
//M:UpdateDamage() //doesnt fucking exist if you arent a blob
else
M.bruteloss += 4
if(prob(2))
@@ -739,7 +780,7 @@
H.active = 0
H.loc = src
return
if(T.intact && istype(T,/turf/simulated/floor)) //intact floor, pop the tile
if(istype(T,/turf/simulated/floor) && T.intact) //intact floor, pop the tile
var/turf/simulated/floor/F = T
//F.health = 100
F.burnt = 1
@@ -964,13 +1005,18 @@
desc = "An underfloor disposal pipe with a package sorting mechanism."
icon_state = "pipe-j1s"
var/list/sortType = list()
var/list/backType = list()
var/backsort = 0 //For sending disposal packets to upstream destinations.
var/mailsort = 0
var/posdir = 0
var/negdir = 0
var/sortdir = 0
var
list/sortType = list()
list/backType = list()
backsort = 0 //For sending disposal packets to upstream destinations.
mailsort = 0
posdir = 0
negdir = 0
sortdir = 0
service = 0
screen = 0
icon_state_old = null
New()
..()
@@ -995,6 +1041,8 @@
nextdir(var/fromdir, var/sortTag, var/ismail)
//var/flipdir = turn(fromdir, 180)
if(service)
return posdir //If it's being worked on, it isn't sorting.
if(sortTag)
for(var/i, i <= backType.len, i++)
if(sortTag == src.backType[i])
@@ -1037,6 +1085,75 @@
return P
attackby(var/obj/item/I, var/mob/user)
if(istype(I, /obj/item/weapon/screwdriver))
if(service)
icon_state = icon_state_old
service = 0
user << "You close the service hatch on the sorter"
else
icon_state_old = icon_state
icon_state += "s"
service = 1
user << "You open up the service hatch on the sorter"
attack_hand(mob/user as mob)
if(service)
interact(user)
return
proc
interact(var/mob/user)
var/dat = "<TT><B>Sorting Mechanism</B><BR>"
if (sortType.len == 0)
dat += "<br>Currently Filtering: <A href='?src=\ref[src];choice=selectSort'>None</A><br>"
else
dat += "<br>Currently Filtering:"
for(var/i = 1, i <= sortType.len, i++)
dat += " <A href='?src=\ref[src];choice=selectSort'>[sortType[i]]</A>,"
dat += "<br>"
if (!backsort)
dat += "Backwards Sorting Disabled <A href='?src=\ref[src];choice=toggleBack'>Toggle</A><br>"
else if(backType.len == 0 && backsort)
dat += "Backwards Sorting Active. Sorting: <A href='?src=\ref[src];choice=selectBack'>None.</A> <A href='?src=\ref[src];choice=toggleBack'>Toggle</A><br>"
else
dat += "Backwards Sorting Active. Sorting:"
for(var/i = 1, i <= backType.len, i++)
dat += " <A href='?src=\ref[src];choice=selectBack'>[backType[i]]</A>,"
dat += " <A href='?src=\ref[src];choice=toggleBack'>Toggle</A><br>"
user << browse(dat, "window=sortScreen")
onclose(user, "sortScreen")
return
Topic(href, href_list)
src.add_fingerprint(usr)
usr.machine = src
switch(href_list["choice"])
if("toggleBack")
backsort = !backsort
if("selectBack")
var/list/names = sortList(backType)
var/variable = input("Which tag?","Tag") as null|anything in names + "(ADD TAG)"
if(!variable)
return
if(variable == "(ADD TAG)")
var/var_value = input("Enter new tag:","Tag") as text|null
if(!var_value) return
backType |= var_value
else
backType -= variable
if("selectSort")
var/list/names = sortList(sortType)
var/variable = input("Which tag?","Tag") as null|anything in names + "(ADD TAG)"
if(!variable)
return
if(variable == "(ADD TAG)")
var/var_value = input("Enter new tag:","Tag") as text|null
if(!var_value) return
sortType |= var_value
else
sortType -= variable
updateUsrDialog()
//a trunk joining to a disposal bin or outlet on the same turf
/obj/structure/disposalpipe/trunk
+16 -6
View File
@@ -8,16 +8,21 @@
var/sortTag = null
flags = FPRINT
mouse_drag_pointer = MOUSE_ACTIVE_POINTER
var/examtext = null
var/examtext = null
var/label_x = 0
var/tag_x = 0
var/tag_x = 0
var/waswelded = 0
attack_hand(mob/user as mob)
return unwrap()
proc/unwrap()
if (src.wrapped) //sometimes items can disappear. For example, bombs. --rastaf0
src.wrapped.loc = (get_turf(src.loc))
if (istype(src.wrapped,/obj/structure/closet))
var/obj/structure/closet/O = src.wrapped
O.welded = 0
O.welded = waswelded
del(src)
return
@@ -235,7 +240,6 @@
flags = FPRINT | TABLEPASS | ONBELT | CONDUCT
attack_self(mob/user as mob)
user.machine = src
interact(user)
proc/interact(mob/user as mob)
@@ -244,6 +248,7 @@
dat += "<br>Current Selection: None<br>"
else
dat += "<br>Current Selection: [currTag]<br><br>"
dat += "<A href='?src=\ref[src];nextTag=[locationList.len + 1]'>Set Custom Destination</A><br><br>"
for (var/i = 1, i <= locationList.len, i++)
if(spaceList[i])
dat += "<br>"
@@ -251,14 +256,19 @@
dat += "<br>"
user << browse(dat, "window=destTagScreen")
onclose(user, "destTagScreen")
usr.machine = null
return
Topic(href, href_list)
usr.machine = src
src.add_fingerprint(usr)
if(href_list["nextTag"])
var/n = text2num(href_list["nextTag"])
src.currTag = locationList[n]
if(n > locationList.len)
var/t1 = input("Which tag?","Tag") as null|text
if(t1)
src.currTag = t1
else
src.currTag = locationList[n]
if(istype(loc,/mob))
interact(loc)
else