Baystation Update Merge 01

Mahoosive update. A lot of things.
This commit is contained in:
skull132
2014-04-16 23:54:43 +03:00
parent defa9e7fd4
commit 6d192181ea
383 changed files with 36251 additions and 10238 deletions
+4 -1
View File
@@ -217,7 +217,10 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
var/datum/reagent/blood/injected = get_blood(container.reagents)
if (!injected)
return
src.virus2 |= virus_copylist(injected.data["virus2"])
var/list/sniffles = virus_copylist(injected.data["virus2"])
for(var/ID in sniffles)
var/datum/disease2/disease/sniffle = sniffles[ID]
infect_virus2(src,sniffle,1)
if (injected.data["antibodies"] && prob(5))
antibodies |= injected.data["antibodies"]
var/list/chems = list()
+56 -40
View File
@@ -69,54 +69,70 @@
/mob/living/carbon/human/proc/handle_organs()
number_wounds = 0
var/leg_tally = 2
for(var/datum/organ/external/E in organs)
var/force_process = 0
var/damage_this_tick = getBruteLoss() + getFireLoss() + getToxLoss()
if(damage_this_tick > last_dam)
force_process = 1
last_dam = damage_this_tick
if(!force_process && !bad_external_organs.len)
return
if(force_process)
bad_external_organs.Cut()
for(var/datum/organ/external/Ex in organs)
bad_external_organs += Ex
for(var/datum/organ/external/E in bad_external_organs)
if(!E)
continue
E.process()
number_wounds += E.number_wounds
if(!E.need_process())
bad_external_organs -= E
continue
else
E.process()
number_wounds += E.number_wounds
//Robotic limb malfunctions
var/malfunction = 0
if (E.status & ORGAN_ROBOT && prob(E.brute_dam + E.burn_dam))
malfunction = 1
//Robotic limb malfunctions
var/malfunction = 0
if (E.status & ORGAN_ROBOT && prob(E.brute_dam + E.burn_dam))
malfunction = 1
//Broken limbs hurt too
var/broken = 0
if(E.status & ORGAN_BROKEN && !(E.status & ORGAN_SPLINTED) )
broken = 1
//Broken limbs hurt too
var/broken = 0
if(E.status & ORGAN_BROKEN && !(E.status & ORGAN_SPLINTED) )
broken = 1
//Moving around with fractured ribs won't do you any good
if (broken && E.internal_organs && prob(15))
if (!lying && world.timeofday - l_move_time < 15)
var/datum/organ/internal/I = pick(E.internal_organs)
custom_pain("You feel broken bones moving in your [E.display_name]!", 1)
I.take_damage(rand(3,5))
//Moving around with fractured ribs won't do you any good
if (broken && E.internal_organs && prob(15))
if (!lying && world.timeofday - l_move_time < 15)
var/datum/organ/internal/I = pick(E.internal_organs)
custom_pain("You feel broken bones moving in your [E.display_name]!", 1)
I.take_damage(rand(3,5))
//Special effects for limbs.
if(E.name in list("l_hand","l_arm","r_hand","r_arm") && (broken||malfunction))
var/obj/item/c_hand //Getting what's in this hand
if(E.name == "l_hand" || E.name == "l_arm")
c_hand = l_hand
if(E.name == "r_hand" || E.name == "r_arm")
c_hand = r_hand
//Special effects for limbs.
if(E.name in list("l_hand","l_arm","r_hand","r_arm") && (broken||malfunction))
var/obj/item/c_hand //Getting what's in this hand
if(E.name == "l_hand" || E.name == "l_arm")
c_hand = l_hand
if(E.name == "r_hand" || E.name == "r_arm")
c_hand = r_hand
if (c_hand)
u_equip(c_hand)
if (c_hand)
u_equip(c_hand)
if(broken)
emote("me", 1, "[(species && species.flags & NO_PAIN) ? "" : "screams in pain and"] drops what they were holding in their [E.display_name?"[E.display_name]":"[E]"]!")
if(malfunction)
emote("me", 1, "drops what they were holding, their [E.display_name?"[E.display_name]":"[E]"] malfunctioning!")
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
spark_system.set_up(5, 0, src)
spark_system.attach(src)
spark_system.start()
spawn(10)
del(spark_system)
if(broken)
emote("me", 1, "[(species && species.flags & NO_PAIN) ? "" : "screams in pain and"] drops what they were holding in their [E.display_name?"[E.display_name]":"[E]"]!")
if(malfunction)
emote("me", 1, "drops what they were holding, their [E.display_name?"[E.display_name]":"[E]"] malfunctioning!")
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
spark_system.set_up(5, 0, src)
spark_system.attach(src)
spark_system.start()
spawn(10)
del(spark_system)
else if(E.name in list("l_leg","l_foot","r_leg","r_foot") && !lying)
if (!E.is_usable() || malfunction || (broken && !(E.status & ORGAN_SPLINTED)))
leg_tally-- // let it fail even if just foot&leg
else if(E.name in list("l_leg","l_foot","r_leg","r_foot") && !lying)
if (!E.is_usable() || malfunction || (broken && !(E.status & ORGAN_SPLINTED)))
leg_tally-- // let it fail even if just foot&leg
// standing is poor
if(leg_tally <= 0 && !paralysis && !(lying || resting) && prob(5))
@@ -124,7 +140,7 @@
emote("scream")
emote("collapse")
paralysis = 10
//Check arms and legs for existence
can_stand = 2 //can stand on both legs
var/datum/organ/external/E = organs_by_name["l_foot"]
+71 -10
View File
@@ -12,6 +12,7 @@
var/burn_dam = 0
var/max_damage = 0
var/max_size = 0
var/last_dam = -1
var/display_name
var/list/wounds = list()
@@ -77,9 +78,19 @@
if(status & ORGAN_DESTROYED)
return 0
if(status & ORGAN_ROBOT)
brute *= 0.66 //~2/3 damage for ROBOLIMBS
burn *= 0.66 //~2/3 damage for ROBOLIMBS
if(status & ORGAN_ROBOT )
var/brmod = 0.66
var/bumod = 0.66
if(istype(owner,/mob/living/carbon/human))
var/mob/living/carbon/human/H = owner
if(H.species && H.species.flags & IS_SYNTHETIC)
brmod = H.species.brute_mod
bumod = H.species.burn_mod
brute *= brmod //~2/3 damage for ROBOLIMBS
burn *= bumod //~2/3 damage for ROBOLIMBS
//If limb took enough damage, try to cut or tear it off
if(body_part != UPPER_TORSO && body_part != LOWER_TORSO) //as hilarious as it is, getting hit on the chest too much shouldn't effectively gib you.
@@ -188,7 +199,10 @@ This function completely restores a damaged organ to perfect condition.
*/
/datum/organ/external/proc/rejuvenate()
damage_state = "00"
status = 0
if(status & 128) //Robotic organs stay robotic. Fix because right click rejuvinate makes IPC's organs organic.
status = 128
else
status = 0
perma_injury = 0
brute_dam = 0
burn_dam = 0
@@ -260,6 +274,19 @@ This function completely restores a damaged organ to perfect condition.
PROCESSING & UPDATING
****************************************************/
//Determines if we even need to process this organ.
/datum/organ/external/proc/need_process()
if(status && status != ORGAN_ROBOT) // If it's robotic, that's fine it will have a status.
return 1
if(brute_dam || burn_dam)
return 1
if(last_dam != brute_dam + burn_dam) // Process when we are fully healed up.
last_dam = brute_dam + burn_dam
return 1
last_dam = brute_dam + burn_dam
return 0
/datum/organ/external/process()
// Process wounds, doing healing etc. Only do this every few ticks to save processing power
if(owner.life_tick % wound_update_accuracy == 0)
@@ -490,7 +517,10 @@ This function completely restores a damaged organ to perfect condition.
if(LOWER_TORSO)
owner << "\red You are now sterile."
if(HEAD)
organ= new /obj/item/weapon/organ/head(owner.loc, owner)
if(owner.species.flags & IS_SYNTHETIC)
organ= new /obj/item/weapon/organ/head/posi(owner.loc, owner)
else
organ= new /obj/item/weapon/organ/head(owner.loc, owner)
owner.u_equip(owner.glasses)
owner.u_equip(owner.head)
owner.u_equip(owner.l_ear)
@@ -557,11 +587,28 @@ This function completely restores a damaged organ to perfect condition.
owner.update_body(1)
// OK so maybe your limb just flew off, but if it was attached to a pair of cuffs then hooray! Freedom!
release_restraints()
/****************************************************
HELPERS
****************************************************/
/datum/organ/external/proc/release_restraints()
if (owner.handcuffed && body_part in list(ARM_LEFT, ARM_RIGHT, HAND_LEFT, HAND_RIGHT))
owner.visible_message(\
"\The [owner.handcuffed.name] falls off of [owner.name].",\
"\The [owner.handcuffed.name] falls off you.")
owner.drop_from_inventory(owner.handcuffed)
if (owner.legcuffed && body_part in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT))
owner.visible_message(\
"\The [owner.legcuffed.name] falls off of [owner.name].",\
"\The [owner.legcuffed.name] falls off you.")
owner.drop_from_inventory(owner.legcuffed)
/datum/organ/external/proc/bandage()
var/rval = 0
src.status &= ~ORGAN_BLEEDING
@@ -590,7 +637,10 @@ This function completely restores a damaged organ to perfect condition.
/datum/organ/external/proc/fracture()
if(status & ORGAN_BROKEN)
return
owner.visible_message("\red You hear a loud cracking sound coming from \the [owner].","\red <b>Something feels like it shattered in your [display_name]!</b>","You hear a sickening crack.")
owner.visible_message(\
"\red You hear a loud cracking sound coming from \the [owner].",\
"\red <b>Something feels like it shattered in your [display_name]!</b>",\
"You hear a sickening crack.")
if(owner.species && !(owner.species.flags & NO_PAIN))
owner.emote("scream")
@@ -599,6 +649,10 @@ This function completely restores a damaged organ to perfect condition.
broken_description = pick("broken","fracture","hairline fracture")
perma_injury = brute_dam
// Fractures have a chance of getting you out of restraints
if (prob(25))
release_restraints()
/datum/organ/external/proc/robotize()
src.status &= ~ORGAN_BROKEN
src.status &= ~ORGAN_BLEEDING
@@ -630,7 +684,7 @@ This function completely restores a damaged organ to perfect condition.
return 0
/datum/organ/external/get_icon(gender="")
if (status & ORGAN_ROBOT)
if (status & ORGAN_ROBOT && !(owner.species && owner.species.flags & IS_SYNTHETIC))
return new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]")
if (status & ORGAN_MUTATED)
@@ -844,6 +898,9 @@ obj/item/weapon/organ/head
var/mob/living/carbon/brain/brainmob
var/brain_op_stage = 0
/obj/item/weapon/organ/head/posi
name = "robotic head"
obj/item/weapon/organ/head/New(loc, mob/living/carbon/human/H)
if(istype(H))
src.icon_state = H.gender == MALE? "head_m" : "head_f"
@@ -916,7 +973,7 @@ obj/item/weapon/organ/head/attackby(obj/item/weapon/W as obj, mob/user as mob)
switch(brain_op_stage)
if(1)
for(var/mob/O in (oviewers(brainmob) - user))
O.show_message("\red [brainmob] has \his skull sawed open with [W] by [user].", 1)
O.show_message("\red [brainmob] has \his head sawed open with [W] by [user].", 1)
brainmob << "\red [user] begins to saw open your head with [W]!"
user << "\red You saw [brainmob]'s head open with [W]!"
@@ -931,8 +988,12 @@ obj/item/weapon/organ/head/attackby(obj/item/weapon/W as obj, mob/user as mob)
brainmob.attack_log += "\[[time_stamp()]\]<font color='orange'> Debrained by [user.name] ([user.ckey]) with [W.name] (INTENT: [uppertext(user.a_intent)])</font>"
msg_admin_attack("[user] ([user.ckey]) debrained [brainmob] ([brainmob.ckey]) (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
var/obj/item/brain/B = new(loc)
B.transfer_identity(brainmob)
if(istype(src,/obj/item/weapon/organ/head/posi))
var/obj/item/device/mmi/posibrain/B = new(loc)
B.transfer_identity(brainmob)
else
var/obj/item/brain/B = new(loc)
B.transfer_identity(brainmob)
brain_op_stage = 4.0
else