Merge remote-tracking branch 'tgstation/master' into point-zero

Conflicts:
	code/modules/research/protolathe.dm
This commit is contained in:
bear1ake
2015-09-12 21:07:40 +09:00
64 changed files with 1940 additions and 1520 deletions
-6
View File
@@ -105,12 +105,6 @@
user << "<span class='notice'>\The [src] can now be attached!</span>"
return
..()
return
/obj/item/device/assembly/process()
SSobj.processing.Remove(src)
return
/obj/item/device/assembly/examine(mob/user)
+198 -197
View File
@@ -1,197 +1,198 @@
/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
/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
materials = list(MAT_METAL = 300, MAT_GLASS = 300)
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
+16 -5
View File
@@ -10,6 +10,16 @@
var/obj/effect/beam/i_beam/first = null
var/obj/effect/beam/i_beam/last = null
/obj/item/device/assembly/infra/New()
..()
SSobj.processing |= src
/obj/item/device/assembly/infra/Destroy()
if(first)
qdel(first)
return ..()
/obj/item/device/assembly/infra/describe()
return "The infrared trigger is [on?"on":"off"]."
@@ -25,7 +35,8 @@
SSobj.processing |= src
else
on = 0
if(first) qdel(first)
if(first)
qdel(first)
SSobj.processing.Remove(src)
update_icon()
return secured
@@ -45,7 +56,7 @@
if(!on)
if(first)
qdel(first)
return
return
if(!secured)
return
if(first && last)
@@ -96,7 +107,7 @@
/obj/item/device/assembly/infra/interact(mob/user)//TODO: change this this to the wire control panel
if(is_secured(user))
user.set_machine(src)
var/dat = text("<TT><B>Infrared Laser</B>\n<B>Status</B>: []<BR>\n<B>Visibility</B>: []<BR>\n</TT>", (on ? text("<A href='?src=\ref[];state=0'>On</A>", src) : text("<A href='?src=\ref[];state=1'>Off</A>", src)), (src.visible ? text("<A href='?src=\ref[];visible=0'>Visible</A>", src) : text("<A href='?src=\ref[];visible=1'>Invisible</A>", src)))
var/dat = "<TT><B>Infrared Laser</B>\n<B>Status</B>: [on ? "<A href='?src=\ref[src];state=0'>On</A>" : "<A href='?src=\ref[src];state=1'>Off</A>"]<BR>\n<B>Visibility</B>: [visible ? "<A href='?src=\ref[src];visible=0'>Visible</A>" : "<A href='?src=\ref[src];visible=1'>Invisible</A>"]<BR>\n</TT>"
dat += "<BR><BR><A href='?src=\ref[src];refresh=1'>Refresh</A>"
dat += "<BR><BR><A href='?src=\ref[src];close=1'>Close</A>"
user << browse(dat, "window=infra")
@@ -105,7 +116,7 @@
/obj/item/device/assembly/infra/Topic(href, href_list)
..()
if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
if(usr.incapacitated() || !in_range(loc, usr))
usr << browse(null, "window=infra")
onclose(usr, "infra")
return
@@ -127,7 +138,7 @@
set category = "Object"
set src in usr
if(usr.stat || !usr.canmove || usr.restrained())
if(usr.incapacitated())
return
dir = turn(dir, 90)
+12 -10
View File
@@ -15,6 +15,11 @@
/obj/item/device/assembly/prox_sensor/proc/sense()
/obj/item/device/assembly/prox_sensor/New()
..()
SSobj.processing |= src
/obj/item/device/assembly/prox_sensor/describe()
if(timing)
return "<span class='notice'>The proximity sensor is arming.</span>"
@@ -24,7 +29,7 @@
if(!..()) return 0//Cooldown check
timing = !timing
update_icon()
return 0
return 1
/obj/item/device/assembly/prox_sensor/toggle_secure()
@@ -55,13 +60,12 @@
/obj/item/device/assembly/prox_sensor/process()
if(timing && (time >= 0))
if(timing)
time--
if(timing && time <= 0)
timing = 0
toggle_scan()
time = 10
return
if(time <= 0)
timing = 0
toggle_scan()
time = initial(time)
/obj/item/device/assembly/prox_sensor/dropped()
@@ -113,7 +117,7 @@
/obj/item/device/assembly/prox_sensor/Topic(href, href_list)
..()
if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
if(usr.incapacitated() || !in_range(loc, usr))
usr << browse(null, "window=prox")
onclose(usr, "prox")
return
@@ -137,5 +141,3 @@
if(usr)
attack_self(usr)
return
+12 -12
View File
@@ -10,6 +10,10 @@
var/time = 5
/obj/item/device/assembly/timer/New()
..()
SSobj.processing |= src
/obj/item/device/assembly/timer/describe()
if(timing)
return "The timer is counting down from [time]!"
@@ -20,7 +24,7 @@
if(!..()) return 0//Cooldown check
timing = !timing
update_icon()
return 0
return 1
/obj/item/device/assembly/timer/toggle_secure()
@@ -42,17 +46,16 @@
cooldown = 2
spawn(10)
process_cooldown()
return
update_icon()
/obj/item/device/assembly/timer/process()
if(timing && (time > 0))
if(timing)
time--
if(timing && time <= 0)
timing = 0
timer_end()
time = initial(time)
return
if(time <= 0)
timing = 0
timer_end()
time = initial(time)
/obj/item/device/assembly/timer/update_icon()
@@ -63,7 +66,6 @@
attached_overlays += "timer_timing"
if(holder)
holder.update_icon()
return
/obj/item/device/assembly/timer/interact(mob/user)//TODO: Have this use the wires
@@ -76,12 +78,11 @@
var/datum/browser/popup = new(user, "timer", name)
popup.set_content(dat)
popup.open()
return
/obj/item/device/assembly/timer/Topic(href, href_list)
..()
if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
if(usr.incapacitated() || !in_range(loc, usr))
usr << browse(null, "window=timer")
onclose(usr, "timer")
return
@@ -107,4 +108,3 @@
if(usr)
attack_self(usr)
return