Merge branch 'Bleeding-Edge' of github.com:d3athrow/vgstation13 into Bleeding-Edge

This commit is contained in:
Rob Nelson
2014-08-17 14:16:37 -07:00
7 changed files with 113 additions and 71 deletions

View File

@@ -678,6 +678,7 @@ steam.start() -- spawns the effect
/obj/effect/effect/foam/fire
name = "fire supression foam"
icon_state = "mfoam"
/obj/effect/effect/foam/New(loc, var/ismetal=0)
. = ..(loc)
@@ -699,28 +700,25 @@ steam.start() -- spawns the effect
sleep(5)
qdel(src)
/obj/effect/effect/foam/fire/New(loc, var/ismetal=0)
icon_state = "[ismetal ? "m":""]foam"
metal = ismetal
/obj/effect/effect/foam/fire/New(loc, datum/reagents/R)
reagents = R
reagents.my_atom = src
var/ccolor = mix_color_from_reagents(reagents.reagent_list)
if(ccolor)
icon += ccolor
//playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3)
var/turf/simulated/T = get_turf(src)
if(istype(T))
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() )
lowertemp.temperature = max( min(lowertemp.temperature-500,lowertemp.temperature / 2) ,0)
lowertemp.react()
T.assume_air(lowertemp)
spawn(3 + metal*3)
if(reagents.has_reagent("water"))
var/turf/simulated/T = get_turf(src)
if(istype(T))
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() )
lowertemp.temperature = max( min(lowertemp.temperature-500,lowertemp.temperature / 2) ,0)
lowertemp.react()
T.assume_air(lowertemp)
spawn(3)
process()
spawn(120)
processing_objects.Remove(src)
sleep(30)
if(metal)
var/obj/structure/foamedmetal/M = new(src.loc)
M.metal = metal
M.updateicon()
flick("[icon_state]-disolve", src)
sleep(5)
qdel(src)
@@ -777,7 +775,12 @@ steam.start() -- spawns the effect
/obj/effect/effect/foam/Crossed(var/atom/movable/AM)
if(metal || istype(src, /obj/effect/effect/foam/fire))
if(metal)
return
if(istype(src, /obj/effect/effect/foam/fire))
if(isliving(AM))
var/mob/living/M = AM
reagents.reaction(M)
return
if (istype(AM, /mob/living/carbon))

View File

