Merge pull request #3625 from Erthilo/dev

Megaphones, robot health analyzer, eye dropper delay, rigged cells explode in more scenarios
This commit is contained in:
Zuhayr
2013-09-01 04:53:08 -07:00
20 changed files with 172 additions and 44 deletions
@@ -268,7 +268,7 @@
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
G.cell.use(2500)
Weaken(5)
if (stuttering < 5)
@@ -248,7 +248,7 @@
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
G.cell.use(2500)
Weaken(5)
if (stuttering < 5)
@@ -22,7 +22,7 @@
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
G.cell.use(2500)
visible_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>")
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Stungloved [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been stungloved by [M.name] ([M.ckey])</font>")
@@ -440,7 +440,7 @@
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
G.cell.use(2500)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>", 1, "\red You hear someone fall.", 2)
@@ -229,7 +229,7 @@
if(G.cell)
if(M.a_intent == "hurt")//Stungloves. Any contact will stun the alien.
if(G.cell.charge >= 2500)
G.cell.charge -= 2500
G.cell.use(2500)
Weaken(5)
if (stuttering < 5)
stuttering = 5
@@ -152,3 +152,66 @@
/obj/item/robot_parts/robot_component/radio
name = "radio"
//
//Robotic Component Analyser, basically a health analyser for robots
//
/obj/item/device/robotanalyzer
name = "cyborg analyzer"
icon_state = "robotanalyzer"
item_state = "analyzer"
desc = "A hand-held scanner able to diagnose robotic injuries."
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
throwforce = 3
w_class = 1.0
throw_speed = 5
throw_range = 10
m_amt = 200
origin_tech = "magnets=1;biotech=1"
var/mode = 1;
/obj/item/device/robotanalyzer/attack(mob/living/M as mob, mob/living/user as mob)
if(( (CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50))
user << text("\red You try to analyze the floor's vitals!")
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [user] has analyzed the floor's vitals!"), 1)
user.show_message(text("\blue Analyzing Results for The floor:\n\t Overall Status: Healthy"), 1)
user.show_message(text("\blue \t Damage Specifics: [0]-[0]-[0]-[0]"), 1)
user.show_message("\blue Key: Suffocation/Toxin/Burns/Brute", 1)
user.show_message("\blue Body Temperature: ???", 1)
return
if(!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
user << "\red You don't have the dexterity to do this!"
return
if(!istype(M, /mob/living/silicon/robot))
user << "\red You can't analyze non-robotic things!"
return
user.visible_message("<span class='notice'> [user] has analyzed [M]'s components.","<span class='notice'> You have analyzed [M]'s components.")
var/BU = M.getFireLoss() > 50 ? "<b>[M.getFireLoss()]</b>" : M.getFireLoss()
var/BR = M.getBruteLoss() > 50 ? "<b>[M.getBruteLoss()]</b>" : M.getBruteLoss()
user.show_message("\blue Analyzing Results for [M]:\n\t Overall Status: [M.stat > 1 ? "fully disabled" : "[M.health - M.halloss]% functional"]")
user.show_message("\t Key: <font color='#FFA500'>Electronics</font>/<font color='red'>Brute</font>", 1)
user.show_message("\t Damage Specifics: <font color='#FFA500'>[BU]</font> - <font color='red'>[BR]</font>")
if(M.tod && M.stat == DEAD)
user.show_message("\blue Time of Disable: [M.tod]")
var/mob/living/silicon/robot/H = M
var/list/damaged = H.get_damaged_components(1,1,1)
user.show_message("\blue Localized Damage:",1)
if(length(damaged)>0)
for(var/datum/robot_component/org in damaged)
user.show_message(text("\blue \t []: [][] - [] - [] - []", \
capitalize(org.name), \
(org.installed == -1) ? "<font color='red'><b>DESTROYED</b></font> " :"",\
(org.electronics_damage > 0) ? "<font color='#FFA500'>[org.electronics_damage]</font>" :0, \
(org.brute_damage > 0) ? "<font color='red'>[org.brute_damage]</font>" :0, \
(org.toggled) ? "Toggled ON" : "<font color='red'>Toggled OFF</font>",\
(org.powered) ? "Power ON" : "<font color='red'>Power OFF</font>"),1)
else
user.show_message("\blue \t Components are OK.",1)
if(H.emagged && prob(5))
user.show_message("\red \t ERROR: INTERNAL SYSTEMS COMPROMISED",1)
src.add_fingerprint(user)
return
@@ -777,7 +777,8 @@
else
spark_system.start()
if( !(istype(W, /obj/item/device/robotanalyzer) || istype(W, /obj/item/device/healthanalyzer)) )
spark_system.start()
return ..()
/mob/living/silicon/robot/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
@@ -32,12 +32,13 @@
else
heal_overall_damage(0, -amount)
/mob/living/silicon/robot/proc/get_damaged_components(var/brute, var/burn)
/mob/living/silicon/robot/proc/get_damaged_components(var/brute, var/burn, var/destroyed = 0)
var/list/datum/robot_component/parts = list()
for(var/V in components)
var/datum/robot_component/C = components[V]
if(C.installed == 1) if((brute && C.brute_damage) || (burn && C.electronics_damage))
parts += C
if(C.installed == 1 || (C.installed == -1 && destroyed))
if((brute && C.brute_damage) || (burn && C.electronics_damage) || (!C.toggled) || (!C.powered && C.toggled))
parts += C
return parts
/mob/living/silicon/robot/proc/get_damageable_components()
@@ -77,7 +77,7 @@
user << "<span class='notice'>[arrow] plinks and crackles as it begins to glow red-hot.</span>"
arrow.throwforce = 15
arrow.icon_state = "metal-rod-superheated"
cell.charge -= 500
cell.use(500)
return
if(istype(W, /obj/item/weapon/cell))
@@ -91,7 +91,7 @@
user << "<span class='notice'>[arrow] plinks and crackles as it begins to glow red-hot.</span>"
arrow.throwforce = 15
arrow.icon_state = "metal-rod-superheated"
cell.charge -= 500
cell.use(500)
else
user << "<span class='notice'>[src] already has a cell installed.</span>"
@@ -27,6 +27,13 @@
var/trans = 0
if(ismob(target))
var/time = 20 //2/3rds the time of a syringe
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red <B>[] is trying to squirt something into []'s eyes!</B>", user, target), 1)
if(!do_mob(user, target, time)) return
if(istype(target , /mob/living/carbon/human))
var/mob/living/carbon/human/victim = target
@@ -51,15 +58,12 @@
spawn(5)
src.reagents.reaction(safe_thing, TOUCH)
user << "\blue You transfer [trans] units of the solution."
if (src.reagents.total_volume<=0)
filled = 0
icon_state = "dropper[filled]"
return
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red <B>[] squirts something into []'s eyes!</B>", user, target), 1)
src.reagents.reaction(target, TOUCH)