12/21 modernizations from TG live (#103)

* sync (#3)

* shuttle auto call

* Merge /vore into /master (#39)

* progress

* Compile errors fixed

No idea if it's test worthy tho as conflicts with race overhaul and
narky removal.

* Update admins.txt

* efforts continue

Fuck grab code, seriously

* grab code is cancer

* Execute the Narkism

Do not hesitate.

Show no mercy.

* holy shit grab code is awful

* have I bitched about grab code

My bitching, let me show you it

* código de agarre es una mierda

No really it is

* yeah I don't even know anymore.

* Lolnope. Fuck grab code

* I'm not even sure what to fix anymore

* Self eating is not an acceptable fate

* Taste the void, son.

* My code doesn't pass it's own sanity check.

Maybe it's a sign of things to come.

* uncommented and notes

* It Works and I Don't Know Why (#38)

* shuttle auto call

* it works and I don't know why

* Subsystem 12/21

Most Recent TG subsystem folder

* globalvars 12/21

Tossed out the flavor_misc and parallax files

* Onclick 12/21

as well as .dme updates

* _defines 12/21

ommited old _MC.dm

* _HELPERS 12/21

Preserved snowflake placement of furry sprites

* _defeines/genetics

reapplied narkism holdover for snowflake races.

* Oops forgot mutant colors

* modules porting 12/21 + Sounds/icons

Admin, Client and most of mob life files ommitted

* enviroment file

* Admin optimizations

ahelp log system kept

* Mob ports 12/21

Flavor text preserved

* datums ported 12/21

* Game ported 12/21

* batch of duplicate fixes/dogborg work

Dogborgs need to be modernized to refractored borg standards.

* moar fixes

* Maps and futher compile fixes
This commit is contained in:
Poojawa
2016-12-22 03:57:55 -06:00
committed by GitHub
parent f5e143a452
commit cf59ac1c3d
2215 changed files with 707445 additions and 87041 deletions
+268 -74
View File
@@ -4,17 +4,22 @@
desc = "why is it detached..."
force = 3
throwforce = 3
icon = 'icons/mob/human_parts.dmi'
icon_state = ""
var/mob/living/carbon/human/owner = null
var/status = ORGAN_ORGANIC
layer = BELOW_MOB_LAYER //so it isn't hidden behind objects when on the floor
var/mob/living/carbon/owner = null
var/mob/living/carbon/original_owner = null
var/status = BODYPART_ORGANIC
var/body_zone //"chest", "l_arm", etc , used for def_zone
var/body_part = null //bitflag used to check which clothes cover this bodypart
var/use_digitigrade = NOT_DIGITIGRADE //Used for alternate legs, useless elsewhere
var/brutestate = 0
var/burnstate = 0
var/brute_dam = 0
var/burn_dam = 0
var/max_damage = 0
var/list/embedded_objects = list()
var/held_index = 0 //are we a hand? if so, which one!
//Coloring and proper item icon update
var/skin_tone = ""
@@ -26,10 +31,14 @@
var/mutation_color = ""
var/no_update = 0
var/animal_origin = null //for nonhuman bodypart (e.g. monkey)
var/dismemberable = 1 //whether it can be dismembered with a weapon.
var/px_x = 0
var/px_y = 0
var/state_flags
var/species_flags_list = list()
var/dmg_overlay_type //the type of damage overlay (if any) to use when this bodypart is bruised/burned.
/obj/item/bodypart/examine(mob/user)
..()
@@ -38,6 +47,8 @@
if(burn_dam > 0)
user << "<span class='warning'>This limb has [burn_dam > 30 ? "severe" : "minor"] burns.</span>"
/obj/item/bodypart/blob_act()
take_damage(max_damage)
/obj/item/bodypart/Destroy()
if(owner)
@@ -48,10 +59,10 @@
/obj/item/bodypart/attack(mob/living/carbon/C, mob/user)
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(EASYLIMBATTACHMENT in H.dna.species.specflags)
if(!H.get_bodypart(body_zone))
if(EASYLIMBATTACHMENT in H.dna.species.species_traits)
if(!H.get_bodypart(body_zone) && !animal_origin)
if(H == user)
H.visible_message("<span class='warning'>[H] jams [src] into \his empty socket!</span>",\
H.visible_message("<span class='warning'>[H] jams [src] into [H.p_their()] empty socket!</span>",\
"<span class='notice'>You force [src] into your empty socket, and it locks into place!</span>")
else
H.visible_message("<span class='warning'>[user] jams [src] into [H]'s empty socket!</span>",\
@@ -68,8 +79,8 @@
user << "<span class='warning'>There is nothing left inside [src]!</span>"
return
playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1)
user.visible_message("<span class='warning'>[user] begins to cut through the bone in [src].</span>",\
"<span class='notice'>You begin to cut through the bone in [src]...</span>")
user.visible_message("<span class='warning'>[user] begins to cut open [src].</span>",\
"<span class='notice'>You begin to cut open [src]...</span>")
if(do_after(user, 54, target = src))
drop_organs(user)
else
@@ -77,25 +88,30 @@
/obj/item/bodypart/throw_impact(atom/hit_atom)
..()
playsound(get_turf(src), 'sound/misc/splort.ogg', 50, 1, -1)
if(status != BODYPART_ROBOTIC)
playsound(get_turf(src), 'sound/misc/splort.ogg', 50, 1, -1)
pixel_x = rand(-3, 3)
pixel_y = rand(-3, 3)
//empties the bodypart from its organs and other things inside it
/obj/item/bodypart/proc/drop_organs(mob/user)
var/turf/T = get_turf(src)
playsound(T, 'sound/misc/splort.ogg', 50, 1, -1)
if(status != BODYPART_ROBOTIC)
playsound(T, 'sound/misc/splort.ogg', 50, 1, -1)
for(var/obj/item/I in src)
I.loc = T
I.forceMove(T)
//Applies brute and burn damage to the organ. Returns 1 if the damage-icon states changed at all.
//Damage will not exceed max_damage using this proc
//Cannot apply negative damage
/obj/item/bodypart/proc/take_damage(brute, burn)
/obj/item/bodypart/proc/receive_damage(brute, burn, updating_health = 1)
if(owner && (owner.status_flags & GODMODE))
return 0 //godmode
brute = max(brute,0)
burn = max(burn,0)
brute = max(brute * config.damage_multiplier,0)
burn = max(burn * config.damage_multiplier,0)
if(status == ORGAN_ROBOTIC) //This makes robolimbs not damageable by chems and makes it stronger
if(status == BODYPART_ROBOTIC) //This makes robolimbs not damageable by chems and makes it stronger
brute = max(0, brute - 5)
burn = max(0, burn - 4)
@@ -120,7 +136,7 @@
burn_dam += can_inflict
else
return 0
if(owner)
if(owner && updating_health)
owner.updatehealth()
return update_bodypart_damage_state()
@@ -128,17 +144,17 @@
//Heals brute and burn damage for the organ. Returns 1 if the damage-icon states changed at all.
//Damage cannot go below zero.
//Cannot remove negative damage (i.e. apply damage)
/obj/item/bodypart/proc/heal_damage(brute, burn, robotic)
/obj/item/bodypart/proc/heal_damage(brute, burn, only_robotic = 0, only_organic = 1, updating_health = 1)
if(robotic && status != ORGAN_ROBOTIC) //This makes organic limbs not heal when the proc is in Robotic mode.
if(only_robotic && status != BODYPART_ROBOTIC) //This makes organic limbs not heal when the proc is in Robotic mode.
return
if(!robotic && status == ORGAN_ROBOTIC) //This makes robolimbs not healable by chems.
if(only_organic && status != BODYPART_ORGANIC) //This makes robolimbs not healable by chems.
return
brute_dam = max(brute_dam - brute, 0)
burn_dam = max(burn_dam - burn, 0)
if(owner)
if(owner && updating_health)
owner.updatehealth()
return update_bodypart_damage_state()
@@ -151,14 +167,13 @@
//Updates an organ's brute/burn states for use by update_damage_overlays()
//Returns 1 if we need to update overlays. 0 otherwise.
/obj/item/bodypart/proc/update_bodypart_damage_state()
if(status == ORGAN_ORGANIC) //Robotic limbs show no damage - RR
var/tbrute = round( (brute_dam/max_damage)*3, 1 )
var/tburn = round( (burn_dam/max_damage)*3, 1 )
if((tbrute != brutestate) || (tburn != burnstate))
brutestate = tbrute
burnstate = tburn
return 1
return 0
var/tbrute = round( (brute_dam/max_damage)*3, 1 )
var/tburn = round( (burn_dam/max_damage)*3, 1 )
if((tbrute != brutestate) || (tburn != burnstate))
brutestate = tbrute
burnstate = tburn
return 1
return 0
@@ -177,47 +192,66 @@
owner.update_damage_overlays()
//we inform the bodypart of the changes that happened to the owner, or give it the informations from a source mob.
/obj/item/bodypart/proc/update_limb(dropping_limb, mob/living/carbon/human/source)
var/mob/living/carbon/human/H
/obj/item/bodypart/proc/update_limb(dropping_limb, mob/living/carbon/source)
var/mob/living/carbon/C
if(source)
H = source
C = source
if(!original_owner)
original_owner = source
else if(original_owner && owner != original_owner) //Foreign limb
no_update = 1
else
H = owner
if(!istype(H))
return
C = owner
no_update = 0
should_draw_greyscale = FALSE
var/datum/species/S = H.dna.species
species_id = S.limbs_id
if(S.use_skintones)
skin_tone = H.skin_tone
should_draw_greyscale = TRUE
else
skin_tone = ""
body_gender = H.gender
should_draw_gender = S.sexes
if(MUTCOLORS in S.specflags)
if(S.fixed_mut_color)
species_color = S.fixed_mut_color
else
species_color = H.dna.features["mcolor"]
should_draw_greyscale = TRUE
else
species_color = ""
if(H.disabilities & HUSK)
species_id = "husk"
if(C.disabilities & HUSK)
species_id = "husk" //overrides species_id
dmg_overlay_type = "" //no damage overlay shown when husked
should_draw_gender = FALSE
should_draw_greyscale = FALSE
no_update = 1
if(!dropping_limb && H.dna.check_mutation(HULK))
mutation_color = "00aa00"
else
mutation_color = ""
if(no_update)
return
if(!animal_origin)
var/mob/living/carbon/human/H = C
should_draw_greyscale = FALSE
var/datum/species/S = H.dna.species
species_id = S.limbs_id
species_flags_list = H.dna.species.species_traits
if(S.use_skintones)
skin_tone = H.skin_tone
should_draw_greyscale = TRUE
else
skin_tone = ""
body_gender = H.gender
should_draw_gender = S.sexes
if(MUTCOLORS in S.species_traits)
if(S.fixed_mut_color)
species_color = S.fixed_mut_color
else
species_color = H.dna.features["mcolor"]
should_draw_greyscale = TRUE
else
species_color = ""
if(!dropping_limb && H.dna.check_mutation(HULK))
mutation_color = "00aa00"
else
mutation_color = ""
dmg_overlay_type = S.damage_overlay_type
else if(animal_origin == MONKEY_BODYPART) //currently monkeys are the only non human mob to have damage overlays.
dmg_overlay_type = animal_origin
if(status == BODYPART_ROBOTIC)
dmg_overlay_type = "robotic"
if(dropping_limb)
no_update = 1 //when attached, the limb won't be affected by the appearance changes of its mob owner.
@@ -225,28 +259,54 @@
//to update the bodypart's icon when not attached to a mob
/obj/item/bodypart/proc/update_icon_dropped()
cut_overlays()
var/image/I = get_limb_icon(1)
if(I)
var/list/standing = get_limb_icon(1)
if(!standing.len)
icon_state = initial(icon_state)//no overlays found, we default back to initial icon.
return
for(var/image/I in standing)
I.pixel_x = px_x
I.pixel_y = px_y
add_overlay(I)
add_overlay(standing)
//Gives you a proper icon appearance for the dismembered limb
/obj/item/bodypart/proc/get_limb_icon(dropped)
var/image/I
icon_state = "" //to erase the default sprite, we're building the visual aspects of the bodypart through overlays alone.
var/list/standing = list()
var/image_dir
if(dropped)
image_dir = SOUTH
if(dmg_overlay_type)
if(brutestate)
standing += image("icon"='icons/mob/dam_mob.dmi', "icon_state"="[dmg_overlay_type]_[body_zone]_[brutestate]0", "layer"=-DAMAGE_LAYER, "dir"=image_dir)
if(burnstate)
standing += image("icon"='icons/mob/dam_mob.dmi', "icon_state"="[dmg_overlay_type]_[body_zone]_0[burnstate]", "layer"=-DAMAGE_LAYER, "dir"=image_dir)
if(animal_origin)
if(status == BODYPART_ORGANIC)
if(species_id == "husk")
standing += image("icon"='icons/mob/animal_parts.dmi', "icon_state"="[animal_origin]_husk_[body_zone]_s", "layer"=-BODYPARTS_LAYER, "dir"=image_dir)
else
standing += image("icon"='icons/mob/animal_parts.dmi', "icon_state"="[animal_origin]_[body_zone]_s", "layer"=-BODYPARTS_LAYER, "dir"=image_dir)
else
standing += image("icon"='icons/mob/augments.dmi', "icon_state"="[animal_origin]_[body_zone]_s", "layer"=-BODYPARTS_LAYER, "dir"=image_dir)
return standing
var/icon_gender = (body_gender == FEMALE) ? "f" : "m" //gender of the icon, if applicable
if((body_zone != "head" && body_zone != "chest"))
should_draw_gender = FALSE
var/image_dir
if(dropped)
image_dir = SOUTH
if(status == ORGAN_ORGANIC)
var/image/I
if(status == BODYPART_ORGANIC)
if(should_draw_greyscale)
if(should_draw_gender)
I = image("icon"='icons/mob/human_parts_greyscale.dmi', "icon_state"="[species_id]_[body_zone]_[icon_gender]_s", "layer"=-BODYPARTS_LAYER, "dir"=image_dir)
else if(use_digitigrade)
I = image("icon"='icons/mob/human_parts_greyscale.dmi', "icon_state"="digitigrade_[use_digitigrade]_[body_zone]_s", "layer"=-BODYPARTS_LAYER, "dir"=image_dir)
else
I = image("icon"='icons/mob/human_parts_greyscale.dmi', "icon_state"="[species_id]_[body_zone]_s", "layer"=-BODYPARTS_LAYER, "dir"=image_dir)
else
@@ -259,11 +319,13 @@
I = image("icon"='icons/mob/augments.dmi', "icon_state"="[body_zone]_[icon_gender]_s", "layer"=-BODYPARTS_LAYER, "dir"=image_dir)
else
I = image("icon"='icons/mob/augments.dmi', "icon_state"="[body_zone]_s", "layer"=-BODYPARTS_LAYER, "dir"=image_dir)
return I
standing += I
return standing
if(!should_draw_greyscale)
return I
standing += I
return standing
//Greyscale Colouring
var/draw_color
@@ -278,14 +340,20 @@
if(draw_color)
I.color = "#[draw_color]"
//End Greyscale Colouring
standing += I
return I
return standing
/obj/item/bodypart/deconstruct(disassembled = TRUE)
drop_organs()
qdel(src)
/obj/item/bodypart/chest
name = "chest"
desc = "It's impolite to stare at a person's chest."
icon_state = "default_human_chest"
max_damage = 200
body_zone = "chest"
body_part = CHEST
@@ -298,34 +366,111 @@
qdel(cavity_item)
return ..()
/obj/item/bodypart/chest/drop_organs(mob/user)
if(cavity_item)
cavity_item.forceMove(user.loc)
cavity_item = null
..()
/obj/item/bodypart/chest/monkey
icon = 'icons/mob/animal_parts.dmi'
icon_state = "default_monkey_chest"
animal_origin = MONKEY_BODYPART
/obj/item/bodypart/chest/alien
icon = 'icons/mob/animal_parts.dmi'
icon_state = "alien_chest_s"
dismemberable = 0
max_damage = 500
animal_origin = ALIEN_BODYPART
/obj/item/bodypart/chest/devil
dismemberable = 0
max_damage = 5000
animal_origin = DEVIL_BODYPART
/obj/item/bodypart/chest/larva
icon = 'icons/mob/animal_parts.dmi'
icon_state = "larva_chest_s"
dismemberable = 0
max_damage = 50
animal_origin = LARVA_BODYPART
/obj/item/bodypart/l_arm
name = "left arm"
desc = "Did you know that the word 'sinister' stems originally from the \
Latin 'sinestra' (left hand), because the left hand was supposed to \
be possessed by the devil? This arm appears to be possessed by no \
one though."
icon_state = "default_human_l_arm"
attack_verb = list("slapped", "punched")
max_damage = 50
body_zone ="l_arm"
body_part = ARM_LEFT
held_index = 1
px_x = -6
px_y = 0
/obj/item/bodypart/l_arm/monkey
icon = 'icons/mob/animal_parts.dmi'
icon_state = "default_monkey_l_arm"
animal_origin = MONKEY_BODYPART
px_x = -5
px_y = -3
/obj/item/bodypart/l_arm/alien
icon = 'icons/mob/animal_parts.dmi'
icon_state = "alien_l_arm_s"
px_x = 0
px_y = 0
dismemberable = 0
max_damage = 100
animal_origin = ALIEN_BODYPART
/obj/item/bodypart/l_arm/devil
dismemberable = 0
max_damage = 5000
animal_origin = DEVIL_BODYPART
/obj/item/bodypart/r_arm
name = "right arm"
desc = "Over 87% of humans are right handed. That figure is much lower \
among humans missing their right arm."
icon_state = "default_human_r_arm"
attack_verb = list("slapped", "punched")
max_damage = 50
body_zone = "r_arm"
body_part = ARM_RIGHT
held_index = 2
px_x = 6
px_y = 0
/obj/item/bodypart/r_arm/monkey
icon = 'icons/mob/animal_parts.dmi'
icon_state = "default_monkey_r_arm"
animal_origin = MONKEY_BODYPART
px_x = 5
px_y = -3
/obj/item/bodypart/r_arm/alien
icon = 'icons/mob/animal_parts.dmi'
icon_state = "alien_r_arm_s"
px_x = 0
px_y = 0
dismemberable = 0
max_damage = 100
animal_origin = ALIEN_BODYPART
/obj/item/bodypart/r_arm/devil
dismemberable = 0
max_damage = 5000
animal_origin = DEVIL_BODYPART
/obj/item/bodypart/l_leg
name = "left leg"
desc = "Some athletes prefer to tie their left shoelaces first for good \
luck. In this instance, it probably would not have helped."
icon_state = "default_human_l_leg"
attack_verb = list("kicked", "stomped")
max_damage = 50
body_zone = "l_leg"
@@ -333,12 +478,37 @@
px_x = -2
px_y = 12
/obj/item/bodypart/l_leg/digitigrade
name = "left digitigrade leg"
use_digitigrade = FULL_DIGITIGRADE
/obj/item/bodypart/l_leg/monkey
icon = 'icons/mob/animal_parts.dmi'
icon_state = "default_monkey_l_leg"
animal_origin = MONKEY_BODYPART
px_y = 4
/obj/item/bodypart/l_leg/alien
icon = 'icons/mob/animal_parts.dmi'
icon_state = "alien_l_leg_s"
px_x = 0
px_y = 0
dismemberable = 0
max_damage = 100
animal_origin = ALIEN_BODYPART
/obj/item/bodypart/l_leg/devil
dismemberable = 0
max_damage = 5000
animal_origin = DEVIL_BODYPART
/obj/item/bodypart/r_leg
name = "right leg"
desc = "You put your right leg in, your right leg out. In, out, in, out, \
shake it all about. And apparently then it detaches.\n\
The hokey pokey has certainly changed a lot since space colonisation."
// alternative spellings of 'pokey' are availible
icon_state = "default_human_r_leg"
attack_verb = list("kicked", "stomped")
max_damage = 50
body_zone = "r_leg"
@@ -346,6 +516,30 @@
px_x = 2
px_y = 12
/obj/item/bodypart/r_leg/digitigrade
name = "right digitigrade leg"
use_digitigrade = FULL_DIGITIGRADE
/obj/item/bodypart/r_leg/monkey
icon = 'icons/mob/animal_parts.dmi'
icon_state = "default_monkey_r_leg"
animal_origin = MONKEY_BODYPART
px_y = 4
/obj/item/bodypart/r_leg/alien
icon = 'icons/mob/animal_parts.dmi'
icon_state = "alien_r_leg_s"
px_x = 0
px_y = 0
dismemberable = 0
max_damage = 100
animal_origin = ALIEN_BODYPART
/obj/item/bodypart/r_leg/devil
dismemberable = 0
max_damage = 5000
animal_origin = DEVIL_BODYPART
/////////////////////////////////////////////////////////////////////////
+145 -138
View File
@@ -1,26 +1,33 @@
/obj/item/bodypart/proc/can_dismember(obj/item/I)
. = (get_damage() >= (max_damage - I.armour_penetration/2))
if(dismemberable)
. = (get_damage() >= (max_damage - I.armour_penetration/2))
//Dismember a limb
/obj/item/bodypart/proc/dismember(dam_type = BRUTE)
var/mob/living/carbon/human/H = owner
if(!istype(H) || (NODISMEMBER in H.dna.species.specflags)) // species don't allow dismemberment
if(!owner)
return 0
var/mob/living/carbon/C = owner
if(!dismemberable)
return 0
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(NODISMEMBER in H.dna.species.species_traits) // species don't allow dismemberment
return 0
var/obj/item/bodypart/affecting = H.get_bodypart("chest")
affecting.take_damage(Clamp(brute_dam/2, 15, 50), Clamp(burn_dam/2, 0, 50)) //Damage the chest based on limb's existing damage
H.visible_message("<span class='danger'><B>[H]'s [src.name] has been violently dismembered!</B></span>")
H.emote("scream")
var/obj/item/bodypart/affecting = C.get_bodypart("chest")
affecting.receive_damage(Clamp(brute_dam/2, 15, 50), Clamp(burn_dam/2, 0, 50)) //Damage the chest based on limb's existing damage
C.visible_message("<span class='danger'><B>[C]'s [src.name] has been violently dismembered!</B></span>")
C.emote("scream")
drop_limb()
if(dam_type == BURN)
burn()
return 1
add_mob_blood(H)
var/turf/location = H.loc
add_mob_blood(C)
var/turf/location = C.loc
if(istype(location))
H.add_splatter_floor(location)
C.add_splatter_floor(location)
var/direction = pick(cardinal)
var/t_range = rand(2,max(throw_range/2, 2))
var/turf/target_turf = get_turf(src)
@@ -34,88 +41,99 @@
/obj/item/bodypart/chest/dismember()
var/mob/living/carbon/human/H = owner
if(!istype(H) || (NODISMEMBER in H.dna.species.specflags)) //human's species don't allow dismemberment
if(!owner)
return 0
var/mob/living/carbon/C = owner
if(!dismemberable)
return 0
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(NODISMEMBER in H.dna.species.species_traits) // species don't allow dismemberment
return 0
var/organ_spilled = 0
var/turf/T = get_turf(H)
H.add_splatter_floor(T)
playsound(get_turf(owner), 'sound/misc/splort.ogg', 80, 1)
for(var/X in owner.internal_organs)
var/turf/T = get_turf(C)
C.add_splatter_floor(T)
playsound(get_turf(C), 'sound/misc/splort.ogg', 80, 1)
for(var/X in C.internal_organs)
var/obj/item/organ/O = X
if(O.zone != "chest")
var/org_zone = check_zone(O.zone)
if(org_zone != "chest")
continue
O.Remove(owner)
O.loc = T
O.Remove(C)
O.forceMove(T)
organ_spilled = 1
if(cavity_item)
cavity_item.loc = T
cavity_item.forceMove(T)
cavity_item = null
organ_spilled = 1
if(organ_spilled)
owner.visible_message("<span class='danger'><B>[owner]'s internal organs spill out onto the floor!</B></span>")
C.visible_message("<span class='danger'><B>[C]'s internal organs spill out onto the floor!</B></span>")
return 1
//limb removal. The "special" argument is used for swapping a limb with a new one without the effects of losing a limb kicking in.
/obj/item/bodypart/proc/drop_limb(special)
if(!ishuman(owner))
if(!owner)
return
var/turf/T = get_turf(owner)
var/mob/living/carbon/human/H = owner
if(!no_update)
update_limb(1)
H.bodyparts -= src
var/mob/living/carbon/C = owner
update_limb(1)
C.bodyparts -= src
if(held_index)
C.unEquip(owner.get_item_for_held_index(held_index), 1)
C.hand_bodyparts[held_index] = null
owner = null
for(var/X in H.surgeries) //if we had an ongoing surgery on that limb, we stop it.
for(var/X in C.surgeries) //if we had an ongoing surgery on that limb, we stop it.
var/datum/surgery/S = X
if(S.organ == src)
H.surgeries -= S
if(S.operated_bodypart == src)
C.surgeries -= S
qdel(S)
break
for(var/obj/item/I in embedded_objects)
embedded_objects -= I
I.loc = src
if(!H.has_embedded_objects())
H.clear_alert("embeddedobject")
if(!C.has_embedded_objects())
C.clear_alert("embeddedobject")
if(!special)
for(var/X in H.dna.mutations) //some mutations require having specific limbs to be kept.
var/datum/mutation/human/MT = X
if(MT.limb_req && MT.limb_req == body_zone)
MT.force_lose(H)
if(C.dna)
for(var/X in C.dna.mutations) //some mutations require having specific limbs to be kept.
var/datum/mutation/human/MT = X
if(MT.limb_req && MT.limb_req == body_zone)
MT.force_lose(C)
for(var/X in H.internal_organs) //internal organs inside the dismembered limb are dropped.
for(var/X in C.internal_organs) //internal organs inside the dismembered limb are dropped.
var/obj/item/organ/O = X
var/org_zone = check_zone(O.zone)
if(org_zone != body_zone)
continue
O.transfer_to_limb(src, H)
O.transfer_to_limb(src, C)
update_icon_dropped()
src.loc = T
H.update_health_hud() //update the healthdoll
H.update_body()
H.update_hair()
H.update_canmove()
forceMove(T)
C.update_health_hud() //update the healthdoll
C.update_body()
C.update_hair()
C.update_canmove()
//when a limb is dropped, the internal organs are removed from the mob and put into the limb
/obj/item/organ/proc/transfer_to_limb(obj/item/bodypart/LB, mob/living/carbon/human/H)
Remove(H)
/obj/item/organ/proc/transfer_to_limb(obj/item/bodypart/LB, mob/living/carbon/C)
Remove(C)
loc = LB
/obj/item/organ/brain/transfer_to_limb(obj/item/bodypart/head/LB, mob/living/carbon/human/H)
if(H.mind && H.mind.changeling)
/obj/item/organ/brain/transfer_to_limb(obj/item/bodypart/head/LB, mob/living/carbon/human/C)
if(C.mind && C.mind.changeling)
LB.brain = new //changeling doesn't lose its real brain organ, we drop a decoy.
LB.brain.loc = LB
else //if not a changeling, we put the brain organ inside the dropped head
Remove(H) //and put the player in control of the brainmob
Remove(C) //and put the player in control of the brainmob
loc = LB
LB.brain = src
LB.brainmob = brainmob
@@ -129,43 +147,39 @@
return
/obj/item/bodypart/r_arm/drop_limb(special)
var/mob/living/carbon/human/H = owner
var/mob/living/carbon/C = owner
..()
if(istype(H) && !special)
if(H.handcuffed)
H.handcuffed.loc = H.loc
H.handcuffed.dropped(H)
H.handcuffed = null
H.update_handcuffed()
if(H.hud_used)
var/obj/screen/inventory/R = H.hud_used.inv_slots[slot_r_hand]
if(C && !special)
if(C.handcuffed)
C.handcuffed.loc = C.loc
C.handcuffed.dropped(C)
C.handcuffed = null
C.update_handcuffed()
if(C.hud_used)
var/obj/screen/inventory/hand/R = C.hud_used.hand_slots["[held_index]"]
if(R)
R.update_icon()
if(H.r_hand)
H.unEquip(H.r_hand, 1)
if(H.gloves)
H.unEquip(H.gloves, 1)
H.update_inv_gloves() //to remove the bloody hands overlay
if(C.gloves)
C.unEquip(C.gloves, 1)
C.update_inv_gloves() //to remove the bloody hands overlay
/obj/item/bodypart/l_arm/drop_limb(special)
var/mob/living/carbon/human/H = owner
var/mob/living/carbon/C = owner
..()
if(istype(H) && !special)
if(H.handcuffed)
H.handcuffed.loc = H.loc
H.handcuffed.dropped(H)
H.handcuffed = null
H.update_handcuffed()
if(H.hud_used)
var/obj/screen/inventory/L = H.hud_used.inv_slots[slot_l_hand]
if(C && !special)
if(C.handcuffed)
C.handcuffed.loc = C.loc
C.handcuffed.dropped(C)
C.handcuffed = null
C.update_handcuffed()
if(C.hud_used)
var/obj/screen/inventory/hand/L = C.hud_used.hand_slots["[held_index]"]
if(L)
L.update_icon()
if(H.l_hand)
H.unEquip(H.l_hand, 1)
if(H.gloves)
H.unEquip(H.gloves, 1)
H.update_inv_gloves() //to remove the bloody hands overlay
if(C.gloves)
C.unEquip(C.gloves, 1)
C.update_inv_gloves() //to remove the bloody hands overlay
/obj/item/bodypart/r_leg/drop_limb(special)
@@ -176,10 +190,8 @@
owner.legcuffed.dropped(owner)
owner.legcuffed = null
owner.update_inv_legcuffed()
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
if(H.shoes)
H.unEquip(H.shoes, 1)
if(owner.shoes)
owner.unEquip(owner.shoes, 1)
..()
/obj/item/bodypart/l_leg/drop_limb(special) //copypasta
@@ -190,21 +202,17 @@
owner.legcuffed.dropped(owner)
owner.legcuffed = null
owner.update_inv_legcuffed()
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
if(H.shoes)
H.unEquip(H.shoes, 1)
if(owner.shoes)
owner.unEquip(owner.shoes, 1)
..()
/obj/item/bodypart/head/drop_limb(special)
var/mob/living/carbon/human/H = owner
if(istype(H))
if(!special)
//Drop all worn head items
for(var/X in list(H.glasses, H.ears, H.wear_mask, H.head))
var/obj/item/I = X
H.unEquip(I, 1)
name = "[H]'s head"
if(!special)
//Drop all worn head items
for(var/X in list(owner.glasses, owner.ears, owner.wear_mask, owner.head))
var/obj/item/I = X
owner.unEquip(I, 1)
name = "[owner]'s head"
..()
@@ -213,81 +221,78 @@
//Attach a limb to a human and drop any existing limb of that type.
/obj/item/bodypart/proc/replace_limb(mob/living/carbon/human/H, special)
if(!istype(H))
/obj/item/bodypart/proc/replace_limb(mob/living/carbon/C, special)
if(!istype(C))
return
var/obj/item/bodypart/O = locate(src.type) in H.bodyparts
var/obj/item/bodypart/O = locate(src.type) in C.bodyparts
if(O)
O.drop_limb(1)
attach_limb(H, special)
attach_limb(C, special)
/obj/item/bodypart/head/replace_limb(mob/living/carbon/human/H, special)
if(!istype(H))
/obj/item/bodypart/head/replace_limb(mob/living/carbon/C, special)
if(!istype(C))
return
var/obj/item/bodypart/head/O = locate(src.type) in H.bodyparts
var/obj/item/bodypart/head/O = locate(src.type) in C.bodyparts
if(O)
if(!special)
return
else
O.drop_limb(1)
attach_limb(H, special)
attach_limb(C, special)
/obj/item/bodypart/proc/attach_limb(mob/living/carbon/human/H, special)
/obj/item/bodypart/proc/attach_limb(mob/living/carbon/C, special)
loc = null
owner = H
H.bodyparts += src
owner = C
C.bodyparts += src
if(held_index)
if(held_index > C.hand_bodyparts.len)
C.hand_bodyparts.len = held_index
C.hand_bodyparts[held_index] = src
if(C.hud_used)
var/obj/screen/inventory/hand/hand = C.hud_used.hand_slots["[held_index]"]
if(hand)
hand.update_icon()
C.update_inv_gloves()
if(special) //non conventional limb attachment
for(var/X in H.surgeries) //if we had an ongoing surgery to attach a new limb, we stop it.
for(var/X in C.surgeries) //if we had an ongoing surgery to attach a new limb, we stop it.
var/datum/surgery/S = X
var/surgery_zone = check_zone(S.location)
if(surgery_zone == body_zone)
H.surgeries -= S
C.surgeries -= S
qdel(S)
break
update_bodypart_damage_state()
H.updatehealth()
H.update_body()
H.update_hair()
H.update_damage_overlays()
H.update_canmove()
C.updatehealth()
C.update_body()
C.update_hair()
C.update_damage_overlays()
C.update_canmove()
/obj/item/bodypart/r_arm/attach_limb(mob/living/carbon/human/H, special)
..()
if(H.hud_used)
var/obj/screen/inventory/R = H.hud_used.inv_slots[slot_r_hand]
if(R)
R.update_icon()
/obj/item/bodypart/l_arm/attach_limb(mob/living/carbon/human/H, special)
..()
if(H.hud_used)
var/obj/screen/inventory/L = H.hud_used.inv_slots[slot_l_hand]
if(L)
L.update_icon()
/obj/item/bodypart/head/attach_limb(mob/living/carbon/human/H, special)
/obj/item/bodypart/head/attach_limb(mob/living/carbon/C, special)
//Transfer some head appearance vars over
if(brain)
brainmob.container = null //Reset brainmob head var.
brainmob.loc = brain //Throw mob into brain.
brain.brainmob = brainmob //Set the brain to use the brainmob
brainmob = null //Set head brainmob var to null
brain.Insert(H) //Now insert the brain proper
brain.Insert(C) //Now insert the brain proper
brain = null //No more brain in the head
H.hair_color = hair_color
H.hair_style = hair_style
H.facial_hair_color = facial_hair_color
H.facial_hair_style = facial_hair_style
H.eye_color = eye_color
H.lip_style = lip_style
H.lip_color = lip_color
if(ishuman(C))
var/mob/living/carbon/human/H = C
H.hair_color = hair_color
H.hair_style = hair_style
H.facial_hair_color = facial_hair_color
H.facial_hair_style = facial_hair_style
H.eye_color = eye_color
H.lip_style = lip_style
H.lip_color = lip_color
if(real_name)
H.real_name = real_name
C.real_name = real_name
real_name = ""
name = initial(name)
..()
@@ -297,26 +302,28 @@
/mob/living/proc/regenerate_limbs(noheal, excluded_limbs)
return 0
/mob/living/carbon/human/regenerate_limbs(noheal, list/excluded_limbs)
/mob/living/carbon/regenerate_limbs(noheal, list/excluded_limbs)
var/list/limb_list = list("head", "chest", "r_arm", "l_arm", "r_leg", "l_leg")
if(excluded_limbs)
limb_list -= excluded_limbs
for(var/Z in limb_list)
. += regenerate_limb(Z, noheal)
/mob/living/proc/regenerate_limb(limb_zone, noheal)
return
/mob/living/carbon/human/regenerate_limb(limb_zone, noheal)
/mob/living/carbon/regenerate_limb(limb_zone, noheal)
var/obj/item/bodypart/L
if(get_bodypart(limb_zone))
return 0
L = newBodyPart(limb_zone, 0, 0, src)
L = newBodyPart(limb_zone, 0, 0)
if(L)
if(!noheal)
L.brute_dam = 0
L.burn_dam = 0
L.burn_state = 0
L.brutestate = 0
L.burnstate = 0
L.attach_limb(src, 1)
return 1
+103 -65
View File
@@ -1,17 +1,18 @@
/obj/item/bodypart/head
name = "head"
desc = "Didn't make sense not to live for fun, your brain gets smart but your head gets dumb."
icon = 'icons/mob/human_parts.dmi'
icon_state = "default_human_head"
max_damage = 200
body_zone = "head"
body_part = HEAD
layer = ABOVE_MOB_LAYER //so it isn't hidden behind some objects when on the floor
w_class = 4 //Quite a hefty load
w_class = WEIGHT_CLASS_BULKY //Quite a hefty load
slowdown = 1 //Balancing measure
throw_range = 2 //No head bowling
px_x = 0
px_y = -8
var/mob/living/carbon/brain/brainmob = null //The current occupant.
var/mob/living/brain/brainmob = null //The current occupant.
var/obj/item/organ/brain/brain = null //The brain organ
//Limb appearance info:
@@ -31,7 +32,8 @@
/obj/item/bodypart/head/drop_organs(mob/user)
var/turf/T = get_turf(src)
playsound(T, 'sound/misc/splort.ogg', 50, 1, -1)
if(status != BODYPART_ROBOTIC)
playsound(T, 'sound/misc/splort.ogg', 50, 1, -1)
for(var/obj/item/I in src)
if(I == brain)
if(user)
@@ -47,67 +49,77 @@
else
I.loc = T
/obj/item/bodypart/head/update_limb(dropping_limb, mob/living/carbon/human/source)
var/mob/living/carbon/human/H
/obj/item/bodypart/head/update_limb(dropping_limb, mob/living/carbon/source)
var/mob/living/carbon/C
if(source)
H = source
C = source
else
H = owner
if(!istype(H))
return
var/datum/species/S = H.dna.species
//First of all, name.
real_name = H.real_name
C = owner
//Facial hair
if(H.facial_hair_style && (FACEHAIR in S.specflags))
facial_hair_style = H.facial_hair_style
if(S.hair_color)
if(S.hair_color == "mutcolor")
facial_hair_color = H.dna.features["mcolor"]
else
facial_hair_color = S.hair_color
else
facial_hair_color = H.facial_hair_color
hair_alpha = S.hair_alpha
else
facial_hair_style = "Shaved"
facial_hair_color = "000"
hair_alpha = 255
//Hair
if(H.hair_style && (HAIR in S.specflags))
hair_style = H.hair_style
if(S.hair_color)
if(S.hair_color == "mutcolor")
hair_color = H.dna.features["mcolor"]
else
hair_color = S.hair_color
else
hair_color = H.hair_color
hair_alpha = S.hair_alpha
else
real_name = C.real_name
if(C.disabilities & HUSK)
real_name = "Unknown"
hair_style = "Bald"
hair_color = "000"
hair_alpha = initial(hair_alpha)
// lipstick
if(H.lip_style && (LIPS in S.specflags))
lip_style = H.lip_style
lip_color = H.lip_color
else
lip_style = null
lip_color = "white"
// eyes
if(EYECOLOR in S.specflags)
eyes = S.eyes
eye_color = H.eye_color
else
facial_hair_style = "Shaved"
eyes = "eyes"
eye_color = ""
lip_style = null
else if(!animal_origin)
var/mob/living/carbon/human/H = C
var/datum/species/S = H.dna.species
//Facial hair
if(H.facial_hair_style && (FACEHAIR in S.species_traits))
facial_hair_style = H.facial_hair_style
if(S.hair_color)
if(S.hair_color == "mutcolor")
facial_hair_color = H.dna.features["mcolor"]
else
facial_hair_color = S.hair_color
else
facial_hair_color = H.facial_hair_color
hair_alpha = S.hair_alpha
else
facial_hair_style = "Shaved"
facial_hair_color = "000"
hair_alpha = 255
//Hair
if(H.hair_style && (HAIR in S.species_traits))
hair_style = H.hair_style
if(S.hair_color)
if(S.hair_color == "mutcolor")
hair_color = H.dna.features["mcolor"]
else
hair_color = S.hair_color
else
hair_color = H.hair_color
hair_alpha = S.hair_alpha
else
hair_style = "Bald"
hair_color = "000"
hair_alpha = initial(hair_alpha)
// lipstick
if(H.lip_style && (LIPS in S.species_traits))
lip_style = H.lip_style
lip_color = H.lip_color
else
lip_style = null
lip_color = "white"
// eyes
if(EYECOLOR in S.species_traits)
eyes = S.eyes
eye_color = H.eye_color
else
eyes = "eyes"
eye_color = ""
..()
/obj/item/bodypart/head/update_icon_dropped()
var/list/standing = get_limb_icon(1)
if(!standing)
if(!standing.len)
icon_state = initial(icon_state)//no overlays found, we default back to initial icon.
return
for(var/image/I in standing)
I.pixel_x = px_x
@@ -116,13 +128,11 @@
/obj/item/bodypart/head/get_limb_icon(dropped)
cut_overlays()
var/image/I = ..()
var/list/standing = list()
standing += I
var/list/standing = ..()
if(dropped) //certain overlays only appear when the limb is being detached from its owner.
var/datum/sprite_accessory/S
if(status != ORGAN_ROBOTIC) //having a robotic head hides certain features.
if(status != BODYPART_ROBOTIC) //having a robotic head hides certain features.
//facial hair
if(facial_hair_style)
S = facial_hair_styles_list[facial_hair_style]
@@ -134,7 +144,12 @@
//Applies the debrained overlay if there is no brain
if(!brain)
standing += image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s", "layer" = -HAIR_LAYER, "dir"=SOUTH)
if(animal_origin == ALIEN_BODYPART)
standing += image("icon"='icons/mob/animal_parts.dmi', "icon_state" = "debrained_alien_s", "layer" = -HAIR_LAYER, "dir"=SOUTH)
else if(animal_origin == LARVA_BODYPART)
standing += image("icon"='icons/mob/animal_parts.dmi', "icon_state" = "debrained_larva_s", "layer" = -HAIR_LAYER, "dir"=SOUTH)
else if(!(NOBLOOD in species_flags_list))
standing += image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s", "layer" = -HAIR_LAYER, "dir"=SOUTH)
else
if(hair_style)
S = hair_styles_list[hair_style]
@@ -157,9 +172,32 @@
img_eyes_s.color = "#" + eye_color
standing += img_eyes_s
if(standing.len)
return standing
return standing
/obj/item/bodypart/head/burn()
drop_organs()
..()
/obj/item/bodypart/head/monkey
icon = 'icons/mob/animal_parts.dmi'
icon_state = "default_monkey_head"
animal_origin = MONKEY_BODYPART
/obj/item/bodypart/head/alien
icon = 'icons/mob/animal_parts.dmi'
icon_state = "alien_head_s"
px_x = 0
px_y = 0
dismemberable = 0
max_damage = 500
animal_origin = ALIEN_BODYPART
/obj/item/bodypart/head/devil
dismemberable = 0
max_damage = 5000
animal_origin = DEVIL_BODYPART
/obj/item/bodypart/head/larva
icon = 'icons/mob/animal_parts.dmi'
icon_state = "larva_head_s"
px_x = 0
px_y = 0
dismemberable = 0
max_damage = 50
animal_origin = LARVA_BODYPART
+154 -46
View File
@@ -10,55 +10,48 @@
if(L.body_zone == zone)
return L
//Mob has their active hand
/mob/proc/has_active_hand()
return 1
/mob/living/carbon/has_hand_for_held_index(i)
if(i)
var/obj/item/bodypart/L = hand_bodyparts[i]
if(L)
return L
return FALSE
/mob/living/carbon/human/has_active_hand()
var/obj/item/bodypart/L
if(hand)
L = get_bodypart("l_arm")
else
L = get_bodypart("r_arm")
if(!L)
return 0
return 1
/mob/proc/has_left_hand()
return TRUE
/mob/living/carbon/has_left_hand()
for(var/obj/item/bodypart/L in hand_bodyparts)
if(L.held_index % 2)
return TRUE
return FALSE
/mob/living/carbon/alien/larva/has_left_hand()
return 1
/mob/living/carbon/human/has_left_hand()
var/obj/item/bodypart/L
L = get_bodypart("l_arm")
if(!L)
return 0
return 1
/mob/proc/has_right_hand()
return TRUE
/mob/living/carbon/has_right_hand()
for(var/obj/item/bodypart/L in hand_bodyparts)
if(!(L.held_index % 2))
return TRUE
return FALSE
/mob/living/carbon/alien/larva/has_right_hand()
return 1
/mob/living/carbon/human/has_right_hand()
var/obj/item/bodypart/L
L = get_bodypart("r_arm")
if(!L)
return 0
return 1
//Limb numbers
/mob/proc/get_num_arms()
return 2
/mob/proc/get_num_legs()
return 2
/mob/proc/get_leg_ignore()
return 0
/mob/living/carbon/human/get_leg_ignore()
if(FLYING in dna.species.specflags)
return 1
/mob/living/carbon/human/get_num_arms()
/mob/living/carbon/get_num_arms()
. = 0
for(var/X in bodyparts)
var/obj/item/bodypart/affecting = X
@@ -67,7 +60,19 @@
if(affecting.body_part == ARM_LEFT)
.++
/mob/living/carbon/human/get_num_legs()
//sometimes we want to ignore that we don't have the required amount of arms.
/mob/proc/get_arm_ignore()
return 0
/mob/living/carbon/alien/larva/get_arm_ignore()
return 1 //so we can still handcuff larvas.
/mob/proc/get_num_legs()
return 2
/mob/living/carbon/get_num_legs()
. = 0
for(var/X in bodyparts)
var/obj/item/bodypart/affecting = X
@@ -76,19 +81,36 @@
if(affecting.body_part == LEG_LEFT)
.++
//sometimes we want to ignore that we don't have the required amount of legs.
/mob/proc/get_leg_ignore()
return 0
/mob/living/carbon/alien/larva/get_leg_ignore()
return 1
/mob/living/carbon/human/get_leg_ignore()
if(movement_type & FLYING)
return 1
/mob/living/proc/get_missing_limbs()
return list()
/mob/living/carbon/human/get_missing_limbs()
/mob/living/carbon/get_missing_limbs()
var/list/full = list("head", "chest", "r_arm", "l_arm", "r_leg", "l_leg")
for(var/zone in full)
if(get_bodypart(zone))
full -= zone
return full
/mob/living/carbon/alien/larva/get_missing_limbs()
var/list/full = list("head", "chest")
for(var/zone in full)
if(get_bodypart(zone))
full -= zone
return full
//Remove all embedded objects from all limbs on the human mob
/mob/living/carbon/human/proc/remove_all_embedded_objects()
//Remove all embedded objects from all limbs on the carbon mob
/mob/living/carbon/proc/remove_all_embedded_objects()
var/turf/T = get_turf(src)
for(var/X in bodyparts)
@@ -99,7 +121,7 @@
clear_alert("embeddedobject")
/mob/living/carbon/human/proc/has_embedded_objects()
/mob/living/carbon/proc/has_embedded_objects()
. = 0
for(var/X in bodyparts)
var/obj/item/bodypart/L = X
@@ -108,7 +130,7 @@
//Helper for quickly creating a new limb - used by augment code in species.dm spec_attacked_by
/proc/newBodyPart(zone, robotic, fixed_icon, mob/living/carbon/human/source)
/mob/living/carbon/proc/newBodyPart(zone, robotic, fixed_icon)
var/obj/item/bodypart/L
switch(zone)
if("l_arm")
@@ -124,13 +146,64 @@
if("chest")
L = new /obj/item/bodypart/chest()
if(L)
if(source)
L.update_limb(fixed_icon, source)
else if(fixed_icon)
L.no_update = 1//when attached, the limb won't be affected by the appearance changes of its mob owner.
L.update_limb(fixed_icon, src)
if(robotic)
L.change_bodypart_status(ORGAN_ROBOTIC)
L.change_bodypart_status(BODYPART_ROBOTIC)
. = L
/mob/living/carbon/monkey/newBodyPart(zone, robotic, fixed_icon)
var/obj/item/bodypart/L
switch(zone)
if("l_arm")
L = new /obj/item/bodypart/l_arm/monkey()
if("r_arm")
L = new /obj/item/bodypart/r_arm/monkey()
if("head")
L = new /obj/item/bodypart/head/monkey()
if("l_leg")
L = new /obj/item/bodypart/l_leg/monkey()
if("r_leg")
L = new /obj/item/bodypart/r_leg/monkey()
if("chest")
L = new /obj/item/bodypart/chest/monkey()
if(L)
L.update_limb(fixed_icon, src)
if(robotic)
L.change_bodypart_status(BODYPART_ROBOTIC)
. = L
/mob/living/carbon/alien/larva/newBodyPart(zone, robotic, fixed_icon)
var/obj/item/bodypart/L
switch(zone)
if("head")
L = new /obj/item/bodypart/head/larva()
if("chest")
L = new /obj/item/bodypart/chest/larva()
if(L)
L.update_limb(fixed_icon, src)
if(robotic)
L.change_bodypart_status(BODYPART_ROBOTIC)
. = L
/mob/living/carbon/alien/humanoid/newBodyPart(zone, robotic, fixed_icon)
var/obj/item/bodypart/L
switch(zone)
if("l_arm")
L = new /obj/item/bodypart/l_arm/alien()
if("r_arm")
L = new /obj/item/bodypart/r_arm/alien()
if("head")
L = new /obj/item/bodypart/head/alien()
if("l_leg")
L = new /obj/item/bodypart/l_leg/alien()
if("r_leg")
L = new /obj/item/bodypart/r_leg/alien()
if("chest")
L = new /obj/item/bodypart/chest/alien()
if(L)
L.update_limb(fixed_icon, src)
if(robotic)
L.change_bodypart_status(BODYPART_ROBOTIC)
. = L
@@ -162,4 +235,39 @@
if("albino")
. = "fff4e6"
if("orange")
. = "ffc905"
. = "ffc905"
/mob/living/carbon/proc/Digitigrade_Leg_Swap(swap_back)
var/body_plan_changed = FALSE
for(var/X in bodyparts)
var/obj/item/bodypart/O = X
var/obj/item/bodypart/N
if((!O.use_digitigrade && swap_back == FALSE) || (O.use_digitigrade && swap_back == TRUE))
if(O.body_part == LEG_LEFT)
if(swap_back == TRUE)
N = new /obj/item/bodypart/l_leg
else
N = new /obj/item/bodypart/l_leg/digitigrade
else if(O.body_part == LEG_RIGHT)
if(swap_back == TRUE)
N = new /obj/item/bodypart/r_leg
else
N = new /obj/item/bodypart/r_leg/digitigrade
if(!N)
continue
body_plan_changed = TRUE
O.drop_limb(1)
qdel(O)
N.attach_limb(src)
if(body_plan_changed && ishuman(src))
var/mob/living/carbon/human/H = src
if(H.w_uniform)
var/obj/item/clothing/under/U = H.w_uniform
if(U.mutantrace_variation)
if(swap_back)
U.adjusted = NORMAL_STYLE
else
U.adjusted = DIGITIGRADE_STYLE
H.update_inv_w_uniform()
if(H.shoes && !swap_back)
H.unEquip(H.shoes)
@@ -0,0 +1,162 @@
/obj/item/bodypart/l_arm/robot
name = "cyborg left arm"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
attack_verb = list("slapped", "punched")
item_state = "buildpipe"
icon = 'icons/obj/robot_parts.dmi'
flags = CONDUCT
icon_state = "l_arm"
status = BODYPART_ROBOTIC
/obj/item/bodypart/r_arm/robot
name = "cyborg right arm"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
attack_verb = list("slapped", "punched")
item_state = "buildpipe"
icon = 'icons/obj/robot_parts.dmi'
flags = CONDUCT
icon_state = "r_arm"
status = BODYPART_ROBOTIC
/obj/item/bodypart/l_leg/robot
name = "cyborg left leg"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
attack_verb = list("kicked", "stomped")
item_state = "buildpipe"
icon = 'icons/obj/robot_parts.dmi'
flags = CONDUCT
icon_state = "l_leg"
status = BODYPART_ROBOTIC
/obj/item/bodypart/r_leg/robot
name = "cyborg right leg"
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
attack_verb = list("kicked", "stomped")
item_state = "buildpipe"
icon = 'icons/obj/robot_parts.dmi'
flags = CONDUCT
icon_state = "r_leg"
status = BODYPART_ROBOTIC
/obj/item/bodypart/chest/robot
name = "cyborg torso"
desc = "A heavily reinforced case containing cyborg logic boards, with space for a standard power cell."
item_state = "buildpipe"
icon = 'icons/obj/robot_parts.dmi'
flags = CONDUCT
icon_state = "chest"
status = BODYPART_ROBOTIC
var/wired = 0
var/obj/item/weapon/stock_parts/cell/cell = null
/obj/item/bodypart/chest/robot/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weapon/stock_parts/cell))
if(src.cell)
user << "<span class='warning'>You have already inserted a cell!</span>"
return
else
if(!user.unEquip(W))
return
W.loc = src
src.cell = W
user << "<span class='notice'>You insert the cell.</span>"
else if(istype(W, /obj/item/stack/cable_coil))
if(src.wired)
user << "<span class='warning'>You have already inserted wire!</span>"
return
var/obj/item/stack/cable_coil/coil = W
if (coil.use(1))
src.wired = 1
user << "<span class='notice'>You insert the wire.</span>"
else
user << "<span class='warning'>You need one length of coil to wire it!</span>"
else
return ..()
/obj/item/bodypart/chest/robot/Destroy()
if(cell)
qdel(cell)
cell = null
return ..()
/obj/item/bodypart/chest/robot/drop_organs(mob/user)
if(wired)
new /obj/item/stack/cable_coil(user.loc, 1)
if(cell)
cell.forceMove(user.loc)
cell = null
..()
/obj/item/bodypart/head/robot
name = "cyborg head"
desc = "A standard reinforced braincase, with spine-plugged neural socket and sensor gimbals."
item_state = "buildpipe"
icon = 'icons/obj/robot_parts.dmi'
flags = CONDUCT
icon_state = "head"
status = BODYPART_ROBOTIC
var/obj/item/device/assembly/flash/handheld/flash1 = null
var/obj/item/device/assembly/flash/handheld/flash2 = null
/obj/item/bodypart/head/robot/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/device/assembly/flash/handheld))
var/obj/item/device/assembly/flash/handheld/F = W
if(src.flash1 && src.flash2)
user << "<span class='warning'>You have already inserted the eyes!</span>"
return
else if(F.crit_fail)
user << "<span class='warning'>You can't use a broken flash!</span>"
return
else
if(!user.unEquip(W))
return
F.loc = src
if(src.flash1)
src.flash2 = F
else
src.flash1 = F
user << "<span class='notice'>You insert the flash into the eye socket.</span>"
else if(istype(W, /obj/item/weapon/crowbar))
if(flash1 || flash2)
playsound(src.loc, W.usesound, 50, 1)
user << "<span class='notice'>You remove the flash from [src].</span>"
if(flash1)
flash1.forceMove(user.loc)
flash1 = null
if(flash2)
flash2.forceMove(user.loc)
flash2 = null
else
user << "<span class='warning'>There are no flash to remove from [src].</span>"
else
return ..()
/obj/item/bodypart/head/robot/Destroy()
if(flash1)
qdel(flash1)
flash1 = null
if(flash2)
qdel(flash2)
flash2 = null
return ..()
/obj/item/bodypart/head/robot/drop_organs(mob/user)
if(flash1)
flash1.forceMove(user.loc)
flash1 = null
if(flash2)
flash2.forceMove(user.loc)
flash2 = null
..()