@@ -1,6 +1,6 @@
/obj/item/weapon/melee/defibrillator
name = "emergency defibrillator"
desc = "A handheld emergency defibrillator, used to bring people back from the brink of death or put them there."
desc = "A handheld emergency defibrillator, used to recall people back from the etheral planes or send them there."
icon_state = "defib_full"
item_state = "defib"
flags = FPRINT | TABLEPASS
@@ -17,7 +17,7 @@
suicide_act(mob/user)
viewers(user) << "\red <b>[user] is putting the live paddles on \his chest! It looks like \he's trying to commit suicide.</b>"
playsound(get_turf(src), 'sound/items/defib.ogg', 50, 1)
return (OXYLOSS)
return (FIRELOSS)
/obj/item/weapon/melee/defibrillator/update_icon()
if(!status)
@@ -42,8 +42,12 @@
spark_system.attach(user)
spark_system.set_up(5, 0, src)
spark_system.start()
user << "\red You touch the paddles together shorting the device."
user << "\red You touch the paddles together, shorting the device."
playsound(get_turf(src), "sparks", 75, 1, -1)
user.Weaken(5)
var/mob/living/carbon/human/H = user
if(ishuman(user))
H.apply_damage(10, BURN)
charges--
if(charges < 1)
status = 0
@@ -73,21 +77,29 @@
overlays -= I
/obj/item/weapon/melee/defibrillator/attack(mob/M as mob, mob/user as mob)
var/tobehealed
var/threshhold = -config.health_threshold_dead
var/mob/living/carbon/human/H = M
if(!ishuman(M))
..()
return
var/datum/organ/internal/heart/dropthebeat = H.internal_organs["heart"]
if(status)
if(user.a_intent == "hurt" && emagged)
H.visible_message("<span class='danger'>[M.name] has been touched by the defibrillator paddles by [user]!</span>")
if(emagged)
H.visible_message("<span class='danger'>[M.name] has been touched by the defibrillator paddles in the chest by [user]!</span>")
if(charges >= 2)
H.Weaken(10)
H.adjustOxyLoss(10)
H.apply_damage(20, BURN, "chest")
if(prob(80)) //Life 101 : Sending loadse electricity through your chest is bad for your heart
if(prob(60))
H.apply_damage(10, BURN, "chest") //Bonus
dropthebeat.damage += 5 //Ouchie
H.emote("gasp")
else
H.apply_damage(30, BURN, "chest") //Dead
dropthebeat.damage += 60 //Drop the beat
H.emote("scream") //I have no beat and I must scream
else
H.Weaken(5)
H.adjustOxyLoss(5)
H.apply_damage(10, BURN)
H.updatehealth() //forces health update before next life tick
spark_system.attach(M)
spark_system.set_up(5, 0, M)
@@ -99,46 +111,50 @@
status = 0
update_icon()
playsound(get_turf(src), 'sound/items/defib.ogg', 50, 1)
user.attack_log += "\[[time_stamp()]\]<font color='red'> Defibrillated [H.name] ([H.ckey]) with [src.name]</font>"
H.attack_log += "\[[time_stamp()]\]<font color='orange'> Defibrillated by [user.name] ([user.ckey]) with [src.name]</font>"
log_attack("<font color='red'>[user.name] ([user.ckey]) defibrillated [H.name] ([H.ckey]) with [src.name]</font>" )
user.attack_log += "\[[time_stamp()]\]<font color='red'> Shocked [H.name] ([H.ckey]) with an emagged [src.name]</font>"
H.attack_log += "\[[time_stamp()]\]<font color='orange'> Shocked by [user.name] ([user.ckey]) with an emagged [src.name]</font>"
log_attack("<font color='red'>[user.name] ([user.ckey]) shocked [H.name] ([H.ckey]) with an emagged [src.name]</font>" )
if(!iscarbon(user))
M.LAssailant = null
else
M.LAssailant = user
return
H.visible_message("\blue [user] places the defibrillator paddles on [M.name]'s chest.", "\blue You place the defibrillator paddles on [M.name]'s chest.")
if(do_after(user, 10))
H.visible_message("\blue [user] starts setting up the defibrillator paddles on [M.name]'s chest.", "\blue You place the defibrillator paddles on [M.name]'s chest.")
if(do_after(user, 50))
if(H.stat == 2 || H.stat == DEAD)
var/uni = 0
var/armor = 0
var/health = H.health
var/fixable = H.getOxyLoss() //Simple but efficient. You'd have popped a Dex+ pill anyways
playsound(get_turf(src), 'sound/items/defib.ogg', 50, 1)
spark_system.attach(M)
spark_system.set_up(5, 0, M)
spark_system.start()
for(var/obj/item/carried_item in H.contents)
if(istype(carried_item, /obj/item/clothing/under))
uni = 1
if(istype(carried_item, /obj/item/clothing/suit/armor))
armor = 1
if(uni && armor)
if(prob(30))
spark_system.attach(M)
spark_system.start()
if(prob(30))
tobehealed = health + threshhold
tobehealed -= 5 //They get 5 health in crit to heal the person or inject stabilizers
H.adjustOxyLoss(tobehealed)
else if(uni || armor)
if(prob(30))
spark_system.attach(M)
spark_system.start()
if(prob(60))
tobehealed = health + threshhold
tobehealed -= 5 //They get 5 health in crit to heal the person or inject stabilizers
H.adjustOxyLoss(tobehealed)
if(armor) //I'm sure I should apply the paddles on hardsuit plating
if(prob(95))
viewers(M) << "\red [src] buzzes: Resuscitation failed. Please apply on bare skin"
H.apply_damage(5, BURN, "chest")
return
else
H.apply_damage(-fixable, OXY) //Tada
else if(uni && !armor) //Just a suit, still bad
if(prob(50))
viewers(M) << "\red [src] buzzes: Resuscitation failed. Please apply on bare skin"
H.apply_damage(10, BURN, "chest")
return
else
H.apply_damage(-fixable, OXY)
else
if(prob(90))
tobehealed = health + threshhold
tobehealed -= 5 //They get 5 health in crit to heal the person or inject stabilizers
H.adjustOxyLoss(tobehealed)
if(prob(5))
viewers(M) << "\red [src] buzzes: Resuscitation failed. Please apply on bare skin"
H.apply_damage(15, BURN, "chest")
return
else
H.apply_damage(-fixable, OXY)
H.updatehealth() //forces a health update, otherwise the oxyloss adjustment wouldnt do anything
M.visible_message("\red [M]'s body convulses a bit.")
var/datum/organ/external/temp = H.get_organ("head")
@@ -148,13 +164,17 @@
H.stat = 1
dead_mob_list -= H
living_mob_list |= list(H)
flick("e_flash", M.flash)
H.apply_effect(10, EYE_BLUR)
H.apply_effect(10, PARALYZE)
H << "<span class='notice'><b>You suddenly feel a spark and your consciousness returns, dragging you back to the mortal plane.</b><br><i>Not today.</i></span>"
H.emote("gasp")
else
viewers(M) << "\blue [src] beeps: Resuscitation failed."
viewers(M) << "\red [src] buzzes: Resuscitation failed. Patient is beyond saving"
charges--
if(charges < 1)
charges = 0
status = 0
update_icon()
else
user.visible_message("\blue [src] beeps: Patient is not in a valid state.")
user.visible_message("\red [src] buzzes: Patient is not in need of resuscitation.")

