Merge branch 'limbsurgery'

This commit is contained in:
Chinsky
2012-11-09 14:32:22 +04:00
4 changed files with 162 additions and 5 deletions

View File

@@ -64,12 +64,18 @@ proc/build_surgery_steps_list()
/datum/surgery_step/generic/ /datum/surgery_step/generic/
var/datum/organ/external/affected //affected organ var/datum/organ/external/affected //affected organ
can_use(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) can_use(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (target_zone == "eyes") //there are specific steps for eye surgery
return 0
if (!hasorgans(target)) if (!hasorgans(target))
return 0 return 0
affected = target.get_organ(target_zone) affected = target.get_organ(target_zone)
if (affected == null) if (affected == null)
return 0 return 0
return target_zone != "eyes" //there are specific steps for eye surgery if (affected.status & ORGAN_DESTROYED)
return 0
if (affected.status & ORGAN_ROBOT)
return 0
return 1
/datum/surgery_step/generic/cut_open /datum/surgery_step/generic/cut_open
required_tool = /obj/item/weapon/scalpel required_tool = /obj/item/weapon/scalpel
@@ -834,4 +840,139 @@ proc/build_surgery_steps_list()
// LIMB SURGERY // // LIMB SURGERY //
////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////
//uh, sometime later, okay? /datum/surgery_step/limb/
can_use(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
if (!affected)
return 0
if (!(affected.status & ORGAN_DESTROYED))
return 0
if (affected.parent)
if (affected.parent.status & ORGAN_DESTROYED)
return 0
return 1
/datum/surgery_step/limb/cut
required_tool = /obj/item/weapon/scalpel
min_duration = 80
max_duration = 100
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts cutting away flesh where [target]'s [affected.display_name] used to be with \the [tool].", \
"You start cutting away flesh where [target]'s [affected.display_name] used to be with \the [tool].")
end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] cuts away flesh where [target]'s [affected.display_name] used to be with \the [tool].", \
"\blue You cut away flesh where [target]'s [affected.display_name] used to be with \the [tool].")
affected.status |= ORGAN_CUT_AWAY
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if (affected.parent)
affected = affected.parent
user.visible_message("\red [user]'s hand slips, cutting [target]'s [affected.display_name] open!", \
"\red Your hand slips, cutting [target]'s [affected.display_name] open!")
affected.createwound(CUT, 10)
/datum/surgery_step/limb/mend
required_tool = /obj/item/weapon/retractor
min_duration = 80
max_duration = 100
can_use(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.status & ORGAN_CUT_AWAY
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] is beginning reposition flesh and nerve endings where where [target]'s [affected.display_name] used to be with [tool].", \
"You start repositioning flesh and nerve endings where where [target]'s [affected.display_name] used to be with [tool].")
end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has finished repositioning flesh and nerve endings where [target]'s [affected.display_name] used to be with [tool].", \
"\blue You have finished repositioning flesh and nerve endings where [target]'s [affected.display_name] used to be with [tool].")
affected.open = 3
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if (affected.parent)
affected = affected.parent
user.visible_message("\red [user]'s hand slips, tearing flesh on [target]'s [affected.display_name]!", \
"\red Your hand slips, tearing flesh on [target]'s [affected.display_name]!")
target.apply_damage(10, BRUTE, affected)
/datum/surgery_step/limb/prepeare
required_tool = /obj/item/weapon/cautery
min_duration = 60
max_duration = 70
can_use(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.open == 3
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts adjusting area around [target]'s [affected.display_name] with \the [tool].", \
"You start adjusting area around [target]'s [affected.display_name] with \the [tool]..")
end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has finished adjusting the area around [target]'s [affected.display_name] with \the [tool].", \
"\blue You have finished adjusting the area around [target]'s [affected.display_name] with \the [tool].")
affected.status |= ORGAN_ATTACHABLE
affected.open = 0
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if (affected.parent)
affected = affected.parent
user.visible_message("\red [user]'s hand slips, searing [target]'s [affected.display_name]!", \
"\red Your hand slips, searing [target]'s [affected.display_name]!")
target.apply_damage(10, BURN, affected)
/datum/surgery_step/limb/attach
required_tool = /obj/item/robot_parts
min_duration = 80
max_duration = 100
can_use(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/robot_parts/p = tool
if (p.part)
if (!(target_zone in p.part))
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.status & ORGAN_ATTACHABLE
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts attaching [tool] where [target]'s [affected.display_name] used to be.", \
"You start attaching [tool] where [target]'s [affected.display_name] used to be.")
end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has attached [tool] where [target]'s [affected.display_name] used to be.", \
"\blue You have attached [tool] where [target]'s [affected.display_name] used to be.")
affected.robotize()
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
del(tool)
fail_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, damaging connectors on [target]'s [affected.display_name]!", \
"\red Your hand slips, damaging connectors on [target]'s [affected.display_name]!")
target.apply_damage(10, BRUTE, affected)

View File

@@ -378,8 +378,8 @@
if(!no_explode) if(!no_explode)
explosion(get_turf(owner),-1,-1,2,3) explosion(get_turf(owner),-1,-1,2,3)
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() 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.set_up(5, 0, owner)
spark_system.attach(src) spark_system.attach(owner)
spark_system.start() spark_system.start()
spawn(10) spawn(10)
del(spark_system) del(spark_system)
@@ -477,6 +477,17 @@
else else
return name return name
proc/robotize()
src.status &= ~ORGAN_BROKEN
src.status &= ~ORGAN_BLEEDING
src.status &= ~ORGAN_SPLINTED
src.status &= ~ORGAN_ATTACHABLE
src.status &= ~ORGAN_DESTROYED
src.status |= ORGAN_ROBOT
for (var/datum/organ/external/T in children)
if(T)
T.robotize()
/datum/organ/external/chest /datum/organ/external/chest
name = "chest" name = "chest"
icon_name = "chest" icon_name = "chest"

View File

@@ -188,7 +188,7 @@
return return
if (can_operate(M)) //Checks if mob is lying down on table for surgery if (can_operate(M)) //Checks if mob is lying down on table for surgery
if(istype(M,/mob/living/carbon)) if(istype(M,/mob/living/carbon))
if (user.a_intent == "help" || (user.a_intent != "harm" && is_surgery_tool(src))) if (user.a_intent != "harm")
if(surgery_steps == null) build_surgery_steps_list() if(surgery_steps == null) build_surgery_steps_list()
for(var/datum/surgery_step/S in surgery_steps) for(var/datum/surgery_step/S in surgery_steps)
//check if tool is right or close enough //check if tool is right or close enough

View File

@@ -7,6 +7,7 @@
slot_flags = SLOT_BELT slot_flags = SLOT_BELT
var/construction_time = 100 var/construction_time = 100
var/list/construction_cost = list("metal"=20000,"glass"=5000) var/list/construction_cost = list("metal"=20000,"glass"=5000)
var/list/part = null
/obj/item/robot_parts/l_arm /obj/item/robot_parts/l_arm
name = "Cyborg Left Arm" name = "Cyborg Left Arm"
@@ -14,6 +15,7 @@
icon_state = "l_arm" icon_state = "l_arm"
construction_time = 200 construction_time = 200
construction_cost = list("metal"=18000) construction_cost = list("metal"=18000)
part = list("l_arm","l_hand")
/obj/item/robot_parts/r_arm /obj/item/robot_parts/r_arm
name = "Cyborg Right Arm" name = "Cyborg Right Arm"
@@ -21,6 +23,7 @@
icon_state = "r_arm" icon_state = "r_arm"
construction_time = 200 construction_time = 200
construction_cost = list("metal"=18000) construction_cost = list("metal"=18000)
part = list("r_arm","r_hand")
/obj/item/robot_parts/l_leg /obj/item/robot_parts/l_leg
name = "Cyborg Left Leg" name = "Cyborg Left Leg"
@@ -28,6 +31,7 @@
icon_state = "l_leg" icon_state = "l_leg"
construction_time = 200 construction_time = 200
construction_cost = list("metal"=15000) construction_cost = list("metal"=15000)
part = list("l_leg","l_foot")
/obj/item/robot_parts/r_leg /obj/item/robot_parts/r_leg
name = "Cyborg Right Leg" name = "Cyborg Right Leg"
@@ -35,6 +39,7 @@
icon_state = "r_leg" icon_state = "r_leg"
construction_time = 200 construction_time = 200
construction_cost = list("metal"=15000) construction_cost = list("metal"=15000)
part = list("r_leg","r_foot")
/obj/item/robot_parts/chest /obj/item/robot_parts/chest
name = "Cyborg Torso" name = "Cyborg Torso"