Merge branch 'master' of https://github.com/tgstation/-tg-station into ReagentReactionRuntimeFix

Conflicts:
	code/modules/reagents/Chemistry-Reagents/Toxin-Reagents.dm
	icons/obj/assemblies/new_assemblies.dmi
This commit is contained in:
phil235
2015-09-10 21:49:39 +02:00
634 changed files with 17053 additions and 20931 deletions
+5 -3
View File
@@ -51,10 +51,12 @@
//Called when another assembly acts on this one, var/radio will determine where it came from for wire calcs
/obj/item/device/assembly/proc/pulsed(radio = 0)
if(holder && (wires & WIRE_RECEIVE))
activate()
if(wires & WIRE_RECEIVE)
spawn(0)
activate()
if(radio && (wires & WIRE_RADIO_RECEIVE))
activate()
spawn(0)
activate()
return 1
+146
View File
@@ -0,0 +1,146 @@
/obj/item/device/assembly/control
name = "blast door controller"
desc = "A small electronic device able to control a blast door remotely."
icon_state = "control"
origin_tech = "magnets=1;programming=2"
attachable = 1
var/id = null
var/can_change_id = 0
/obj/item/device/assembly/control/examine(mob/user)
..()
if(id)
user << "It's channel ID is '[id]'."
/obj/item/device/assembly/control/activate()
cooldown = 1
var/openclose
for(var/obj/machinery/door/poddoor/M in machines)
if(M.id == src.id)
if(openclose == null)
openclose = M.density
spawn(0)
if(M)
if(openclose) M.open()
else M.close()
return
sleep(10)
cooldown = 0
/obj/item/device/assembly/control/airlock
name = "airlock controller"
desc = "A small electronic device able to control an airlock remotely."
id = "badmin" // Set it to null for MEGAFUN.
var/specialfunctions = OPEN
/*
Bitflag, 1= open (OPEN)
2= idscan (IDSCAN)
4= bolts (BOLTS)
8= shock (SHOCK)
16= door safties (SAFE)
*/
/obj/item/device/assembly/control/airlock/activate()
cooldown = 1
for(var/obj/machinery/door/airlock/D in airlocks)
if(D.id_tag == src.id)
if(specialfunctions & OPEN)
spawn(0)
if(D)
if(D.density) D.open()
else D.close()
return
if(specialfunctions & IDSCAN)
D.aiDisabledIdScanner = !D.aiDisabledIdScanner
if(specialfunctions & BOLTS)
if(!D.isWireCut(4) && D.hasPower())
D.locked = !D.locked
D.update_icon()
if(specialfunctions & SHOCK)
D.secondsElectrified = D.secondsElectrified ? 0 : -1
if(specialfunctions & SAFE)
D.safe = !D.safe
sleep(10)
cooldown = 0
/obj/item/device/assembly/control/massdriver
name = "mass driver controller"
desc = "A small electronic device able to control a mass driver."
/obj/item/device/assembly/control/massdriver/activate()
cooldown = 1
for(var/obj/machinery/door/poddoor/M in machines)
if (M.id == src.id)
spawn( 0 )
M.open()
return
sleep(10)
for(var/obj/machinery/mass_driver/M in machines)
if(M.id == src.id)
M.drive()
sleep(60)
for(var/obj/machinery/door/poddoor/M in machines)
if (M.id == src.id)
spawn( 0 )
M.close()
return
sleep(10)
cooldown = 0
/obj/item/device/assembly/control/igniter
name = "ignition controller"
desc = "A remote controller for a mounted igniter."
/obj/item/device/assembly/control/igniter/activate()
cooldown = 1
for(var/obj/machinery/sparker/M in machines)
if (M.id == src.id)
spawn( 0 )
M.ignite()
for(var/obj/machinery/igniter/M in machines)
if(M.id == src.id)
M.use_power(50)
M.on = !M.on
M.icon_state = "igniter[M.on]"
sleep(30)
cooldown = 0
/obj/item/device/assembly/control/flasher
name = "flasher controller"
desc = "A remote controller for a mounted flasher."
/obj/item/device/assembly/control/flasher/activate()
cooldown = 1
for(var/obj/machinery/flasher/M in machines)
if(M.id == src.id)
spawn(0)
M.flash()
sleep(50)
cooldown = 0
/obj/item/device/assembly/control/crematorium
name = "crematorium controller"
desc = "An evil-looking remote controller for a crematorium."
/obj/item/device/assembly/control/crematorium/activate()
cooldown = 1
for (var/obj/structure/bodycontainer/crematorium/C in crematoriums)
if (C.id == id)
C.cremate(usr)
sleep(50)
cooldown = 0
+197
View File
@@ -0,0 +1,197 @@
/obj/item/device/assembly/flash
name = "flash"
desc = "A powerful and versatile flashbulb device, with applications ranging from disorienting attackers to acting as visual receptors in robot production."
icon_state = "flash"
item_state = "flashtool"
throwforce = 0
w_class = 1
origin_tech = "magnets=2;combat=1"
crit_fail = 0 //Is the flash burnt out?
var/times_used = 0 //Number of times it's been used.
var/last_used = 0 //last world.time it was used.
/obj/item/device/assembly/flash/update_icon(var/flash = 0)
overlays.Cut()
attached_overlays = list()
if(crit_fail)
overlays += "flashburnt"
attached_overlays += "flashburnt"
if(flash)
overlays += "flash-f"
attached_overlays += "flash-f"
spawn(5)
update_icon()
if(holder)
holder.update_icon()
/obj/item/device/assembly/flash/proc/clown_check(mob/living/carbon/human/user)
if(user.disabilities & CLUMSY && prob(50))
flash_carbon(user, user, 15, 0)
return 0
return 1
/obj/item/device/assembly/flash/activate()
if(!try_use_flash())
return 0
var/turf/T = get_turf(src)
T.visible_message("<span class='disarm'>[src] emits a blinding light!</span>")
for(var/mob/living/carbon/M in viewers(3, null))
flash_carbon(M, null, 2, 0)
/obj/item/device/assembly/flash/proc/burn_out() //Made so you can override it if you want to have an invincible flash from R&D or something.
crit_fail = 1
update_icon()
var/turf/T = get_turf(src)
T.visible_message("The [src.name] burns out!")
/obj/item/device/assembly/flash/proc/flash_recharge(interval=10)
if(prob(times_used * 3)) //The more often it's used in a short span of time the more likely it will burn out
burn_out()
return 0
var/deciseconds_passed = world.time - last_used
for(var/seconds = deciseconds_passed/10, seconds>=interval, seconds-=interval) //get 1 charge every interval
times_used--
last_used = world.time
times_used = max(0, times_used) //sanity
return 1
/obj/item/device/assembly/flash/proc/try_use_flash(mob/user = null)
flash_recharge(10)
if(crit_fail)
return 0
playsound(src.loc, 'sound/weapons/flash.ogg', 100, 1)
update_icon(1)
times_used++
if(user && !clown_check(user))
return 0
return 1
/obj/item/device/assembly/flash/proc/flash_carbon(mob/living/carbon/M, mob/user = null, power = 5, targeted = 1)
add_logs(user, M, "flashed", src)
if(user && targeted)
if(M.weakeyes)
M.Weaken(3) //quick weaken bypasses eye protection but has no eye flash
if(M.flash_eyes(1, 1))
M.confused += power
terrible_conversion_proc(M, user)
M.Stun(1)
visible_message("<span class='disarm'>[user] blinds [M] with the flash!</span>")
user << "<span class='danger'>You blind [M] with the flash!</span>"
M << "<span class='userdanger'>[user] blinds you with the flash!</span>"
if(M.weakeyes)
M.Stun(2)
M.visible_message("<span class='disarm'>[M] gasps and shields their eyes!</span>", "<span class='userdanger'>You gasp and shields your eyes!</span>")
else
visible_message("<span class='disarm'>[user] fails to blind [M] with the flash!</span>")
user << "<span class='warning'>You fail to blind [M] with the flash!</span>"
M << "<span class='danger'>[user] fails to blind you with the flash!</span>"
else
if(M.flash_eyes())
M.confused += power
/obj/item/device/assembly/flash/attack(mob/living/M, mob/user)
if(!try_use_flash(user))
return 0
if(iscarbon(M))
flash_carbon(M, user, 5, 1)
return 1
else if(issilicon(M))
add_logs(user, M, "flashed", src)
update_icon(1)
M.Weaken(rand(5,10))
user.visible_message("<span class='disarm'>[user] overloads [M]'s sensors with the flash!</span>", "<span class='danger'>You overload [M]'s sensors with the flash!</span>")
return 1
user.visible_message("<span class='disarm'>[user] fails to blind [M] with the flash!</span>", "<span class='warning'>You fail to blind [M] with the flash!</span>")
/obj/item/device/assembly/flash/attack_self(mob/living/carbon/user, flag = 0, emp = 0)
if(holder)
return 0
if(!try_use_flash(user))
return 0
user.visible_message("<span class='disarm'>[user]'s flash emits a blinding light!</span>", "<span class='danger'>Your flash emits a blinding light!</span>")
for(var/mob/living/carbon/M in oviewers(3, null))
flash_carbon(M, user, 1, 0)
/obj/item/device/assembly/flash/emp_act(severity)
if(!try_use_flash())
return 0
for(var/mob/living/carbon/M in viewers(3, null))
flash_carbon(M, null, 10, 0)
burn_out()
..()
/obj/item/device/assembly/flash/proc/terrible_conversion_proc(mob/M, mob/user)
if(ishuman(M) && ishuman(user) && M.stat != DEAD)
if(user.mind && (user.mind in ticker.mode.head_revolutionaries))
if(M.client)
if(M.stat == CONSCIOUS)
M.mind_initialize() //give them a mind datum if they don't have one.
var/resisted
if(!isloyal(M))
if(user.mind in ticker.mode.head_revolutionaries)
if(ticker.mode.add_revolutionary(M.mind))
times_used -- //Flashes less likely to burn out for headrevs when used for conversion
else
resisted = 1
else
resisted = 1
if(resisted)
user << "<span class='warning'>This mind seems resistant to the flash!</span>"
else
user << "<span class='warning'>They must be conscious before you can convert them!</span>"
else
user << "<span class='warning'>This mind is so vacant that it is not susceptible to influence!</span>"
/obj/item/device/assembly/flash/cyborg
origin_tech = null
/obj/item/device/assembly/flash/cyborg/attack(mob/living/M, mob/user)
..()
cyborg_flash_animation(user)
/obj/item/device/assembly/flash/cyborg/attack_self(mob/user)
..()
cyborg_flash_animation(user)
/obj/item/device/assembly/flash/cyborg/attackby(obj/item/weapon/W, mob/user, params)
return
/obj/item/device/assembly/flash/cyborg/proc/cyborg_flash_animation(mob/living/user)
var/atom/movable/overlay/animation = new(user.loc)
animation.layer = user.layer + 1
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = user
flick("blspell", animation)
sleep(5)
qdel(animation)
/obj/item/device/assembly/flash/memorizer
name = "memorizer"
desc = "If you see this, you're not likely to remember it any time soon."
icon = 'icons/obj/device.dmi'
icon_state = "memorizer"
item_state = "nullrod"
/obj/item/device/assembly/flash/handheld //this is now the regular pocket flashes
+105
View File
@@ -0,0 +1,105 @@
/obj/item/device/assembly/health
name = "health sensor"
desc = "Used for scanning and monitoring health."
icon_state = "health"
materials = list(MAT_METAL=800, MAT_GLASS=200)
origin_tech = "magnets=1;biotech=1"
attachable = 1
secured = 0
var/scanning = 0
var/health_scan
var/alarm_health = 0
/obj/item/device/assembly/health/activate()
if(!..()) return 0//Cooldown check
toggle_scan()
return 0
/obj/item/device/assembly/health/toggle_secure()
secured = !secured
if(secured && scanning)
SSobj.processing |= src
else
scanning = 0
SSobj.processing.Remove(src)
update_icon()
return secured
/obj/item/device/assembly/health/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/multitool))
if(alarm_health == 0)
alarm_health = -90
user.show_message("You toggle [src] to \"detect death\" mode.")
else
alarm_health = 0
user.show_message("You toggle [src] to \"detect critical state\" mode.")
return
else
return ..()
/obj/item/device/assembly/health/process()
if(!scanning || !secured)
return
var/atom/A = src
if(connected && connected.holder)
A = connected.holder
for(A, A && !ismob(A), A=A.loc);
// like get_turf(), but for mobs.
var/mob/living/M = A
if(M)
health_scan = M.health
if(health_scan <= alarm_health)
pulse()
audible_message("\icon[src] *beep* *beep*", "*beep* *beep*")
toggle_scan()
return
return
/obj/item/device/assembly/health/proc/toggle_scan()
if(!secured) return 0
scanning = !scanning
if(scanning)
SSobj.processing |= src
else
SSobj.processing.Remove(src)
return
/obj/item/device/assembly/health/interact(mob/user as mob)//TODO: Change this to the wires thingy
if(!secured)
user.show_message("<span class='warning'>The [name] is unsecured!</span>")
return 0
var/dat = text("<TT><B>Health Sensor</B> <A href='?src=\ref[src];scanning=1'>[scanning?"On":"Off"]</A>")
if(scanning && health_scan)
dat += "<BR>Health: [health_scan]"
user << browse(dat, "window=hscan")
onclose(user, "hscan")
return
/obj/item/device/assembly/health/Topic(href, href_list)
..()
if(!ismob(usr))
return
var/mob/user = usr
if(!user.canUseTopic(user))
usr << browse(null, "window=hscan")
onclose(usr, "hscan")
return
if(href_list["scanning"])
toggle_scan()
if(href_list["close"])
usr << browse(null, "window=hscan")
return
attack_self(user)
return
+10 -3
View File
@@ -21,7 +21,7 @@
attach(A2,user)
name = "[A.name]-[A2.name] assembly"
update_icon()
feedback_add_details("assembly_made","[type]")
feedback_add_details("assembly_made","[A.name]-[A2.name]")
/obj/item/device/assembly_holder/proc/attach(obj/item/device/assembly/A, mob/user)
if(!A.remove_item_from_storage(src))
@@ -41,10 +41,17 @@
overlays += "[a_left.icon_state]_left"
for(var/O in a_left.attached_overlays)
overlays += "[O]_l"
if(a_right)
src.overlays += "[a_right.icon_state]_right"
var/list/images = list()
images += image(icon, icon_state = "[a_right.icon_state]_left")
for(var/O in a_right.attached_overlays)
overlays += "[O]_r"
images += image(icon, icon_state = "[O]_l")
var/matrix = matrix(-1, 0, 0, 0, 1, 0)
for(var/image/I in images)
I.transform = matrix
overlays += I
if(master)
master.update_icon()
+5
View File
@@ -12,6 +12,11 @@
sparks.set_up(2, 0, src)
sparks.attach(src)
/obj/item/device/assembly/igniter/Destroy()
qdel(sparks)
sparks = null
return ..()
/obj/item/device/assembly/igniter/activate()
if(!..()) return 0//Cooldown check
+1 -1
View File
@@ -223,4 +223,4 @@
if(previous)
previous.next = null
master.last = previous
..()
return ..()
+1
View File
@@ -4,6 +4,7 @@
icon_state = "mousetrap"
materials = list(MAT_METAL=100)
origin_tech = "combat=1"
attachable = 1
var/armed = 0
+1 -2
View File
@@ -11,8 +11,7 @@
/obj/item/assembly/shock_kit/Destroy()
qdel(part1)
qdel(part2)
..()
return
return ..()
/obj/item/assembly/shock_kit/attackby(obj/item/weapon/W, mob/user, params)
if(istype(W, /obj/item/weapon/wrench))
+1 -1
View File
@@ -22,7 +22,7 @@
/obj/item/device/assembly/signaler/Destroy()
if(radio_controller)
radio_controller.remove_object(src,frequency)
..()
return ..()
/obj/item/device/assembly/signaler/activate()
if(cooldown > 0) return 0