View File

@@ -46,10 +46,6 @@
item_state = "foam_extinguisher"
sprite_name = "foam_extinguisher"
/obj/item/weapon/extinguisher/foam/attackby(obj/item/W, mob/user)
return // no filling this with fun stuff.
/obj/item/weapon/extinguisher/examine()
set src in usr
@@ -273,18 +269,13 @@
for(var/a=0, a<5, a++)
spawn(0)
var/obj/effect/effect/foam/fire/W = new /obj/effect/effect/foam/fire( get_turf(src) )
var/turf/my_target = pick(the_targets)
var/datum/reagents/R = new/datum/reagents(5)
if(!W) return
W.reagents = R
R.my_atom = W
reagents.trans_to_holder(R,1)
var/obj/effect/effect/foam/fire/W = new /obj/effect/effect/foam/fire( get_turf(src) , R)
var/turf/my_target = pick(the_targets)
if(!W || !src) return
src.reagents.trans_to(W,1)
for(var/b=0, b<5, b++)
var/turf/oldturf = get_turf(W)
step_towards(W,my_target)
if(!W || !W.reagents) return
W.reagents.reaction(get_turf(W), TOUCH)
@@ -297,10 +288,7 @@
var/obj/effect/effect/foam/fire/F = locate() in oldturf
if(!istype(F) && oldturf != get_turf(src))
F = new /obj/effect/effect/foam/fire( get_turf(oldturf) )
F.reagents = new/datum/reagents(5)
F.reagents.my_atom = F
W.reagents.trans_to(F,1)
F = new /obj/effect/effect/foam/fire( get_turf(oldturf) , W.reagents)
if(W.loc == my_target) break
sleep(2)

View File

@@ -52,6 +52,14 @@
return 1
/obj/structure/closet/proc/dump_contents()
if(usr)
var/mob/living/L = usr
var/obj/machinery/power/supermatter/SM = locate() in contents
if(istype(SM))
message_admins("[L.name] ([L.ckey]) opened \the [src] that contained supermatter (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[L.x];Y=[L.y];Z=[L.z]'>JMP</a>)")
log_game("[L.name] ([L.ckey]) opened \the [src] that contained supermatter (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[L.x];Y=[L.y];Z=[L.z]'>JMP</a>)")
//Cham Projector Exception
for(var/obj/effect/dummy/chameleon/AD in src)
AD.loc = src.loc

View File

@@ -117,6 +117,29 @@ datum
R.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data)
src.remove_reagent(current_reagent.id, current_reagent_transfer)
// Called from add/remove_agent. -- N3X
//src.update_total()
//R.update_total()
R.handle_reactions()
src.handle_reactions()
return amount
trans_to_holder(var/datum/reagents/target, var/amount=1, var/multiplier=1, var/preserve_data=1)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
if (!target || src.total_volume<=0)
return
var/datum/reagents/R = target
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
var/part = amount / src.total_volume
var/trans_data = null
for (var/datum/reagent/current_reagent in src.reagent_list)
if (!current_reagent)
continue
var/current_reagent_transfer = current_reagent.volume * part
if(preserve_data)
trans_data = current_reagent.data
R.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data)
src.remove_reagent(current_reagent.id, current_reagent_transfer)
// Called from add/remove_agent. -- N3X
//src.update_total()
//R.update_total()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 KiB

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB