diff --git a/_maps/RandomZLevels/moonoutpost19.dmm b/_maps/RandomZLevels/moonoutpost19.dmm
index 16ba61919d5b..e688e19691de 100644
--- a/_maps/RandomZLevels/moonoutpost19.dmm
+++ b/_maps/RandomZLevels/moonoutpost19.dmm
@@ -5810,7 +5810,7 @@
pixel_x = -5;
pixel_y = -2
},
-/obj/item/robot_parts/l_arm,
+/obj/item/bodypart/l_arm/robot,
/turf/open/floor/plasteel/white{
heat_capacity = 1e+006
},
diff --git a/_maps/map_files/BirdStation/BirdStation.dmm b/_maps/map_files/BirdStation/BirdStation.dmm
index 35ae80339e65..8fa869b173d7 100644
--- a/_maps/map_files/BirdStation/BirdStation.dmm
+++ b/_maps/map_files/BirdStation/BirdStation.dmm
@@ -446,8 +446,8 @@
dir = 1
},
/obj/structure/table,
-/obj/item/robot_parts/r_arm,
-/obj/item/robot_parts/l_arm,
+/obj/item/bodypart/r_arm/robot,
+/obj/item/bodypart/l_arm/robot,
/turf/open/floor/mineral/titanium,
/area/shuttle/syndicate)
"abh" = (
diff --git a/_maps/map_files/DreamStation/dreamstation04.dmm b/_maps/map_files/DreamStation/dreamstation04.dmm
index d3573c3e30b5..18420d099e97 100644
--- a/_maps/map_files/DreamStation/dreamstation04.dmm
+++ b/_maps/map_files/DreamStation/dreamstation04.dmm
@@ -1344,8 +1344,8 @@
/area/turret_protected/aisat_interior)
"acv" = (
/obj/structure/table,
-/obj/item/robot_parts/robot_suit,
-/obj/item/robot_parts/head,
+/obj/item/robot_suit,
+/obj/item/bodypart/head/robot,
/obj/machinery/atmospherics/pipe/simple/supply/hidden,
/turf/open/floor/bluegrid,
/area/turret_protected/aisat_interior)
@@ -1418,9 +1418,9 @@
/area/turret_protected/aisat_interior)
"acF" = (
/obj/structure/table,
-/obj/item/robot_parts/l_arm,
-/obj/item/robot_parts/chest,
-/obj/item/robot_parts/l_arm,
+/obj/item/bodypart/l_arm/robot,
+/obj/item/bodypart/chest/robot,
+/obj/item/bodypart/l_arm/robot,
/obj/structure/cable/blue{
tag = "icon-2-8";
icon_state = "2-8"
@@ -1443,7 +1443,7 @@
/area/turret_protected/aisat_interior)
"acI" = (
/obj/structure/table,
-/obj/item/robot_parts/r_arm,
+/obj/item/bodypart/r_arm/robot,
/obj/structure/cable/blue{
tag = "icon-2-4";
icon_state = "2-4"
@@ -1511,7 +1511,7 @@
},
/obj/machinery/atmospherics/pipe/manifold/scrubbers/hidden,
/obj/item/device/assembly/flash/handheld,
-/obj/item/robot_parts/r_leg,
+/obj/item/bodypart/r_leg/robot,
/turf/open/floor/plasteel/black,
/area/turret_protected/aisat_interior)
"acP" = (
@@ -1575,7 +1575,7 @@
/area/turret_protected/aisat_interior)
"acU" = (
/obj/structure/table,
-/obj/item/robot_parts/l_leg,
+/obj/item/bodypart/l_leg/robot,
/obj/structure/cable/blue{
tag = "icon-4-8";
icon_state = "4-8"
@@ -3189,8 +3189,8 @@
dir = 1
},
/obj/structure/table,
-/obj/item/robot_parts/r_arm,
-/obj/item/robot_parts/l_arm,
+/obj/item/bodypart/r_arm/robot,
+/obj/item/bodypart/l_arm/robot,
/turf/open/floor/mineral/titanium,
/area/shuttle/syndicate)
"agA" = (
@@ -16264,7 +16264,7 @@
/area/maintenance/fore)
"aIo" = (
/obj/structure/rack,
-/obj/item/robot_parts/l_arm,
+/obj/item/bodypart/l_arm/robot,
/obj/item/stack/sheet/metal{
amount = 2
},
@@ -17026,7 +17026,7 @@
"aJN" = (
/obj/structure/table,
/obj/item/stack/cable_coil/green,
-/obj/item/robot_parts/l_arm,
+/obj/item/bodypart/l_arm/robot,
/obj/item/weapon/storage/fancy/cigarettes/cigpack_robustgold,
/obj/item/weapon/reagent_containers/food/drinks/mug/coco,
/turf/open/floor/plating,
@@ -18024,7 +18024,7 @@
/area/maintenance/port)
"aMb" = (
/obj/effect/spawner/lootdrop/maintenance,
-/obj/item/robot_parts/l_arm,
+/obj/item/bodypart/l_arm/robot,
/turf/open/floor/plating,
/area/maintenance/port)
"aMc" = (
@@ -63145,7 +63145,7 @@
/turf/open/floor/plating,
/area/maintenance/apmaint)
"cvz" = (
-/obj/item/robot_parts/l_arm,
+/obj/item/bodypart/l_arm/robot,
/obj/structure/closet,
/obj/item/weapon/reagent_containers/glass/beaker/large,
/obj/effect/spawner/lootdrop/maintenance,
diff --git a/_maps/map_files/EfficiencyStation/EfficiencyStation.dmm b/_maps/map_files/EfficiencyStation/EfficiencyStation.dmm
index 45e4e7482849..f7e7e86f1720 100644
--- a/_maps/map_files/EfficiencyStation/EfficiencyStation.dmm
+++ b/_maps/map_files/EfficiencyStation/EfficiencyStation.dmm
@@ -3505,8 +3505,8 @@
dir = 1
},
/obj/structure/table,
-/obj/item/robot_parts/r_arm,
-/obj/item/robot_parts/l_arm,
+/obj/item/bodypart/r_arm/robot,
+/obj/item/bodypart/l_arm/robot,
/turf/open/floor/mineral/titanium,
/area/shuttle/syndicate)
"agJ" = (
diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm
index 1713fbaec401..ad6d1b744c13 100644
--- a/_maps/map_files/MetaStation/MetaStation.dmm
+++ b/_maps/map_files/MetaStation/MetaStation.dmm
@@ -55774,12 +55774,12 @@
d2 = 2;
icon_state = "1-2"
},
-/obj/item/robot_parts/chest{
+/obj/item/bodypart/chest/robot{
name = "cyborg torso";
pixel_x = -2;
pixel_y = 2
},
-/obj/item/robot_parts/head{
+/obj/item/bodypart/head/robot{
name = "cyborg head";
pixel_x = 3;
pixel_y = 2
@@ -90220,8 +90220,8 @@
dir = 1
},
/obj/structure/table,
-/obj/item/robot_parts/r_arm,
-/obj/item/robot_parts/l_arm,
+/obj/item/bodypart/r_arm/robot,
+/obj/item/bodypart/l_arm/robot,
/turf/open/floor/mineral/titanium,
/area/shuttle/syndicate)
"cYu" = (
diff --git a/_maps/map_files/MiniStation/MiniStation.dmm b/_maps/map_files/MiniStation/MiniStation.dmm
index 0db7e381bd77..4ce944db0599 100644
--- a/_maps/map_files/MiniStation/MiniStation.dmm
+++ b/_maps/map_files/MiniStation/MiniStation.dmm
@@ -14145,8 +14145,8 @@
dir = 1
},
/obj/structure/table,
-/obj/item/robot_parts/r_arm,
-/obj/item/robot_parts/l_arm,
+/obj/item/bodypart/r_arm/robot,
+/obj/item/bodypart/l_arm/robot,
/turf/open/floor/mineral/titanium,
/area/shuttle/syndicate)
"Gv" = (
diff --git a/_maps/map_files/TgStation/tgstation.2.1.3.dmm b/_maps/map_files/TgStation/tgstation.2.1.3.dmm
index d6a019fa8e28..cc62442653f0 100644
--- a/_maps/map_files/TgStation/tgstation.2.1.3.dmm
+++ b/_maps/map_files/TgStation/tgstation.2.1.3.dmm
@@ -54091,8 +54091,8 @@
dir = 1
},
/obj/structure/table,
-/obj/item/robot_parts/r_arm,
-/obj/item/robot_parts/l_arm,
+/obj/item/bodypart/r_arm/robot,
+/obj/item/bodypart/l_arm/robot,
/turf/open/floor/mineral/titanium,
/area/shuttle/syndicate)
"coo" = (
diff --git a/code/__DEFINES/genetics.dm b/code/__DEFINES/genetics.dm
index a9c91450c627..de99eca09179 100644
--- a/code/__DEFINES/genetics.dm
+++ b/code/__DEFINES/genetics.dm
@@ -84,6 +84,14 @@
#define ORGAN_ORGANIC 1
#define ORGAN_ROBOTIC 2
+#define BODYPART_ORGANIC 1
+#define BODYPART_ROBOTIC 2
+
+#define MONKEY_BODYPART "monkey"
+#define ALIEN_BODYPART "alien"
+#define LARVA_BODYPART "larva"
+#define DEVIL_BODYPART "devil"
+
//Nutrition levels for humans. No idea where else to put it
#define NUTRITION_LEVEL_FAT 600
#define NUTRITION_LEVEL_FULL 550
diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm
index 1e66100e5512..fa2ad08b30b5 100644
--- a/code/__DEFINES/is_helpers.dm
+++ b/code/__DEFINES/is_helpers.dm
@@ -22,7 +22,7 @@
#define ismonkey(A) (istype(A, /mob/living/carbon/monkey))
-#define isbrain(A) (istype(A, /mob/living/carbon/brain))
+#define isbrain(A) (istype(A, /mob/living/brain))
#define isalien(A) (istype(A, /mob/living/carbon/alien))
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index 39892a67e3a9..a8f3703f2f77 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -337,7 +337,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
moblist.Add(M)
for(var/mob/living/carbon/human/M in sortmob)
moblist.Add(M)
- for(var/mob/living/carbon/brain/M in sortmob)
+ for(var/mob/living/brain/M in sortmob)
moblist.Add(M)
for(var/mob/living/carbon/alien/M in sortmob)
moblist.Add(M)
diff --git a/code/_onclick/hud/generic_dextrous.dm b/code/_onclick/hud/generic_dextrous.dm
index 509af712b902..bb0bac5d4cee 100644
--- a/code/_onclick/hud/generic_dextrous.dm
+++ b/code/_onclick/hud/generic_dextrous.dm
@@ -60,3 +60,12 @@
for(var/obj/item/I in D.held_items)
I.screen_loc = null
D.client.screen -= I
+
+
+//Dextrous simple mobs can use hands!
+/mob/living/simple_animal/create_mob_hud()
+ if(client && !hud_used)
+ if(dextrous)
+ hud_used = new dextrous_hud_type(src, ui_style2icon(client.prefs.UI_style))
+ else
+ ..()
diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm
index a7930dc8c2c6..623b49723ae9 100644
--- a/code/_onclick/hud/hud.dm
+++ b/code/_onclick/hud/hud.dm
@@ -241,5 +241,5 @@
i++
for(var/obj/screen/human/equip/E in static_inventory)
E.screen_loc = ui_equip_position(mymob)
-
- show_hud(HUD_STYLE_STANDARD,mymob)
\ No newline at end of file
+ if(mymob.hud_used)
+ show_hud(HUD_STYLE_STANDARD,mymob)
\ No newline at end of file
diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm
index 53b7ce8a0c9f..93f36820fd87 100644
--- a/code/_onclick/hud/human.dm
+++ b/code/_onclick/hud/human.dm
@@ -358,7 +358,6 @@
var/mob/living/carbon/human/H = mymob
var/mob/screenmob = viewer || H
-
if(screenmob.hud_used.hud_shown)
if(H.s_store)
H.s_store.screen_loc = ui_sstore1
diff --git a/code/_onclick/hud/other_mobs.dm b/code/_onclick/hud/other_mobs.dm
index 2bbc92c7cd45..ac42696bc569 100644
--- a/code/_onclick/hud/other_mobs.dm
+++ b/code/_onclick/hud/other_mobs.dm
@@ -7,7 +7,7 @@
mymob.client.screen = list()
mymob.client.screen += mymob.client.void
-/mob/living/carbon/brain/create_mob_hud()
+/mob/living/brain/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud/brain(src)
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index 838f913536f7..ced66536d873 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -34,6 +34,8 @@
user.lastattacked = M
M.lastattacker = user
+ if(user != M)
+ user.do_attack_animation(M)
M.attacked_by(src, user)
add_logs(user, M, "attacked", src.name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
@@ -58,19 +60,27 @@
user.visible_message("[user] has hit [src] with [I]!", "You hit [src] with [I]!")
/mob/living/attacked_by(obj/item/I, mob/living/user)
- if(user != src)
- user.do_attack_animation(src)
- if(send_item_attack_message(I, user))
- if(apply_damage(I.force, I.damtype))
- if(I.damtype == BRUTE)
- if(prob(33))
- I.add_mob_blood(src)
- var/turf/location = get_turf(src)
- add_splatter_floor(location)
- if(get_dist(user, src) <= 1) //people with TK won't get smeared with blood
- user.add_mob_blood(src)
- return TRUE
+ send_item_attack_message(I, user)
+ if(I.force)
+ apply_damage(I.force, I.damtype)
+ if(I.damtype == BRUTE)
+ if(prob(33))
+ I.add_mob_blood(src)
+ var/turf/location = get_turf(src)
+ add_splatter_floor(location)
+ if(get_dist(user, src) <= 1) //people with TK won't get smeared with blood
+ user.add_mob_blood(src)
+ return TRUE //successful attack
+/mob/living/simple_animal/attacked_by(obj/item/I, mob/living/user)
+ if(!I.force)
+ user.visible_message("[user] gently taps [src] with [I].",\
+ "This weapon is ineffective, it does no damage!")
+ else if(I.force < force_threshold || I.damtype == STAMINA)
+ visible_message("[I] bounces harmlessly off of [src].",\
+ "[I] bounces harmlessly off of [src]!")
+ else
+ return ..()
// Proximity_flag is 1 if this afterattack was called on something adjacent, in your square, or on your person.
// Click parameters is the params string from byond Click() code, see that documentation.
@@ -90,7 +100,7 @@
if(I.attack_verb && I.attack_verb.len)
message_verb = "[pick(I.attack_verb)]"
else if(!I.force)
- return 0
+ return
var/message_hit_area = ""
if(hit_area)
message_hit_area = " in the [hit_area]"
@@ -102,12 +112,3 @@
"[attack_message]")
return 1
-/mob/living/simple_animal/send_item_attack_message(obj/item/I, mob/living/user, hit_area)
- if(!I.force)
- user.visible_message("[user] gently taps [src] with [I].",\
- "This weapon is ineffective, it does no damage!")
- else if(I.force < force_threshold || I.damtype == STAMINA)
- visible_message("[I] bounces harmlessly off of [src].",\
- "[I] bounces harmlessly off of [src]!")
- else
- return ..()
diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm
index 95c2ff9836ac..f6986e8d4f13 100644
--- a/code/_onclick/other_mobs.dm
+++ b/code/_onclick/other_mobs.dm
@@ -50,9 +50,8 @@
for(var/datum/mutation/human/HM in dna.mutations)
HM.on_ranged_attack(src, A)
- var/turf/T = A
- if(istype(T) && get_dist(src,T) <= 1)
- src.Move_Pulled(T)
+ if(isturf(A) && get_dist(src,A) <= 1)
+ src.Move_Pulled(A)
/*
Animals & All Unspecified
@@ -111,7 +110,7 @@
*/
/mob/living/carbon/alien/UnarmedAttack(atom/A)
A.attack_alien(src)
-/atom/proc/attack_alien(mob/user)
+/atom/proc/attack_alien(mob/living/carbon/alien/user)
attack_paw(user)
return
/mob/living/carbon/alien/RestrainedClickOn(atom/A)
@@ -135,6 +134,68 @@
/mob/living/simple_animal/slime/RestrainedClickOn(atom/A)
return
+
+/*
+ Drones
+*/
+/mob/living/simple_animal/drone/UnarmedAttack(atom/A)
+ A.attack_drone(src)
+
+/atom/proc/attack_drone(mob/living/simple_animal/drone/user)
+ attack_hand(user) //defaults to attack_hand. Override it when you don't want drones to do same stuff as humans.
+
+/mob/living/simple_animal/slime/RestrainedClickOn(atom/A)
+ return
+
+
+/*
+ True Devil
+*/
+
+/mob/living/carbon/true_devil/UnarmedAttack(atom/A, proximity)
+ A.attack_hand(src)
+
+/*
+ Brain
+*/
+
+/mob/living/brain/UnarmedAttack(atom/A)//Stops runtimes due to attack_animal being the default
+ return
+
+
+/*
+ pAI
+*/
+
+/mob/living/silicon/pai/UnarmedAttack(atom/A)//Stops runtimes due to attack_animal being the default
+ return
+
+
+/*
+ Simple animals
+*/
+
+/mob/living/simple_animal/UnarmedAttack(atom/A, proximity)
+ if(!dextrous)
+ return ..()
+ if(!ismob(A))
+ A.attack_hand(src)
+ update_inv_hands()
+
+
+/*
+ Hostile animals
+*/
+
+/mob/living/simple_animal/hostile/UnarmedAttack(atom/A)
+ target = A
+ if(dextrous && !is_type_in_typecache(A, environment_target_typecache) && !ismob(A))
+ ..()
+ else
+ AttackingTarget()
+
+
+
/*
New Players:
Have no reason to click on anything at all.
diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm
index ed93eb9369a7..5b251a3edfa2 100644
--- a/code/datums/datumvars.dm
+++ b/code/datums/datumvars.dm
@@ -279,11 +279,11 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
if(iscarbon(D))
body += ""
body += ""
+ body += ""
body += ""
if(ishuman(D))
body += ""
body += ""
- body += ""
body += ""
body += ""
body += ""
@@ -898,25 +898,51 @@ body
var/newtype = species_list[result]
H.set_species(newtype)
- else if(href_list["removebodypart"])
+ else if(href_list["editbodypart"])
if(!check_rights(R_SPAWN))
return
- var/mob/living/carbon/human/H = locate(href_list["removebodypart"])
- if(!istype(H))
- usr << "This can only be done to instances of type /mob/living/carbon/human"
+ var/mob/living/carbon/C = locate(href_list["editbodypart"])
+ if(!istype(C))
+ usr << "This can only be done to instances of type /mob/living/carbon"
return
- var/result = input(usr, "Please choose which body part to remove","Remove Body Part") as null|anything in list("head", "l_arm", "r_arm", "l_leg", "r_leg")
+ var/edit_action = input(usr, "What would you like to do?","Modify Body Part") as null|anything in list("add","remove", "augment")
+ if(!edit_action)
+ return
+ var/list/limb_list = list("head", "l_arm", "r_arm", "l_leg", "r_leg")
+ if(edit_action == "augment")
+ limb_list += "chest"
+ var/result = input(usr, "Please choose which body part to [edit_action]","[capitalize(edit_action)] Body Part") as null|anything in limb_list
- if(!H)
+ if(!C)
usr << "Mob doesn't exist anymore"
return
if(result)
- var/obj/item/bodypart/BP = H.get_bodypart(result)
- if(BP)
- BP.drop_limb()
+ var/obj/item/bodypart/BP = C.get_bodypart(result)
+ switch(edit_action)
+ if("remove")
+ if(BP)
+ BP.drop_limb()
+ else
+ usr << "[C] doesn't have such bodypart."
+ if("add")
+ if(BP)
+ usr << "[C] already has such bodypart."
+ else
+ if(!C.regenerate_limb(result))
+ usr << "[C] cannot have such bodypart."
+ if("augment")
+ if(ishuman(C))
+ if(BP)
+ BP.change_bodypart_status(BODYPART_ROBOTIC, 1)
+ else
+ usr << "[C] doesn't have such bodypart."
+ else
+ usr << "Only humans can be augmented."
+
+
else if(href_list["purrbation"])
if(!check_rights(R_SPAWN))
@@ -985,3 +1011,4 @@ body
log_admin("[key_name(usr)] dealt [amount] amount of [Text] damage to [L] ")
message_admins("[key_name(usr)] dealt [amount] amount of [Text] damage to [L] ")
href_list["datumrefresh"] = href_list["mobToDamage"]
+
diff --git a/code/datums/diseases/advance/symptoms/damage_converter.dm b/code/datums/diseases/advance/symptoms/damage_converter.dm
index ba315278a200..f9109df17c17 100644
--- a/code/datums/diseases/advance/symptoms/damage_converter.dm
+++ b/code/datums/diseases/advance/symptoms/damage_converter.dm
@@ -33,30 +33,19 @@ Bonus
Convert(M)
return
-/datum/symptom/damage_converter/proc/Convert(mob/living/M)
+/datum/symptom/damage_converter/proc/Convert(mob/living/carbon/C)
- var/get_damage = rand(1, 2)
+ var/heal_amt = rand(1, 2)
- if(istype(M, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = M
+ var/list/parts = C.get_damaged_bodyparts(1,1) //1,1 because it needs inputs.
- var/list/parts = H.get_damaged_bodyparts(1,1) //1,1 because it needs inputs.
-
- if(!parts.len)
- return
-
- for(var/obj/item/bodypart/L in parts)
- L.heal_damage(get_damage, get_damage, 0)
- M.adjustToxLoss(get_damage*parts.len)
-
- else
- if(M.getFireLoss() > 0 || M.getBruteLoss() > 0)
- M.adjustFireLoss(-get_damage)
- M.adjustBruteLoss(-get_damage)
- M.adjustToxLoss(get_damage)
- else
- return
+ if(!parts.len)
+ return
+ for(var/obj/item/bodypart/L in parts)
+ if(L.heal_damage(heal_amt, heal_amt))
+ C.update_damage_overlays()
+ C.adjustToxLoss(heal_amt*parts.len)
return 1
/*
diff --git a/code/datums/diseases/advance/symptoms/genetics.dm b/code/datums/diseases/advance/symptoms/genetics.dm
index 3a5dc527f092..e3ffbc868ba5 100644
--- a/code/datums/diseases/advance/symptoms/genetics.dm
+++ b/code/datums/diseases/advance/symptoms/genetics.dm
@@ -30,14 +30,14 @@ Bonus
/datum/symptom/genetic_mutation/Activate(datum/disease/advance/A)
..()
if(prob(SYMPTOM_ACTIVATION_PROB * 5)) // 15% chance
- var/mob/living/carbon/M = A.affected_mob
- if(!M.has_dna())
+ var/mob/living/carbon/C = A.affected_mob
+ if(!C.has_dna())
return
switch(A.stage)
if(4, 5)
- M << "[pick("Your skin feels itchy.", "You feel light headed.")]"
- M.dna.remove_mutation_group(possible_mutations)
- randmut(M, possible_mutations)
+ C << "[pick("Your skin feels itchy.", "You feel light headed.")]"
+ C.dna.remove_mutation_group(possible_mutations)
+ C.randmut(possible_mutations)
return
// Archive their DNA before they were infected.
diff --git a/code/datums/diseases/dna_spread.dm b/code/datums/diseases/dna_spread.dm
index 11a8eebbe5dc..626fb567c3dd 100644
--- a/code/datums/diseases/dna_spread.dm
+++ b/code/datums/diseases/dna_spread.dm
@@ -38,7 +38,7 @@
if(prob(1))
affected_mob << "Your muscles ache."
if(prob(20))
- affected_mob.take_organ_damage(1)
+ affected_mob.take_bodypart_damage(1)
if(prob(1))
affected_mob << "Your stomach hurts."
if(prob(20))
diff --git a/code/datums/diseases/flu.dm b/code/datums/diseases/flu.dm
index 1df55bbb9d7f..20bea2da9220 100644
--- a/code/datums/diseases/flu.dm
+++ b/code/datums/diseases/flu.dm
@@ -26,7 +26,7 @@
if(prob(1))
affected_mob << "Your muscles ache."
if(prob(20))
- affected_mob.take_organ_damage(1)
+ affected_mob.take_bodypart_damage(1)
if(prob(1))
affected_mob << "Your stomach hurts."
if(prob(20))
@@ -45,7 +45,7 @@
if(prob(1))
affected_mob << "Your muscles ache."
if(prob(20))
- affected_mob.take_organ_damage(1)
+ affected_mob.take_bodypart_damage(1)
if(prob(1))
affected_mob << "Your stomach hurts."
if(prob(20))
diff --git a/code/datums/diseases/fluspanish.dm b/code/datums/diseases/fluspanish.dm
index c041f2610de6..57ded9abc309 100644
--- a/code/datums/diseases/fluspanish.dm
+++ b/code/datums/diseases/fluspanish.dm
@@ -22,7 +22,7 @@
affected_mob.emote("cough")
if(prob(1))
affected_mob << "You're burning in your own skin!"
- affected_mob.take_organ_damage(0,5)
+ affected_mob.take_bodypart_damage(0,5)
if(3)
affected_mob.bodytemperature += 20
@@ -32,5 +32,5 @@
affected_mob.emote("cough")
if(prob(5))
affected_mob << "You're burning in your own skin!"
- affected_mob.take_organ_damage(0,5)
+ affected_mob.take_bodypart_damage(0,5)
return
diff --git a/code/datums/dna.dm b/code/datums/dna.dm
index ee19e8483a6e..e3d88e8b15e4 100644
--- a/code/datums/dna.dm
+++ b/code/datums/dna.dm
@@ -11,13 +11,15 @@
var/list/mutations = list() //All mutations are from now on here
var/list/temporary_mutations = list() //Timers for temporary mutations
var/list/previous = list() //For temporary name/ui/ue/blood_type modifications
- var/mob/living/carbon/holder
+ var/mob/living/holder
-/datum/dna/New(mob/living/carbon/new_holder)
+/datum/dna/New(mob/living/new_holder)
if(new_holder)
holder = new_holder
/datum/dna/proc/transfer_identity(mob/living/carbon/destination, transfer_SE = 0)
+ if(!istype(destination))
+ return
destination.dna.unique_enzymes = unique_enzymes
destination.dna.uni_identity = uni_identity
destination.dna.blood_type = blood_type
@@ -166,12 +168,36 @@
features = random_features()
+/datum/dna/stored //subtype used by brain mob's stored_dna
+
+/datum/dna/stored/add_mutation(mutation_name) //no mutation changes on stored dna.
+ return
+
+/datum/dna/stored/remove_mutation(mutation_name)
+ return
+
+/datum/dna/stored/check_mutation(mutation_name)
+ return
+
+/datum/dna/stored/remove_all_mutations()
+ return
+
+/datum/dna/stored/remove_mutation_group(list/group)
+ return
/////////////////////////// DNA MOB-PROCS //////////////////////
/mob/proc/set_species(datum/species/mrace, icon_update = 1)
return
+/mob/living/brain/set_species(datum/species/mrace, icon_update = 1)
+ if(mrace)
+ if(ispath(mrace))
+ stored_dna.species = new mrace()
+ else
+ stored_dna.species = mrace //not calling any species update procs since we're a brain, not a monkey/human
+
+
/mob/living/carbon/set_species(datum/species/mrace, icon_update = 1)
if(mrace && has_dna())
dna.species.on_species_loss(src)
@@ -290,48 +316,46 @@ mob/living/carbon/human/updateappearance(icon_update=1, mutcolor_update=0, mutat
return 0
return getleftblocks(istring, blocknumber, blocksize) + replacement + getrightblocks(istring, blocknumber, blocksize)
-/proc/randmut(mob/living/carbon/M, list/candidates, difficulty = 2)
- if(!M.has_dna())
+/mob/living/carbon/proc/randmut(list/candidates, difficulty = 2)
+ if(!has_dna())
return
var/datum/mutation/human/num = pick(candidates)
- . = num.force_give(M)
- return
+ . = num.force_give(src)
-/proc/randmutb(mob/living/carbon/M)
- if(!M.has_dna())
+/mob/living/carbon/proc/randmutb()
+ if(!has_dna())
return
var/datum/mutation/human/HM = pick((bad_mutations | not_good_mutations) - mutations_list[RACEMUT])
- . = HM.force_give(M)
+ . = HM.force_give(src)
-/proc/randmutg(mob/living/carbon/M)
- if(!M.has_dna())
+/mob/living/carbon/proc/randmutg()
+ if(!has_dna())
return
var/datum/mutation/human/HM = pick(good_mutations)
- . = HM.force_give(M)
+ . = HM.force_give(src)
-/proc/randmutvg(mob/living/carbon/M)
- if(!M.has_dna())
+/mob/living/carbon/proc/randmutvg()
+ if(!has_dna())
return
var/datum/mutation/human/HM = pick((good_mutations) - mutations_list[HULK] - mutations_list[DWARFISM])
- . = HM.force_give(M)
+ . = HM.force_give(src)
-/proc/randmuti(mob/living/carbon/M)
- if(!M.has_dna())
+/mob/living/carbon/proc/randmuti()
+ if(!has_dna())
return
var/num = rand(1, DNA_UNI_IDENTITY_BLOCKS)
- var/newdna = setblock(M.dna.uni_identity, num, random_string(DNA_BLOCK_SIZE, hex_characters))
- M.dna.uni_identity = newdna
- M.updateappearance(mutations_overlay_update=1)
- return
+ var/newdna = setblock(dna.uni_identity, num, random_string(DNA_BLOCK_SIZE, hex_characters))
+ dna.uni_identity = newdna
+ updateappearance(mutations_overlay_update=1)
-/proc/clean_dna(mob/living/carbon/M)
- if(!M.has_dna())
+/mob/living/carbon/proc/clean_dna()
+ if(!has_dna())
return
- M.dna.remove_all_mutations()
+ dna.remove_all_mutations()
-/proc/clean_randmut(mob/living/carbon/M, list/candidates, difficulty = 2)
- clean_dna(M)
- randmut(M, candidates, difficulty)
+/mob/living/carbon/proc/clean_randmut(list/candidates, difficulty = 2)
+ clean_dna()
+ randmut(candidates, difficulty)
/proc/scramble_dna(mob/living/carbon/M, ui=FALSE, se=FALSE, probability)
if(!M.has_dna())
diff --git a/code/datums/martial.dm b/code/datums/martial.dm
index 0a93341a63d2..9b9cfb3c3d68 100644
--- a/code/datums/martial.dm
+++ b/code/datums/martial.dm
@@ -482,7 +482,7 @@
var/mob/living/carbon/human/H = user
H.apply_damage(2*force, BRUTE, "head")
else
- user.take_organ_damage(2*force)
+ user.take_bodypart_damage(2*force)
return
if(isrobot(target))
return ..()
diff --git a/code/datums/mutations.dm b/code/datums/mutations.dm
index af57e091efa9..6ac88edf0507 100644
--- a/code/datums/mutations.dm
+++ b/code/datums/mutations.dm
@@ -187,7 +187,7 @@
/datum/mutation/human/cold_resistance/on_life(mob/living/carbon/human/owner)
if(owner.getFireLoss())
if(prob(1))
- owner.heal_organ_damage(0,1) //Is this really needed?
+ owner.heal_bodypart_damage(0,1) //Is this really needed?
/datum/mutation/human/x_ray
@@ -252,11 +252,11 @@
var/mob/new_mob
if(prob(95))
if(prob(50))
- new_mob = randmutb(owner)
+ new_mob = owner.randmutb()
else
- new_mob = randmuti(owner)
+ new_mob = owner.randmuti()
else
- new_mob = randmutg(owner)
+ new_mob = owner.randmutg()
if(new_mob && ismob(new_mob))
owner = new_mob
. = owner
diff --git a/code/datums/weather/weather_types.dm b/code/datums/weather/weather_types.dm
index 9f75bf714e67..6213eacc75c0 100644
--- a/code/datums/weather/weather_types.dm
+++ b/code/datums/weather/weather_types.dm
@@ -150,15 +150,14 @@
if(H.dna && H.dna.species)
if(!(RADIMMUNE in H.dna.species.specflags))
if(prob(max(0,100-resist)))
- randmuti(H)
+ H.randmuti()
if(prob(50))
if(prob(90))
- randmutb(H)
+ H.randmutb()
else
- randmutg(H)
+ H.randmutg()
H.domutcheck()
L.rad_act(20,1)
-
/datum/weather/rad_storm/end()
if(..())
return
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index ef0611a9cd77..8162b451dc82 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -146,7 +146,7 @@
reset_perspective(destination)
update_canmove() //if the mob was asleep inside a container and then got forceMoved out we need to make them fall.
-/mob/living/carbon/brain/forceMove(atom/destination)
+/mob/living/brain/forceMove(atom/destination)
if(container)
container.forceMove(destination)
else //something went very wrong.
diff --git a/code/game/gamemodes/changeling/powers/regenerate.dm b/code/game/gamemodes/changeling/powers/regenerate.dm
index f14c1c957807..6d38a58cc471 100644
--- a/code/game/gamemodes/changeling/powers/regenerate.dm
+++ b/code/game/gamemodes/changeling/powers/regenerate.dm
@@ -13,21 +13,20 @@
/obj/effect/proc_holder/changeling/regenerate/sting_action(mob/living/user)
user << "You feel an itching, both inside and \
outside as your tissues knit and reknit."
- if(ishuman(user))
- var/mob/living/carbon/human/H = user
- H.restore_blood()
- H.remove_all_embedded_objects()
- var/list/missing = H.get_missing_limbs()
+ if(iscarbon(user))
+ var/mob/living/carbon/C = user
+ var/list/missing = C.get_missing_limbs()
if(missing.len)
playsound(user, 'sound/magic/Demon_consume.ogg', 50, 1)
- H.visible_message("[user]'s missing limbs \
+ C.visible_message("[user]'s missing limbs \
reform, making a loud, grotesque sound!",
"Your limbs regrow, making a \
loud, crunchy sound and giving you great pain!",
"You hear organic matter ripping \
and tearing!")
- H.emote("scream")
- H.regenerate_limbs(1)
-
- CHECK_DNA_AND_SPECIES(H)
- H.dna.species.on_species_gain(H, H.dna.species)
+ C.emote("scream")
+ C.regenerate_limbs(1)
+ if(ishuman(user))
+ var/mob/living/carbon/human/H = user
+ H.restore_blood()
+ H.remove_all_embedded_objects()
diff --git a/code/game/gamemodes/changeling/powers/strained_muscles.dm b/code/game/gamemodes/changeling/powers/strained_muscles.dm
index 1c7ce8d11a51..79c707bff04d 100644
--- a/code/game/gamemodes/changeling/powers/strained_muscles.dm
+++ b/code/game/gamemodes/changeling/powers/strained_muscles.dm
@@ -33,7 +33,7 @@
break
stacks++
- //user.take_organ_damage(stacks * 0.03, 0)
+ //user.take_bodypart_damage(stacks * 0.03, 0)
user.staminaloss += stacks * 1.3 //At first the changeling may regenerate stamina fast enough to nullify fatigue, but it will stack
if(stacks == 11) //Warning message that the stacks are getting too high
diff --git a/code/game/gamemodes/changeling/powers/tiny_prick.dm b/code/game/gamemodes/changeling/powers/tiny_prick.dm
index ea792abe4b3b..9f3df575613e 100644
--- a/code/game/gamemodes/changeling/powers/tiny_prick.dm
+++ b/code/game/gamemodes/changeling/powers/tiny_prick.dm
@@ -97,7 +97,7 @@
var/mob/living/carbon/C = target
if(C.status_flags & CANWEAKEN)
C.do_jitter_animation(500)
- C.take_organ_damage(20, 0) //The process is extremely painful
+ C.take_bodypart_damage(20, 0) //The process is extremely painful
target.visible_message("[target] begins to violenty convulse!","You feel a tiny prick and a begin to uncontrollably convulse!")
spawn(10)
diff --git a/code/game/gamemodes/clock_cult/clock_scripture.dm b/code/game/gamemodes/clock_cult/clock_scripture.dm
index 28f3574c91c1..a05c1fe0b7c8 100644
--- a/code/game/gamemodes/clock_cult/clock_scripture.dm
+++ b/code/game/gamemodes/clock_cult/clock_scripture.dm
@@ -546,10 +546,12 @@ Judgement: 10 servants, 100 CV, and any existing AIs are converted or destroyed
var/mob/living/carbon/human/H = invoker
for(var/X in H.bodyparts)
var/obj/item/bodypart/BP = X
- if(ratvar_awakens || BP.status == ORGAN_ROBOTIC && total_power_drained < augument_damage_threshhold) //if ratvar is alive, it won't damage and will always heal augumented limbs
- BP.heal_damage(power_damage, power_damage, 1) //heals one point of burn and brute for every ~100W drained on augumented limbs
+ if(ratvar_awakens || BP.status == BODYPART_ROBOTIC && total_power_drained < augument_damage_threshhold) //if ratvar is alive, it won't damage and will always heal augumented limbs
+ if(BP.heal_damage(power_damage, power_damage, 1, 0)) //heals one point of burn and brute for every ~100W drained on augumented limbs
+ H.update_damage_overlays()
else
- BP.take_damage(0, power_damage)
+ if(BP.take_damage(0, power_damage))
+ H.update_damage_overlays()
else if(isanimal(invoker))
var/mob/living/simple_animal/A = invoker
A.adjustHealth(-power_damage) //if a simple animal is using volt void, just heal it
diff --git a/code/game/gamemodes/clock_cult/clock_structures.dm b/code/game/gamemodes/clock_cult/clock_structures.dm
index 83477d09822c..ca63657de887 100644
--- a/code/game/gamemodes/clock_cult/clock_structures.dm
+++ b/code/game/gamemodes/clock_cult/clock_structures.dm
@@ -711,10 +711,10 @@
color = "#FAE48C"
/obj/effect/clockwork/sigil/transgression/sigil_effects(mob/living/L)
- var/target_flashed = L.flash_eyes()
+ var/target_flashed = L.flash_act()
for(var/mob/living/M in viewers(5, src))
if(!is_servant_of_ratvar(M) && M != L)
- M.flash_eyes()
+ M.flash_act()
if(iscultist(L))
L << "\"Watch your step, wretch.\""
L.adjustBruteLoss(10)
diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm
index 2676bc21aea3..b80a7e692eaa 100644
--- a/code/game/gamemodes/cult/cult.dm
+++ b/code/game/gamemodes/cult/cult.dm
@@ -150,7 +150,6 @@
return 0
else
mob << "You have a [item_name] in your [where]."
- mob.update_icons()
if(where == "backpack")
var/obj/item/weapon/storage/B = mob.back
B.orient2hud(mob)
diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm
index fb375070f9d5..92922f8e5ba6 100644
--- a/code/game/gamemodes/cult/ritual.dm
+++ b/code/game/gamemodes/cult/ritual.dm
@@ -34,7 +34,7 @@ This file contains the arcane tome files.
M.reagents.add_reagent("unholywater",holy2unholy)
add_logs(user, M, "smacked", src, " removing the holy water from them")
return
- M.take_organ_damage(0, 15) //Used to be a random between 5 and 20
+ M.take_bodypart_damage(0, 15) //Used to be a random between 5 and 20
playsound(M, 'sound/weapons/sear.ogg', 50, 1)
M.visible_message("[user] strikes [M] with the arcane tome!", \
"[user] strikes you with the tome, searing your flesh!")
diff --git a/code/game/gamemodes/cult/talisman.dm b/code/game/gamemodes/cult/talisman.dm
index 08e09f57fcba..93a2cb6e18a4 100644
--- a/code/game/gamemodes/cult/talisman.dm
+++ b/code/game/gamemodes/cult/talisman.dm
@@ -253,7 +253,7 @@
else
target.Weaken(10)
target.Stun(10)
- target.flash_eyes(1,1)
+ target.flash_act(1,1)
if(issilicon(target))
var/mob/living/silicon/S = target
S.emp_act(1)
@@ -316,7 +316,7 @@
target << "You see a brief but horrible vision of Ratvar, rusted and scrapped, being torn apart."
target.emote("scream")
target.confused = max(0, target.confused + 3)
- target.flash_eyes()
+ target.flash_act()
qdel(src)
diff --git a/code/game/gamemodes/devil/true_devil/_true_devil.dm b/code/game/gamemodes/devil/true_devil/_true_devil.dm
index 8e91c964dab7..22bb549558d2 100644
--- a/code/game/gamemodes/devil/true_devil/_true_devil.dm
+++ b/code/game/gamemodes/devil/true_devil/_true_devil.dm
@@ -22,13 +22,20 @@
mob_size = MOB_SIZE_LARGE
var/mob/living/oldform
var/list/devil_overlays[DEVIL_TOTAL_LAYERS]
+ bodyparts = list(/obj/item/bodypart/chest/devil, /obj/item/bodypart/head/devil, /obj/item/bodypart/l_arm/devil,
+ /obj/item/bodypart/r_arm/devil, /obj/item/bodypart/r_leg/devil, /obj/item/bodypart/l_leg/devil)
+
+
/mob/living/carbon/true_devil/New()
- internal_organs += new /obj/item/organ/brain/
+ create_bodyparts() //initialize bodyparts
+
+ create_internal_organs()
+ ..()
+
+/mob/living/carbon/true_devil/create_internal_organs()
+ internal_organs += new /obj/item/organ/brain
internal_organs += new /obj/item/organ/tongue
- for(var/X in internal_organs)
- var/obj/item/organ/I = X
- I.Insert(src)
..()
@@ -95,11 +102,17 @@
/mob/living/carbon/true_devil/assess_threat()
return 666
-/mob/living/carbon/true_devil/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
+/mob/living/carbon/true_devil/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
if(mind && has_bane(BANE_LIGHT))
mind.disrupt_spells(-500)
return ..() //flashes don't stop devils UNLESS it's their bane.
+/mob/living/carbon/true_devil/soundbang_act()
+ return 0
+
+/mob/living/carbon/true_devil/get_ear_protection()
+ return 2
+
/mob/living/carbon/true_devil/attacked_by(obj/item/I, mob/living/user, def_zone)
var/weakness = check_weakness(I, user)
@@ -120,9 +133,6 @@
"[attack_message]")
return TRUE
-/mob/living/carbon/true_devil/UnarmedAttack(atom/A, proximity)
- A.attack_hand(src)
-
/mob/living/carbon/true_devil/Process_Spacemove(movement_dir = 0)
return 1
@@ -200,4 +210,14 @@
if(has_bane(BANE_LIGHT))
b_loss *=2
adjustBruteLoss(b_loss)
- return ..()
\ No newline at end of file
+ return ..()
+
+
+/mob/living/carbon/true_devil/update_body() //we don't use the bodyparts layer for devils.
+ return
+
+/mob/living/carbon/true_devil/update_body_parts()
+ return
+
+/mob/living/carbon/true_devil/update_damage_overlays() //devils don't have damage overlays.
+ return
\ No newline at end of file
diff --git a/code/game/gamemodes/gang/gang.dm b/code/game/gamemodes/gang/gang.dm
index 241c16bf56e7..eefbf5689f12 100644
--- a/code/game/gamemodes/gang/gang.dm
+++ b/code/game/gamemodes/gang/gang.dm
@@ -149,7 +149,6 @@ var/list/gang_colors_pool = list("red","orange","yellow","green","blue","purple"
. += 1
else
mob << "The chameleon security HUD in your [where4] will help you keep track of who is mindshield-implanted, and unable to be recruited."
- mob.update_icons()
return .
@@ -167,7 +166,7 @@ var/list/gang_colors_pool = list("red","orange","yellow","green","blue","purple"
if(iscarbon(gangster_mind.current))
var/mob/living/carbon/carbon_mob = gangster_mind.current
carbon_mob.silent = max(carbon_mob.silent, 5)
- carbon_mob.flash_eyes(1, 1)
+ carbon_mob.flash_act(1, 1)
gangster_mind.current.Stun(5)
gangster_mind.current << "You are now a member of the [G.name] Gang!"
gangster_mind.current << "Help your bosses take over the station by claiming territory with special spraycans only they can provide. Simply spray on any unclaimed area of the station."
diff --git a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm
index c2a7423ef018..116d910e056c 100644
--- a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm
+++ b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm
@@ -459,11 +459,11 @@ Congratulations! You are now trained for xenobiology research!"}
return
var/mob/living/carbon/C = L
if(!C.handcuffed)
- if(C.get_num_arms() >= 2)
+ if(C.get_num_arms() >= 2 || C.get_arm_ignore())
playsound(loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2)
C.visible_message("[user] begins restraining [C] with [src]!", \
"[user] begins shaping an energy field around your hands!")
- if(do_mob(user, C, 30) && C.get_num_arms() >= 2)
+ if(do_mob(user, C, 30) && (C.get_num_arms() >= 2 || C.get_arm_ignore()))
if(!C.handcuffed)
C.handcuffed = new /obj/item/weapon/restraints/handcuffs/energy/used(C)
C.update_handcuffed()
diff --git a/code/game/gamemodes/miniantags/abduction/abduction_surgery.dm b/code/game/gamemodes/miniantags/abduction/abduction_surgery.dm
index 30f7d7c10e79..d095f67df43c 100644
--- a/code/game/gamemodes/miniantags/abduction/abduction_surgery.dm
+++ b/code/game/gamemodes/miniantags/abduction/abduction_surgery.dm
@@ -23,9 +23,9 @@
var/list/organ_types = list(/obj/item/organ/heart)
/datum/surgery_step/extract_organ/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- for(var/obj/item/I in target.internal_organs)
- if(I.type in organ_types)
- IC = I
+ for(var/atom/A in target.internal_organs)
+ if(A.type in organ_types)
+ IC = A
break
user.visible_message("[user] starts to remove [target]'s organs.", "You start to remove [target]'s organs...")
diff --git a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
index 68449ba4317c..56bc184a7d85 100644
--- a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
+++ b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
@@ -66,7 +66,7 @@
if(eyes_s)
photo.Blend(eyes_s, ICON_OVERLAY)
- var/icon/splat = icon("icon" = 'icons/mob/dam_human.dmi',"icon_state" = "chest30")
+ var/icon/splat = icon("icon" = 'icons/mob/dam_mob.dmi',"icon_state" = "chest30")
photo.Blend(splat,ICON_OVERLAY)
return photo
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index 2310d97b66e8..8fd17b07c302 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -528,13 +528,13 @@ var/global/list/possible_items = list()
/datum/objective/steal/give_special_equipment()
if(owner && owner.current && targetinfo)
- if(istype(owner.current, /mob/living/carbon/human))
+ if(ishuman(owner.current))
var/mob/living/carbon/human/H = owner.current
var/list/slots = list ("backpack" = slot_in_backpack)
for(var/eq_path in targetinfo.special_equipment)
var/obj/O = new eq_path
H.equip_in_one_of_slots(O, slots)
- H.update_icons()
+
var/global/list/possible_items_special = list()
/datum/objective/steal/special //ninjas are so special they get their own subtype good for them
diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm
index 9027a95c1ff4..b67617ae380b 100644
--- a/code/game/gamemodes/revolution/revolution.dm
+++ b/code/game/gamemodes/revolution/revolution.dm
@@ -143,8 +143,6 @@
var/where2 = mob.equip_in_one_of_slots(C, slots)
mob.equip_in_one_of_slots(R,slots)
- mob.update_icons()
-
if (!where2)
mob << "The Syndicate were unfortunately unable to get you a chameleon security HUD."
else
@@ -248,7 +246,7 @@
if(iscarbon(rev_mind.current))
var/mob/living/carbon/carbon_mob = rev_mind.current
carbon_mob.silent = max(carbon_mob.silent, 5)
- carbon_mob.flash_eyes(1, 1)
+ carbon_mob.flash_act(1, 1)
rev_mind.current.Stun(5)
rev_mind.current << " You are now a revolutionary! Help your cause. Do not harm your fellow freedom fighters. You can identify your comrades by the red \"R\" icons, and your leaders by the blue \"R\" icons. Help them kill the heads to win the revolution!"
rev_mind.current.attack_log += "\[[time_stamp()]\] Has been converted to the revolution!"
diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm
index b77bc2894ad1..29d8e89c86b8 100644
--- a/code/game/gamemodes/traitor/traitor.dm
+++ b/code/game/gamemodes/traitor/traitor.dm
@@ -375,7 +375,6 @@
if (equipped_slot)
where = "In your [equipped_slot]"
mob << "
[where] is a folder containing secret documents that another Syndicate group wants. We have set up a meeting with one of their agents on station to make an exchange. Exercise extreme caution as they cannot be trusted and may be hostile.
"
- mob.update_icons()
/datum/game_mode/proc/update_traitor_icons_added(datum/mind/traitor_mind)
var/datum/atom_hud/antag/traitorhud = huds[ANTAG_HUD_TRAITOR]
diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm
index 6d0d742c00ed..75b44b7edc9d 100644
--- a/code/game/gamemodes/wizard/artefact.dm
+++ b/code/game/gamemodes/wizard/artefact.dm
@@ -357,7 +357,7 @@ var/global/list/multiverse = list()
if("cyborg")
for(var/X in M.bodyparts)
var/obj/item/bodypart/affecting = X
- affecting.change_bodypart_status(ORGAN_ROBOTIC)
+ affecting.change_bodypart_status(BODYPART_ROBOTIC)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/eyepatch(M), slot_glasses)
M.put_in_hands_or_del(sword)
@@ -460,7 +460,6 @@ var/global/list/multiverse = list()
else
return
- M.update_icons()
M.update_body_parts()
var/obj/item/weapon/card/id/W = new /obj/item/weapon/card/id
diff --git a/code/game/gamemodes/wizard/raginmages.dm b/code/game/gamemodes/wizard/raginmages.dm
index 870854fa3ebe..4805c884929f 100644
--- a/code/game/gamemodes/wizard/raginmages.dm
+++ b/code/game/gamemodes/wizard/raginmages.dm
@@ -47,7 +47,7 @@
for(var/datum/mind/wizard in wizards)
if(!istype(wizard.current,/mob/living/carbon))
continue
- if(istype(wizard.current,/mob/living/carbon/brain))
+ if(istype(wizard.current,/mob/living/brain))
continue
if(wizard.current.stat==DEAD)
continue
diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm
index 82ad4e67cc88..ceb75c29c099 100644
--- a/code/game/gamemodes/wizard/wizard.dm
+++ b/code/game/gamemodes/wizard/wizard.dm
@@ -160,7 +160,6 @@
wizard_mob << "The spellbook is bound to you, and others cannot use it."
wizard_mob << "In your pockets you will find a teleport scroll. Use it as needed."
wizard_mob.mind.store_memory("Remember: do not forget to prepare your spells.")
- wizard_mob.update_icons()
return 1
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index 165f8e21e077..45934d850228 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -169,9 +169,9 @@
var/list/unclean_mutations = (not_good_mutations|bad_mutations)
H.dna.remove_mutation_group(unclean_mutations)
if(efficiency > 5 && prob(20))
- randmutvg(H)
+ H.randmutvg()
if(efficiency < 3 && prob(50))
- var/mob/M = randmutb(H)
+ var/mob/M = H.randmutb()
if(ismob(M))
H = M
@@ -325,7 +325,7 @@
if (mess) //Clean that mess and dump those gibs!
mess = FALSE
- gibs(loc)
+ new /obj/effect/gibspawner/generic(loc)
audible_message("You hear a splat.")
icon_state = "pod_0"
return
@@ -338,7 +338,7 @@
occupant.grab_ghost()
occupant << "There is a bright flash!
\
You feel like a new being."
- occupant.flash_eyes()
+ occupant.flash_act()
var/turf/T = get_turf(src)
occupant.forceMove(T)
diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm
index 7ca75a4bb694..59bff85af250 100644
--- a/code/game/machinery/computer/arcade.dm
+++ b/code/game/machinery/computer/arcade.dm
@@ -498,7 +498,7 @@
M.hallucination += 30
else
usr << "Something strikes you from behind! It hurts like hell and feel like a blunt weapon, but nothing is there..."
- M.take_organ_damage(30)
+ M.take_bodypart_damage(30)
playsound(loc, 'sound/weapons/genhit2.ogg', 100, 1)
if(ORION_TRAIL_ILLNESS)
var/severity = rand(1,3) //pray to RNGesus. PRAY, PIGS
@@ -516,7 +516,7 @@
if(prob(75))
M.Weaken(3)
say("A sudden gust of powerful wind slams [M] into the floor!")
- M.take_organ_damage(25)
+ M.take_bodypart_damage(25)
playsound(src.loc, 'sound/weapons/Genhit.ogg', 100, 1)
else
M << "A violent gale blows past you, and you barely manage to stay standing!"
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 224d5e231100..89e3a0ffdb43 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -611,11 +611,9 @@ var/list/airlock_overlays = list()
if(!istype(H.head, /obj/item/clothing/head/helmet))
H.visible_message("[user] headbutts the airlock.", \
"You headbutt the airlock!")
- var/obj/item/bodypart/affecting = H.get_bodypart("head")
H.Stun(5)
H.Weaken(5)
- if(affecting && affecting.take_damage(10, 0))
- H.update_damage_overlays(0)
+ H.apply_damage(10, BRUTE, "head")
else
visible_message("[user] headbutts the airlock. Good thing they're wearing a helmet.")
return
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index e1b6209fed90..3dbeadfd33da 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -114,7 +114,7 @@
if (get_dist(src, L) > range)
continue
- if(L.flash_eyes(affect_silicon = 1))
+ if(L.flash_act(affect_silicon = 1))
L.Weaken(strength)
if(L.weakeyes)
L.Weaken(strength * 1.5)
diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm
index 12f665fa17c4..32c60b667591 100644
--- a/code/game/machinery/rechargestation.dm
+++ b/code/game/machinery/rechargestation.dm
@@ -134,7 +134,7 @@
var/mob/living/silicon/robot/R = occupant
restock_modules()
if(repairs)
- R.heal_organ_damage(repairs, repairs - 1)
+ R.heal_bodypart_damage(repairs, repairs - 1)
if(R.cell)
R.cell.charge = min(R.cell.charge + recharge_speed, R.cell.maxcharge)
diff --git a/code/game/machinery/robot_fabricator.dm b/code/game/machinery/robot_fabricator.dm
index 3b9c43beb803..47f7fe8a0430 100644
--- a/code/game/machinery/robot_fabricator.dm
+++ b/code/game/machinery/robot_fabricator.dm
@@ -6,7 +6,7 @@
anchored = 1
var/metal_amount = 0
var/operating = 0
- var/obj/item/robot_parts/being_built = null
+ var/obj/item/being_built = null
use_power = 1
idle_power_usage = 20
active_power_usage = 5000
@@ -90,37 +90,37 @@ Please wait until completion...
switch (part_type)
if (1)
- build_type = "/obj/item/robot_parts/l_arm"
+ build_type = "/obj/item/bodypart/l_arm/robot"
build_time = 200
build_cost = 10000
if (2)
- build_type = "/obj/item/robot_parts/r_arm"
+ build_type = "/obj/item/bodypart/r_arm/robot"
build_time = 200
build_cost = 10000
if (3)
- build_type = "/obj/item/robot_parts/l_leg"
+ build_type = "/obj/item/bodypart/l_leg/robot"
build_time = 200
build_cost = 10000
if (4)
- build_type = "/obj/item/robot_parts/r_leg"
+ build_type = "/obj/item/bodypart/r_leg/robot"
build_time = 200
build_cost = 10000
if (5)
- build_type = "/obj/item/robot_parts/chest"
+ build_type = "/obj/item/bodypart/chest/robot"
build_time = 350
build_cost = 40000
if (6)
- build_type = "/obj/item/robot_parts/head"
+ build_type = "/obj/item/bodypart/head/robot"
build_time = 350
build_cost = 5000
if (7)
- build_type = "/obj/item/robot_parts/robot_suit"
+ build_type = "/obj/item/robot_suit"
build_time = 600
build_cost = 15000
@@ -146,6 +146,4 @@ Please wait until completion...
src.overlays -= "fab-active"
return
- for (var/mob/M in viewers(1, src))
- if (M.client && M.machine == src)
- src.attack_hand(M)
+ updateUsrDialog()
diff --git a/code/game/machinery/telecomms/computers/logbrowser.dm b/code/game/machinery/telecomms/computers/logbrowser.dm
index 61598ca32bcb..478ef77fe6f0 100644
--- a/code/game/machinery/telecomms/computers/logbrowser.dm
+++ b/code/game/machinery/telecomms/computers/logbrowser.dm
@@ -72,7 +72,7 @@
var/language = "Human" // MMIs, pAIs, Cyborgs and humans all speak Human
var/mobtype = C.parameters["mobtype"]
- var/list/humans = typesof(/mob/living/carbon/human, /mob/living/carbon/brain)
+ var/list/humans = typesof(/mob/living/carbon/human, /mob/living/brain)
var/list/monkeys = typesof(/mob/living/carbon/monkey)
var/list/silicons = typesof(/mob/living/silicon)
var/list/slimes = typesof(/mob/living/simple_animal/slime)
diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm
index 36239710c46e..af916014ca2b 100644
--- a/code/game/mecha/equipment/tools/medical_tools.dm
+++ b/code/game/mecha/equipment/tools/medical_tools.dm
@@ -343,7 +343,7 @@
mechsyringe.icon = initial(mechsyringe.icon)
mechsyringe.reagents.reaction(M, INJECT)
mechsyringe.reagents.trans_to(M, mechsyringe.reagents.total_volume)
- M.take_organ_damage(2)
+ M.take_bodypart_damage(2)
add_logs(originaloccupant, M, "shot", "syringegun")
break
else if(mechsyringe.loc == trg)
diff --git a/code/game/mecha/equipment/tools/mining_tools.dm b/code/game/mecha/equipment/tools/mining_tools.dm
index 6ec06406b811..37bde068e28c 100644
--- a/code/game/mecha/equipment/tools/mining_tools.dm
+++ b/code/game/mecha/equipment/tools/mining_tools.dm
@@ -83,13 +83,11 @@
add_logs(user, target, "attacked", "[name]", "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
if(ishuman(target))
var/mob/living/carbon/human/H = target
- var/obj/item/bodypart/affecting = H.get_bodypart("chest")
- affecting.take_damage(drill_damage)
- H.update_damage_overlays(0)
+ H.apply_damage(drill_damage, BRUTE, "chest")
else if(target.stat == DEAD && target.butcher_results)
target.harvest(chassis) // Butcher the mob with our drill.
else
- target.take_organ_damage(drill_damage)
+ target.take_bodypart_damage(drill_damage)
if(target)
target.Paralyse(10)
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 2a15a49fdacf..6a04670188ad 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -845,7 +845,7 @@
else if(occupant)
user << "Occupant detected!"
return 0
- else if(dna_lock && (!mmi_as_oc.brainmob.dna || dna_lock!=mmi_as_oc.brainmob.dna.unique_enzymes))
+ else if(dna_lock && (!mmi_as_oc.brainmob.stored_dna || dna_lock!=mmi_as_oc.brainmob.stored_dna.unique_enzymes))
user << "Access denied. [name] is secured with a DNA lock."
return 0
@@ -905,8 +905,8 @@
if(ishuman(occupant))
mob_container = occupant
RemoveActions(occupant, human_occupant=1)
- else if(istype(occupant, /mob/living/carbon/brain))
- var/mob/living/carbon/brain/brain = occupant
+ else if(istype(occupant, /mob/living/brain))
+ var/mob/living/brain/brain = occupant
RemoveActions(brain)
mob_container = brain.container
else if(isAI(occupant) && forced) //This should only happen if there are multiple AIs in a round, and at least one is Malf.
diff --git a/code/game/objects/effects/decals/Cleanable/aliens.dm b/code/game/objects/effects/decals/Cleanable/aliens.dm
index 36bf7577bb10..a0e5d4a3dc31 100644
--- a/code/game/objects/effects/decals/Cleanable/aliens.dm
+++ b/code/game/objects/effects/decals/Cleanable/aliens.dm
@@ -21,18 +21,21 @@
return ..()
/obj/effect/decal/cleanable/xenoblood/xgibs/proc/streak(list/directions)
- spawn (0)
- var/direction = pick(directions)
- for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
- sleep(3)
- if (i > 0)
- var/obj/effect/decal/cleanable/xenoblood/b = new /obj/effect/decal/cleanable/xenoblood/xsplatter(src.loc)
- for(var/datum/disease/D in src.viruses)
- var/datum/disease/ND = D.Copy(1)
- b.viruses += ND
- ND.holder = b
- if (step_to(src, get_step(src, direction), 0))
- break
+ set waitfor = 0
+ var/direction = pick(directions)
+ for(var/i = 0, i < pick(1, 200; 2, 150; 3, 50), i++)
+ sleep(2)
+ if (i > 0)
+ var/obj/effect/decal/cleanable/xenoblood/b = new /obj/effect/decal/cleanable/xenoblood/xsplatter(src.loc)
+ for(var/datum/disease/D in src.viruses)
+ var/datum/disease/ND = D.Copy(1)
+ b.viruses += ND
+ ND.holder = b
+ if (!step_to(src, get_step(src, direction), 0))
+ break
+
+/obj/effect/decal/cleanable/xenoblood/xgibs/replace_decal(obj/effect/decal/cleanable/C)
+ return //gibs can stack, so gibspawner can work properly
/obj/effect/decal/cleanable/xenoblood/xsplatter
random_icon_states = list("xgibbl1", "xgibbl2", "xgibbl3", "xgibbl4", "xgibbl5")
@@ -57,12 +60,21 @@
/obj/effect/decal/cleanable/xenoblood/xgibs/body
random_icon_states = list("xgibhead", "xgibtorso")
+/obj/effect/decal/cleanable/xenoblood/xgibs/torso
+ random_icon_states = list("xgibtorso")
+
/obj/effect/decal/cleanable/xenoblood/xgibs/limb
random_icon_states = list("xgibleg", "xgibarm")
/obj/effect/decal/cleanable/xenoblood/xgibs/core
random_icon_states = list("xgibmid1", "xgibmid2", "xgibmid3")
+/obj/effect/decal/cleanable/xenoblood/xgibs/larva
+ random_icon_states = list("xgiblarva1", "xgiblarva2")
+
+/obj/effect/decal/cleanable/xenoblood/xgibs/larva/body
+ random_icon_states = list("xgiblarvahead", "xgiblarvatorso")
+
/obj/effect/decal/cleanable/blood/xtracks
icon_state = "xtracks"
random_icon_states = null
diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm
index 0e978782a5dc..916bd7d2cf3e 100644
--- a/code/game/objects/effects/decals/Cleanable/humans.dm
+++ b/code/game/objects/effects/decals/Cleanable/humans.dm
@@ -77,6 +77,10 @@
/obj/effect/decal/cleanable/blood/gibs/body
random_icon_states = list("gibhead", "gibtorso")
+/obj/effect/decal/cleanable/blood/gibs/torso
+ random_icon_states = list("gibtorso")
+
+
/obj/effect/decal/cleanable/blood/gibs/limb
random_icon_states = list("gibleg", "gibarm")
@@ -87,17 +91,20 @@
/obj/effect/decal/cleanable/blood/gibs/proc/streak(list/directions)
set waitfor = 0
var/direction = pick(directions)
- for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
- sleep(3)
+ for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50), i++)
+ sleep(2)
if (i > 0)
var/obj/effect/decal/cleanable/blood/b = new /obj/effect/decal/cleanable/blood/splatter(src.loc)
for(var/datum/disease/D in src.viruses)
var/datum/disease/ND = D.Copy(1)
b.viruses += ND
ND.holder = b
- if (step_to(src, get_step(src, direction), 0))
+ if (!step_to(src, get_step(src, direction), 0))
break
+/obj/effect/decal/cleanable/blood/gibs/replace_decal(obj/effect/decal/cleanable/C)
+ return //gibs can stack, so gibspawner can work properly
+
/obj/effect/decal/cleanable/blood/drip
name = "drips of blood"
desc = "It's red."
diff --git a/code/game/objects/effects/decals/Cleanable/robots.dm b/code/game/objects/effects/decals/Cleanable/robots.dm
index e255f497ca20..7c0666a0c6e9 100644
--- a/code/game/objects/effects/decals/Cleanable/robots.dm
+++ b/code/game/objects/effects/decals/Cleanable/robots.dm
@@ -15,8 +15,8 @@
/obj/effect/decal/cleanable/robot_debris/proc/streak(list/directions)
set waitfor = 0
var/direction = pick(directions)
- for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
- sleep(3)
+ for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50), i++)
+ sleep(2)
if (i > 0)
if (prob(40))
new /obj/effect/decal/cleanable/oil/streak(src.loc)
@@ -24,9 +24,12 @@
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
s.start()
- if (step_to(src, get_step(src, direction), 0))
+ if (!step_to(src, get_step(src, direction), 0))
break
+/obj/effect/decal/cleanable/robot_debris/replace_decal(obj/effect/decal/cleanable/C)
+ return //robot debris can stack, so gibspawner can work properly
+
/obj/effect/decal/cleanable/robot_debris/ex_act()
return
diff --git a/code/game/objects/effects/decals/remains.dm b/code/game/objects/effects/decals/remains.dm
index 834c3b4c7dc6..b498217bb8a3 100644
--- a/code/game/objects/effects/decals/remains.dm
+++ b/code/game/objects/effects/decals/remains.dm
@@ -11,6 +11,9 @@
desc = "They look like the remains of something... alien. They have a strange aura about them."
icon_state = "remainsxeno"
+/obj/effect/decal/remains/xeno/larva
+ icon_state = "remainslarva"
+
/obj/effect/decal/remains/robot
desc = "They look like the remains of something mechanical. They have a strange aura about them."
icon = 'icons/mob/robots.dmi'
diff --git a/code/game/objects/effects/gibs.dm b/code/game/objects/effects/gibs.dm
deleted file mode 100644
index 5bac5acd991d..000000000000
--- a/code/game/objects/effects/gibs.dm
+++ /dev/null
@@ -1,62 +0,0 @@
-/proc/gibs(atom/location, list/viruses, datum/dna/MobDNA)
- new /obj/effect/gibspawner/generic(location,viruses,MobDNA)
-
-/proc/hgibs(atom/location, list/viruses, datum/dna/MobDNA)
- new /obj/effect/gibspawner/human(location,viruses,MobDNA)
-
-/proc/xgibs(atom/location, list/viruses)
- new /obj/effect/gibspawner/xeno(location,viruses)
-
-/proc/robogibs(atom/location, list/viruses)
- new /obj/effect/gibspawner/robot(location,viruses)
-
-/obj/effect/gibspawner
- var/sparks = 0 //whether sparks spread on Gib()
- var/virusProb = 20 //the chance for viruses to spread on the gibs
- var/list/gibtypes = list()
- var/list/gibamounts = list()
- var/list/gibdirections = list() //of lists
-
-/obj/effect/gibspawner/New(location, var/list/viruses, var/datum/dna/MobDNA)
- ..()
-
- Gib(loc,viruses,MobDNA)
-
-/obj/effect/gibspawner/proc/Gib(atom/location, list/viruses = list(), datum/dna/MobDNA = null)
- if(gibtypes.len != gibamounts.len || gibamounts.len != gibdirections.len)
- world << "Gib list length mismatch!"
- return
-
- var/obj/effect/decal/cleanable/blood/gibs/gib = null
-
- if(sparks)
- var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
- s.set_up(2, 1, location)
- s.start()
-
- for(var/i = 1, i<= gibtypes.len, i++)
- if(gibamounts[i])
- for(var/j = 1, j<= gibamounts[i], j++)
- var/gibType = gibtypes[i]
- gib = new gibType(location)
- if(istype(location,/mob/living/carbon))
- var/mob/living/carbon/digester = location
- digester.stomach_contents += gib
-
- if(viruses.len > 0)
- for(var/datum/disease/D in viruses)
- if(prob(virusProb))
- var/datum/disease/viruus = D.Copy(1)
- gib.viruses += viruus
- viruus.holder = gib
-
- if(MobDNA)
- gib.blood_DNA[MobDNA.unique_enzymes] = MobDNA.blood_type
- else if(istype(src, /obj/effect/gibspawner/generic)) // Probably a monkey
- gib.blood_DNA["Non-human DNA"] = "A+"
- var/list/directions = gibdirections[i]
- if(istype(loc,/turf))
- if(directions.len)
- gib.streak(directions)
-
- qdel(src)
diff --git a/code/game/objects/effects/spawners/gibspawner.dm b/code/game/objects/effects/spawners/gibspawner.dm
index e6618e62c742..bb6afc8e8eea 100644
--- a/code/game/objects/effects/spawners/gibspawner.dm
+++ b/code/game/objects/effects/spawners/gibspawner.dm
@@ -1,4 +1,53 @@
+
/obj/effect/gibspawner
+ var/sparks = 0 //whether sparks spread
+ var/virusProb = 20 //the chance for viruses to spread on the gibs
+ var/list/gibtypes = list() //typepaths of the gib decals to spawn
+ var/list/gibamounts = list() //amount to spawn for each gib decal type we'll spawn.
+ var/list/gibdirections = list() //of lists of possible directions to spread each gib decal type towards.
+
+/obj/effect/gibspawner/New(location, list/viruses, datum/dna/MobDNA)
+ ..()
+
+ if(gibtypes.len != gibamounts.len || gibamounts.len != gibdirections.len)
+ world << "Gib list length mismatch!"
+ return
+
+ var/obj/effect/decal/cleanable/blood/gibs/gib = null
+
+ if(sparks)
+ var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
+ s.set_up(2, 1, location)
+ s.start()
+
+ for(var/i = 1, i<= gibtypes.len, i++)
+ if(gibamounts[i])
+ for(var/j = 1, j<= gibamounts[i], j++)
+ var/gibType = gibtypes[i]
+ gib = new gibType(location)
+ if(istype(location,/mob/living/carbon))
+ var/mob/living/carbon/digester = location
+ digester.stomach_contents += gib
+
+ if(viruses && viruses.len > 0)
+ for(var/datum/disease/D in viruses)
+ if(prob(virusProb))
+ var/datum/disease/viruus = D.Copy(1)
+ gib.viruses += viruus
+ viruus.holder = gib
+
+ if(MobDNA)
+ gib.blood_DNA[MobDNA.unique_enzymes] = MobDNA.blood_type
+ else if(istype(src, /obj/effect/gibspawner/generic)) // Probably a monkey
+ gib.blood_DNA["Non-human DNA"] = "A+"
+ var/list/directions = gibdirections[i]
+ if(isturf(loc))
+ if(directions.len)
+ gib.streak(directions)
+
+ qdel(src)
+
+
/obj/effect/gibspawner/generic
gibtypes = list(/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs/core)
@@ -16,17 +65,55 @@
/obj/effect/gibspawner/human/New()
playsound(src, 'sound/effects/blobattack.ogg', 50, 1)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, alldirs, list())
- gibamounts[6] = pick(0,1,2)
..()
+
+/obj/effect/gibspawner/humanbodypartless //only the gibs that don't look like actual full bodyparts (except torso).
+ gibtypes = list(/obj/effect/decal/cleanable/blood/gibs, /obj/effect/decal/cleanable/blood/gibs/core,/obj/effect/decal/cleanable/blood/gibs, /obj/effect/decal/cleanable/blood/gibs/core, /obj/effect/decal/cleanable/blood/gibs, /obj/effect/decal/cleanable/blood/gibs/torso)
+ gibamounts = list(1, 1, 1, 1, 1, 1)
+
+/obj/effect/gibspawner/humanbodypartless/New()
+ playsound(src, 'sound/effects/blobattack.ogg', 50, 1)
+ gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, list())
+ ..()
+
+
/obj/effect/gibspawner/xeno
- gibtypes = list(/obj/effect/decal/cleanable/xenoblood/xgibs/up,/obj/effect/decal/cleanable/xenoblood/xgibs/down,/obj/effect/decal/cleanable/xenoblood/xgibs,/obj/effect/decal/cleanable/xenoblood/xgibs,/obj/effect/decal/cleanable/xenoblood/xgibs/body,/obj/effect/decal/cleanable/xenoblood/xgibs/limb,/obj/effect/decal/cleanable/xenoblood/xgibs/core)
+ gibtypes = list(/obj/effect/decal/cleanable/xenoblood/xgibs/up,/obj/effect/decal/cleanable/xenoblood/xgibs/down,/obj/effect/decal/cleanable/xenoblood/xgibs, /obj/effect/decal/cleanable/xenoblood/xgibs, /obj/effect/decal/cleanable/xenoblood/xgibs/body, /obj/effect/decal/cleanable/xenoblood/xgibs/limb, /obj/effect/decal/cleanable/xenoblood/xgibs/core)
gibamounts = list(1,1,1,1,1,1,1)
/obj/effect/gibspawner/xeno/New()
playsound(src, 'sound/effects/blobattack.ogg', 60, 1)
gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, alldirs, list())
- gibamounts[6] = pick(0,1,2)
+ ..()
+
+
+/obj/effect/gibspawner/xenobodypartless //only the gibs that don't look like actual full bodyparts (except torso).
+ gibtypes = list(/obj/effect/decal/cleanable/xenoblood/xgibs, /obj/effect/decal/cleanable/xenoblood/xgibs/core,/obj/effect/decal/cleanable/xenoblood/xgibs, /obj/effect/decal/cleanable/xenoblood/xgibs/core, /obj/effect/decal/cleanable/xenoblood/xgibs, /obj/effect/decal/cleanable/xenoblood/xgibs/torso)
+ gibamounts = list(1, 1, 1, 1, 1, 1)
+
+
+/obj/effect/gibspawner/xenobodypartless/New()
+ playsound(src, 'sound/effects/blobattack.ogg', 60, 1)
+ gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, list())
+ ..()
+
+/obj/effect/gibspawner/larva
+ gibtypes = list(/obj/effect/decal/cleanable/xenoblood/xgibs/larva, /obj/effect/decal/cleanable/xenoblood/xgibs/larva, /obj/effect/decal/cleanable/xenoblood/xgibs/larva/body, /obj/effect/decal/cleanable/xenoblood/xgibs/larva/body)
+ gibamounts = list(1, 1, 1, 1)
+
+/obj/effect/gibspawner/larva/New()
+ playsound(src, 'sound/effects/blobattack.ogg', 60, 1)
+ gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST), list(), alldirs)
+ ..()
+
+/obj/effect/gibspawner/larvabodypartless
+ gibtypes = list(/obj/effect/decal/cleanable/xenoblood/xgibs/larva, /obj/effect/decal/cleanable/xenoblood/xgibs/larva, /obj/effect/decal/cleanable/xenoblood/xgibs/larva)
+ gibamounts = list(1, 1, 1)
+
+/obj/effect/gibspawner/larvabodypartless/New()
+ playsound(src, 'sound/effects/blobattack.ogg', 60, 1)
+ gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST), list())
..()
/obj/effect/gibspawner/robot
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index efe7edf08e14..8877f17bc510 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -230,8 +230,8 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s
user << "You burn your hand on [src]!"
var/obj/item/bodypart/affecting = H.get_bodypart("[(user.active_hand_index % 2 == 0) ? "r" : "l" ]_arm")
if(affecting && affecting.take_damage( 0, 5 )) // 5 burn damage
- H.update_damage_overlays(0)
- H.updatehealth()
+ H.update_damage_overlays()
+
return
else
extinguish()
@@ -454,11 +454,10 @@ obj/item/proc/item_action_slot_check(slot, mob/user)
)
if(is_human_victim)
var/mob/living/carbon/human/U = M
- if(affecting.take_damage(7))
- U.update_damage_overlays(0)
+ U.apply_damage(7, BRUTE, affecting)
else
- M.take_organ_damage(7)
+ M.take_bodypart_damage(7)
add_logs(user, M, "attacked", "[src.name]", "(INTENT: [uppertext(user.a_intent)])")
diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm
index a04be038af72..a79ee1e4704c 100644
--- a/code/game/objects/items/crayons.dm
+++ b/code/game/objects/items/crayons.dm
@@ -640,7 +640,7 @@
if(C.client)
C.blur_eyes(3)
C.blind_eyes(1)
- if(C.check_eye_prot() <= 0) // no eye protection? ARGH IT BURNS.
+ if(C.get_eye_protection() <= 0) // no eye protection? ARGH IT BURNS.
C.confused = max(C.confused, 3)
C.Weaken(3)
if(ishuman(C) && actually_paints)
diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm
index b0be84a5209d..f2932a64dd61 100644
--- a/code/game/objects/items/devices/flashlight.dm
+++ b/code/game/objects/items/devices/flashlight.dm
@@ -61,7 +61,7 @@
return
if(M == user) //they're using it on themselves
- if(M.flash_eyes(visual = 1))
+ if(M.flash_act(visual = 1))
M.visible_message("[M] directs [src] to \his eyes.", \
"You wave the light in front of your eyes! Trippy!")
else
@@ -77,7 +77,7 @@
else if(C.dna.check_mutation(XRAY)) //mob has X-RAY vision
user << "[C] pupils give an eerie glow!"
else //they're okay!
- if(C.flash_eyes(visual = 1))
+ if(C.flash_act(visual = 1))
user << "[C]'s pupils narrow."
else
return ..()
diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm
index 65a73271e416..dfdccf1b8d15 100644
--- a/code/game/objects/items/devices/laserpointer.dm
+++ b/code/game/objects/items/devices/laserpointer.dm
@@ -98,7 +98,7 @@
severity = 0
//20% chance to actually hit the eyes
- if(prob(effectchance * diode.rating) && C.flash_eyes(severity))
+ if(prob(effectchance * diode.rating) && C.flash_act(severity))
outmsg = "You blind [C] by shining [src] in their eyes."
if(C.weakeyes)
C.Stun(1)
@@ -110,7 +110,7 @@
var/mob/living/silicon/S = target
//20% chance to actually hit the sensors
if(prob(effectchance * diode.rating))
- S.flash_eyes(affect_silicon = 1)
+ S.flash_act(affect_silicon = 1)
S.Weaken(rand(5,10))
S << "Your sensors were overloaded by a laser!"
outmsg = "You overload [S] by shining [src] at their sensors."
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index c39791c03504..e5bb68ef23c4 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -114,7 +114,7 @@ MASS SPECTROMETER
// Used by the PDA medical scanner too
/proc/healthscan(mob/living/user, mob/living/M, mode = 1)
- if(user.stat || user.eye_blind)
+ if(user.incapacitated() || user.eye_blind)
return
//Damage specifics
var/oxy_loss = M.getOxyLoss()
@@ -156,9 +156,9 @@ MASS SPECTROMETER
user << "\tBrain damage detected. Subject may have had a concussion."
// Organ damage report
- if(istype(M, /mob/living/carbon/human) && mode == 1)
- var/mob/living/carbon/human/H = M
- var/list/damaged = H.get_damaged_bodyparts(1,1)
+ if(iscarbon(M) && mode == 1)
+ var/mob/living/carbon/C = M
+ var/list/damaged = C.get_damaged_bodyparts(1,1)
if(length(damaged)>0 || oxy_loss>0 || tox_loss>0 || fire_loss>0)
user << "\tDamage: Brute-Burn-Toxin-Suffocation\n\t\tSpecifics: [brute_loss]-[fire_loss]-[tox_loss]-[oxy_loss]"
for(var/obj/item/bodypart/org in damaged)
diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm
index d898405a1d87..5e8b75b987a9 100644
--- a/code/game/objects/items/robot/robot_items.dm
+++ b/code/game/objects/items/robot/robot_items.dm
@@ -294,14 +294,10 @@
user.visible_message("[user] blares out a near-deafening siren from its speakers!", \
"The siren pierces your hearing and confuses you!", \
"The siren pierces your hearing!")
- for(var/mob/living/M in get_hearers_in_view(9, user))
- if(iscarbon(M))
- if(istype(M, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = M
- if(istype(H.ears, /obj/item/clothing/ears/earmuffs))
- continue
+ for(var/mob/living/carbon/M in get_hearers_in_view(9, user))
+ if(M.get_ear_protection() == 0)
M.confused += 6
- M << "HUMAN HARM"
+ audible_message("HUMAN HARM")
playsound(get_turf(src), 'sound/AI/harmalarm.ogg', 70, 3)
cooldown = world.time + 200
log_game("[user.ckey]([user]) used a Cyborg Harm Alarm in ([user.x],[user.y],[user.z])")
@@ -312,35 +308,20 @@
return
if(safety == 0)
- for(var/mob/living/M in get_hearers_in_view(9, user))
- if(iscarbon(M))
- var/earsafety = 0
- if(istype(M, /mob/living/carbon/alien))
- continue
- if(ishuman(M))
- var/mob/living/carbon/human/S = M
- if(istype(S.ears, /obj/item/clothing/ears/earmuffs))
- continue
- if(S.check_ear_prot())
- earsafety = 1
- if(earsafety)
- M.confused += 5
- M.stuttering += 10
- M.adjustEarDamage(0, 5)
- M.Jitter(10)
- user.visible_message("[user] blares out a sonic screech from its speakers!", \
- "You hear a sharp screech, before your thoughts are interrupted and you find yourself extremely disorientated.", \
- "You hear a sonic screech and suddenly can't seem to walk straight!")
- else
- M.Weaken(2)
- M.confused += 10
- M.stuttering += 15
- M.adjustEarDamage(0, 20)
- M.Jitter(25)
- user.visible_message("[user] blares out a sonic screech from its speakers!", \
- "You hear a sharp screech before your thoughts are interrupted and you collapse, your ears ringing!", \
- "You hear a sonic screech and collapse, your ears riniging!")
- M << "BZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZT"
+ for(var/mob/living/carbon/C in get_hearers_in_view(9, user))
+ var/bang_effect = C.soundbang_act(2, 0, 0, 5)
+ switch(bang_effect)
+ if(1)
+ C.confused += 5
+ C.stuttering += 10
+ C.Jitter(10)
+ if(2)
+ C.Weaken(2)
+ C.confused += 10
+ C.stuttering += 15
+ C.Jitter(25)
+
+ user.audible_message("BZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZT")
playsound(get_turf(src), 'sound/machines/warning-buzzer.ogg', 130, 3)
cooldown = world.time + 600
log_game("[user.ckey]([user]) used an emagged Cyborg Harm Alarm in ([user.x],[user.y],[user.z])")
diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm
index d133a66b6124..21aab1670c9e 100644
--- a/code/game/objects/items/robot/robot_parts.dm
+++ b/code/game/objects/items/robot/robot_parts.dm
@@ -1,68 +1,19 @@
-/obj/item/robot_parts
- name = "robot parts"
- icon = 'icons/obj/robot_parts.dmi'
- force = 4
- throwforce = 4
- item_state = "buildpipe"
- icon_state = "blank"
- flags = CONDUCT
- slot_flags = SLOT_BELT
- var/body_zone
-/obj/item/robot_parts/l_arm
- name = "cyborg left arm"
- desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
- attack_verb = list("slapped", "punched")
- icon_state = "l_arm"
- body_zone = "l_arm"
-/obj/item/robot_parts/r_arm
- name = "cyborg right arm"
- desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
- attack_verb = list("slapped", "punched")
- icon_state = "r_arm"
- body_zone = "r_arm"
+//The robot bodyparts have been moved to code/module/surgery/bodyparts/robot_bodyparts.dm
-/obj/item/robot_parts/l_leg
- name = "cyborg left leg"
- desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
- attack_verb = list("kicked", "stomped")
- icon_state = "l_leg"
- body_zone = "l_leg"
-/obj/item/robot_parts/r_leg
- name = "cyborg right leg"
- desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
- attack_verb = list("kicked", "stomped")
- icon_state = "r_leg"
- body_zone = "r_leg"
-
-/obj/item/robot_parts/chest
- name = "cyborg torso"
- desc = "A heavily reinforced case containing cyborg logic boards, with space for a standard power cell."
- icon_state = "chest"
- body_zone = "chest"
- var/wired = 0
- var/obj/item/weapon/stock_parts/cell/cell = null
-
-/obj/item/robot_parts/head
- name = "cyborg head"
- desc = "A standard reinforced braincase, with spine-plugged neural socket and sensor gimbals."
- icon_state = "head"
- body_zone = "head"
- var/obj/item/device/assembly/flash/handheld/flash1 = null
- var/obj/item/device/assembly/flash/handheld/flash2 = null
-
-/obj/item/robot_parts/robot_suit
+/obj/item/robot_suit
name = "cyborg endoskeleton"
desc = "A complex metal backbone with standard limb sockets and pseudomuscle anchors."
+ icon = 'icons/obj/robot_parts.dmi'
icon_state = "robo_suit"
- var/obj/item/robot_parts/l_arm/l_arm = null
- var/obj/item/robot_parts/r_arm/r_arm = null
- var/obj/item/robot_parts/l_leg/l_leg = null
- var/obj/item/robot_parts/r_leg/r_leg = null
- var/obj/item/robot_parts/chest/chest = null
- var/obj/item/robot_parts/head/head = null
+ var/obj/item/bodypart/l_arm/robot/l_arm = null
+ var/obj/item/bodypart/r_arm/robot/r_arm = null
+ var/obj/item/bodypart/l_leg/robot/l_leg = null
+ var/obj/item/bodypart/r_leg/robot/r_leg = null
+ var/obj/item/bodypart/chest/robot/chest = null
+ var/obj/item/bodypart/head/robot/head = null
var/created_name = ""
var/mob/living/silicon/ai/forced_ai
@@ -71,11 +22,11 @@
var/aisync = 1
var/panel_locked = 1
-/obj/item/robot_parts/robot_suit/New()
+/obj/item/robot_suit/New()
..()
src.updateicon()
-/obj/item/robot_parts/robot_suit/proc/updateicon()
+/obj/item/robot_suit/proc/updateicon()
src.cut_overlays()
if(src.l_arm)
src.add_overlay("l_arm+o")
@@ -90,7 +41,7 @@
if(src.head)
src.add_overlay("head+o")
-/obj/item/robot_parts/robot_suit/proc/check_completion()
+/obj/item/robot_suit/proc/check_completion()
if(src.l_arm && src.r_arm)
if(src.l_leg && src.r_leg)
if(src.chest && src.head)
@@ -98,7 +49,7 @@
return 1
return 0
-/obj/item/robot_parts/robot_suit/attackby(obj/item/W, mob/user, params)
+/obj/item/robot_suit/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = W
@@ -114,64 +65,82 @@
else
user << "You need one sheet of metal to start building ED-209!"
return
- else if(istype(W, /obj/item/robot_parts/l_leg))
+ else if(istype(W, /obj/item/bodypart/l_leg/robot))
if(src.l_leg)
return
if(!user.unEquip(W))
return
- W.loc = src
+ W.forceMove(src)
+ W.icon_state = initial(W.icon_state)
+ W.cut_overlays()
src.l_leg = W
src.updateicon()
- else if(istype(W, /obj/item/robot_parts/r_leg))
+ else if(istype(W, /obj/item/bodypart/r_leg/robot))
if(src.r_leg)
return
if(!user.unEquip(W))
return
- W.loc = src
+ W.forceMove(src)
+ W.icon_state = initial(W.icon_state)
+ W.cut_overlays()
src.r_leg = W
src.updateicon()
- else if(istype(W, /obj/item/robot_parts/l_arm))
+ else if(istype(W, /obj/item/bodypart/l_arm/robot))
if(src.l_arm)
return
if(!user.unEquip(W))
return
- W.loc = src
+ W.forceMove(src)
+ W.icon_state = initial(W.icon_state)
+ W.cut_overlays()
src.l_arm = W
src.updateicon()
- else if(istype(W, /obj/item/robot_parts/r_arm))
+ else if(istype(W, /obj/item/bodypart/r_arm/robot))
if(src.r_arm)
return
if(!user.unEquip(W))
return
- W.loc = src
+ W.forceMove(src)
+ W.icon_state = initial(W.icon_state)//in case it is a dismembered robotic limb
+ W.cut_overlays()
src.r_arm = W
src.updateicon()
- else if(istype(W, /obj/item/robot_parts/chest))
+ else if(istype(W, /obj/item/bodypart/chest/robot))
+ var/obj/item/bodypart/chest/robot/CH = W
if(src.chest)
return
- if(W:wired && W:cell)
- if(!user.unEquip(W))
+ if(CH.wired && CH.cell)
+ if(!user.unEquip(CH))
return
- W.loc = src
- src.chest = W
+ CH.forceMove(src)
+ CH.icon_state = initial(CH.icon_state) //in case it is a dismembered robotic limb
+ CH.cut_overlays()
+ src.chest = CH
src.updateicon()
- else if(!W:wired)
+ else if(!CH.wired)
user << "You need to attach wires to it first!"
else
user << "You need to attach a cell to it first!"
- else if(istype(W, /obj/item/robot_parts/head))
+ else if(istype(W, /obj/item/bodypart/head/robot))
+ var/obj/item/bodypart/head/robot/HD = W
+ for(var/X in HD.contents)
+ if(istype(X, /obj/item/organ))
+ user << "There are organs inside [HD]!"
+ return
if(src.head)
return
- if(W:flash2 && W:flash1)
- if(!user.unEquip(W))
+ if(HD.flash2 && HD.flash1)
+ if(!user.unEquip(HD))
return
- W.loc = src
- src.head = W
+ HD.loc = src
+ HD.icon_state = initial(HD.icon_state)//in case it is a dismembered robotic limb
+ HD.cut_overlays()
+ src.head = HD
src.updateicon()
else
user << "You need to attach a flash to it first!"
@@ -192,7 +161,7 @@
user << "Sticking an empty MMI into the frame would sort of defeat the purpose!"
return
- var/mob/living/carbon/brain/BM = M.brainmob
+ var/mob/living/brain/BM = M.brainmob
if(!BM.key || !BM.mind)
user << "The mmi indicates that their mind is completely unresponsive; there's no point!"
return
@@ -283,7 +252,7 @@
else
return ..()
-/obj/item/robot_parts/robot_suit/proc/Interact(mob/user)
+/obj/item/robot_suit/proc/Interact(mob/user)
var/t1 = text("Designation: [(created_name ? "[created_name]" : "Default Cyborg")]
\n",src)
t1 += text("Master AI: [(forced_ai ? "[forced_ai.name]" : "Automatic")]
\n",src)
@@ -295,8 +264,8 @@
popup.set_content(t1)
popup.open()
-/obj/item/robot_parts/robot_suit/Topic(href, href_list)
- if(usr.lying || usr.stat || usr.stunned || !Adjacent(usr))
+/obj/item/robot_suit/Topic(href, href_list)
+ if(usr.incapacitated() || !Adjacent(usr))
return
var/mob/living/living_user = usr
@@ -330,50 +299,4 @@
add_fingerprint(usr)
Interact(usr)
- return
-
-/obj/item/robot_parts/chest/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/weapon/stock_parts/cell))
- if(src.cell)
- user << "You have already inserted a cell!"
- return
- else
- if(!user.unEquip(W))
- return
- W.loc = src
- src.cell = W
- user << "You insert the cell."
- else if(istype(W, /obj/item/stack/cable_coil))
- if(src.wired)
- user << "You have already inserted wire!"
- return
- var/obj/item/stack/cable_coil/coil = W
- if (coil.use(1))
- src.wired = 1
- user << "You insert the wire."
- else
- user << "You need one length of coil to wire it!"
- else
- return ..()
-
-/obj/item/robot_parts/head/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 << "You have already inserted the eyes!"
- return
- else if(F.crit_fail)
- user << "You can't use a broken flash!"
- return
- else
- if(!user.unEquip(W))
- return
- F.loc = src
- if(src.flash1)
- src.flash2 = F
- else
- src.flash1 = F
- user << "You insert the flash into the eye socket."
- else
- return ..()
diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm
index 66b881f09caa..8d0009c181da 100644
--- a/code/game/objects/items/stacks/medical.dm
+++ b/code/game/objects/items/stacks/medical.dm
@@ -30,19 +30,21 @@
return 1
var/obj/item/bodypart/affecting
- if(ishuman(M))
- var/mob/living/carbon/human/H = M
- affecting = H.get_bodypart(check_zone(user.zone_selected))
+ if(iscarbon(M))
+ var/mob/living/carbon/C = M
+ affecting = C.get_bodypart(check_zone(user.zone_selected))
if(!affecting) //Missing limb?
- user << "[H] doesn't have \a [parse_zone(user.zone_selected)]!"
+ user << "[C] doesn't have \a [parse_zone(user.zone_selected)]!"
return
- if(stop_bleeding)
- if(H.bleedsuppress)
- user << "[H]'s bleeding is already bandaged!"
- return
- else if(!H.bleed_rate)
- user << "[H] isn't bleeding!"
- return
+ if(ishuman(C))
+ var/mob/living/carbon/human/H = C
+ if(stop_bleeding)
+ if(H.bleedsuppress)
+ user << "[H]'s bleeding is already bandaged!"
+ return
+ else if(!H.bleed_rate)
+ user << "[H] isn't bleeding!"
+ return
if(isliving(M))
@@ -75,25 +77,24 @@
user.visible_message("[user] applies [src] on [t_himself].", "You apply [src] on yourself.")
- if(ishuman(M))
- var/mob/living/carbon/human/H = M
- affecting = H.get_bodypart(check_zone(user.zone_selected))
+ if(iscarbon(M))
+ var/mob/living/carbon/C = M
+ affecting = C.get_bodypart(check_zone(user.zone_selected))
if(!affecting) //Missing limb?
- user << "[H] doesn't have \a [parse_zone(user.zone_selected)]!"
+ user << "[C] doesn't have \a [parse_zone(user.zone_selected)]!"
return
- if(stop_bleeding)
- if(!H.bleedsuppress) //so you can't stack bleed suppression
- H.suppress_bloodloss(stop_bleeding)
- if(affecting.status == ORGAN_ORGANIC) //Limb must be organic to be healed - RR
- if(affecting.heal_damage(src.heal_brute, src.heal_burn, 0))
- H.update_damage_overlays(0)
-
- M.updatehealth()
+ if(ishuman(C))
+ var/mob/living/carbon/human/H = C
+ if(stop_bleeding)
+ if(!H.bleedsuppress) //so you can't stack bleed suppression
+ H.suppress_bloodloss(stop_bleeding)
+ if(affecting.status == BODYPART_ORGANIC) //Limb must be organic to be healed - RR
+ if(affecting.heal_damage(heal_brute, heal_burn))
+ C.update_damage_overlays()
else
user << "Medicine won't work on a robotic limb!"
else
- M.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
-
+ M.heal_bodypart_damage((src.heal_brute/2), (src.heal_burn/2))
use(1)
diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm
index 1fd3e766c627..a7f84608ffee 100644
--- a/code/game/objects/items/stacks/sheets/glass.dm
+++ b/code/game/objects/items/stacks/sheets/glass.dm
@@ -311,19 +311,16 @@
return
if(istype(A, /obj/item/weapon/storage))
return
-
+ var/hit_hand = ((user.active_hand_index % 2 == 0) ? "r_" : "l_") + "arm"
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(!H.gloves && !(PIERCEIMMUNE in H.dna.species.specflags)) // golems, etc
H << "[src] cuts into your hand!"
- var/organ = ((H.active_hand_index % 2 == 0) ? "r_" : "l_") + "arm"
- var/obj/item/bodypart/affecting = H.get_bodypart(organ)
- if(affecting && affecting.take_damage(force / 2))
- H.update_damage_overlays(0)
+ H.apply_damage(force*0.5, BRUTE, hit_hand)
else if(ismonkey(user))
var/mob/living/carbon/monkey/M = user
M << "[src] cuts into your hand!"
- M.adjustBruteLoss(force / 2)
+ M.apply_damage(force*0.5, BRUTE, hit_hand)
/obj/item/weapon/shard/attackby(obj/item/I, mob/user, params)
diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm
index 3763799c961e..5fdc8e8c197d 100644
--- a/code/game/objects/items/weapons/grenades/flashbang.dm
+++ b/code/game/objects/items/weapons/grenades/flashbang.dm
@@ -22,8 +22,6 @@
M.show_message("BANG", 2)
playsound(loc, 'sound/weapons/flashbang.ogg', 100, 1)
-//Checking for protection
- var/ear_safety = M.check_ear_prot()
var/distance = max(1,get_dist(src,T))
//Flash
@@ -34,24 +32,12 @@
M.Stun(15)
M.adjust_eye_damage(8)
- if(M.flash_eyes(affect_silicon = 1))
+ if(M.flash_act(affect_silicon = 1))
M.Stun(max(10/distance, 3))
M.Weaken(max(10/distance, 3))
//Bang
if((loc == M) || loc == M.loc)//Holding on person or being exactly where lies is significantly more dangerous and voids protection
- M.Stun(10)
- M.Weaken(10)
- if(!ear_safety)
- M << sound('sound/weapons/flash_ring.ogg',0,1,0,100)
- M.Stun(max(10/distance, 3))
- M.Weaken(max(10/distance, 3))
- M.setEarDamage(M.ear_damage + rand(0, 5), max(M.ear_deaf,15))
- if (M.ear_damage >= 15)
- M << "Your ears start to ring badly!"
- if(prob(M.ear_damage - 10 + 5))
- M << "You can't hear anything!"
- M.disabilities |= DEAF
- else
- if (M.ear_damage >= 5)
- M << "Your ears start to ring!"
+ M.soundbang_act(1, 10, rand(5, 10))
+ else
+ M.soundbang_act(1, max(10/distance, 3), rand(0, 5))
diff --git a/code/game/objects/items/weapons/grenades/plastic.dm b/code/game/objects/items/weapons/grenades/plastic.dm
index 4ec3541ce2f6..5d11b5bdac85 100644
--- a/code/game/objects/items/weapons/grenades/plastic.dm
+++ b/code/game/objects/items/weapons/grenades/plastic.dm
@@ -108,7 +108,7 @@
target = user
sleep(10)
prime()
- user.gib(no_brain = 1)
+ user.gib(1, 1, 1)
/obj/item/weapon/grenade/plastic/update_icon()
if(nadeassembly)
diff --git a/code/game/objects/items/weapons/grenades/spawnergrenade.dm b/code/game/objects/items/weapons/grenades/spawnergrenade.dm
index 604767533657..76536e7b21d5 100644
--- a/code/game/objects/items/weapons/grenades/spawnergrenade.dm
+++ b/code/game/objects/items/weapons/grenades/spawnergrenade.dm
@@ -15,7 +15,7 @@
var/turf/T = get_turf(src)
playsound(T, 'sound/effects/phasein.ogg', 100, 1)
for(var/mob/living/carbon/C in viewers(T, null))
- C.flash_eyes()
+ C.flash_act()
for(var/i=1, i<=deliveryamt, i++)
var/atom/movable/x = new spawner_type
diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm
index 8d76fcc492a4..810048f57821 100644
--- a/code/game/objects/items/weapons/handcuffs.dm
+++ b/code/game/objects/items/weapons/handcuffs.dm
@@ -30,12 +30,12 @@
return
if(!C.handcuffed)
- if(C.get_num_arms() >= 2)
+ if(C.get_num_arms() >= 2 || C.get_arm_ignore())
C.visible_message("[user] is trying to put [src.name] on [C]!", \
"[user] is trying to put [src.name] on [C]!")
playsound(loc, cuffsound, 30, 1, -2)
- if(do_mob(user, C, 30) && C.get_num_arms() >= 2)
+ if(do_mob(user, C, 30) && (C.get_num_arms() >= 2 || C.get_arm_ignore()))
apply_cuffs(C,user)
user << "You handcuff [C]."
if(istype(src, /obj/item/weapon/restraints/handcuffs/cable))
diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm
index 106d91fdd732..9f93c93eca32 100644
--- a/code/game/objects/items/weapons/melee/energy.dm
+++ b/code/game/objects/items/weapons/melee/energy.dm
@@ -81,7 +81,7 @@
/obj/item/weapon/melee/energy/attack_self(mob/living/carbon/user)
if(user.disabilities & CLUMSY && prob(50))
user << "You accidentally cut yourself with [src], like a doofus!"
- user.take_organ_damage(5,5)
+ user.take_bodypart_damage(5,5)
active = !active
if (active)
force = force_on
diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm
index e9ca6ece91cb..3f35613f4420 100644
--- a/code/game/objects/items/weapons/melee/misc.dm
+++ b/code/game/objects/items/weapons/melee/misc.dm
@@ -67,7 +67,7 @@
var/mob/living/carbon/human/H = user
H.apply_damage(2*force, BRUTE, "head")
else
- user.take_organ_damage(2*force)
+ user.take_bodypart_damage(2*force)
return
if(isrobot(target))
..()
@@ -124,7 +124,7 @@
if (B && !qdeleted(B))
H.internal_organs -= B
qdel(B)
- gibs(H.loc, H.viruses, H.dna)
+ new /obj/effect/gibspawner/generic(H.loc, H.viruses, H.dna)
return (BRUTELOSS)
/obj/item/weapon/melee/classic_baton/telescopic/attack_self(mob/user)
diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm
index 24708a7829d9..26513f300b5c 100644
--- a/code/game/objects/items/weapons/shields.dm
+++ b/code/game/objects/items/weapons/shields.dm
@@ -74,7 +74,7 @@
/obj/item/weapon/shield/energy/attack_self(mob/living/carbon/human/user)
if(user.disabilities & CLUMSY && prob(50))
user << "You beat yourself in the head with [src]."
- user.take_organ_damage(5)
+ user.take_bodypart_damage(5)
active = !active
icon_state = "eshield[active]"
diff --git a/code/game/objects/items/weapons/singularityhammer.dm b/code/game/objects/items/weapons/singularityhammer.dm
index 07802d94a9a4..e8ef7dc94028 100644
--- a/code/game/objects/items/weapons/singularityhammer.dm
+++ b/code/game/objects/items/weapons/singularityhammer.dm
@@ -57,7 +57,7 @@
charged = 0
if(istype(A, /mob/living/))
var/mob/living/Z = A
- Z.take_organ_damage(20,0)
+ Z.take_bodypart_damage(20,0)
playsound(user, 'sound/weapons/marauder.ogg', 50, 1)
var/turf/target = get_turf(A)
vortex(target,user)
diff --git a/code/game/objects/items/weapons/storage/book.dm b/code/game/objects/items/weapons/storage/book.dm
index f6ffe2afb1a0..ab3d92007eae 100644
--- a/code/game/objects/items/weapons/storage/book.dm
+++ b/code/game/objects/items/weapons/storage/book.dm
@@ -114,15 +114,27 @@ var/global/list/bibleitemstates = list("bible", "koran", "scrapbook", "bible", "
usr << browse(null, "window=editicon") // Close window
-/obj/item/weapon/storage/book/bible/proc/bless(mob/living/carbon/M)
- if(ishuman(M))
- var/mob/living/carbon/human/H = M
- var/heal_amt = 10
- for(var/obj/item/bodypart/affecting in H.bodyparts)
- if(affecting.status == ORGAN_ORGANIC) //No Bible can heal a robotic arm!
- if(affecting.heal_damage(heal_amt, heal_amt, 0))
- H.update_damage_overlays(0)
- return
+/obj/item/weapon/storage/book/bible/proc/bless(mob/living/carbon/human/H, mob/living/user)
+ for(var/X in H.bodyparts)
+ var/obj/item/bodypart/BP = X
+ if(BP.status == BODYPART_ROBOTIC)
+ user << "[src.deity_name] refuses to heal this metallic taint!"
+ return 0
+
+ var/heal_amt = 10
+ var/list/hurt_limbs = H.get_damaged_bodyparts(1, 1)
+
+ if(hurt_limbs.len)
+ for(var/X in hurt_limbs)
+ var/obj/item/bodypart/affecting = X
+ if(affecting.heal_damage(heal_amt, heal_amt))
+ H.update_damage_overlays()
+ H.visible_message("[user] heals [H] with the power of [deity_name]!")
+ H << "May the power of [deity_name] compel you to be healed!"
+ playsound(src.loc, "punch", 25, 1, -1)
+ return 1
+
+
/obj/item/weapon/storage/book/bible/attack(mob/living/M, mob/living/carbon/human/user)
@@ -137,51 +149,40 @@ var/global/list/bibleitemstates = list("bible", "koran", "scrapbook", "bible", "
return
if(!chaplain)
user << "The book sizzles in your hands."
- user.take_organ_damage(0,10)
+ user.take_bodypart_damage(0,10)
return
if (user.disabilities & CLUMSY && prob(50))
user << "The [src] slips out of your hand and hits your head."
- user.take_organ_damage(10)
+ user.take_bodypart_damage(10)
user.Paralyse(20)
return
- if (M.stat !=2)
- if(M.mind && (M.mind.assigned_role == "Chaplain"))
+ var/smack = 1
+
+ if (M.stat != DEAD)
+ if(chaplain && user == M)
user << "You can't heal yourself!"
return
- if ((istype(M, /mob/living/carbon/human) && prob(60)))
- bless(M)
- if(ishuman(M))
- var/mob/living/carbon/human/H = M
- var/message_halt = 0
- for(var/obj/item/bodypart/affecting in H.bodyparts)
- if(affecting.status == ORGAN_ORGANIC)
- if(message_halt == 0)
- M.visible_message("[user] heals [M] with the power of [src.deity_name]!")
- M << "May the power of [src.deity_name] compel you to be healed!"
- playsound(src.loc, "punch", 25, 1, -1)
- message_halt = 1
- else
- user << "[src.deity_name] refuses to heal this metallic taint!"
- return
+ if(ishuman(M) && prob(60) && bless(M, user))
+ smack = 0
+ else if(iscarbon(M))
+ var/mob/living/carbon/C = M
+ if(!istype(C.head, /obj/item/clothing/head/helmet))
+ C.adjustBrainLoss(10)
+ C << "You feel dumber."
-
-
- else
- if(ishuman(M) && !istype(M:head, /obj/item/clothing/head/helmet))
- M.adjustBrainLoss(10)
- M << "You feel dumber."
+ if(smack)
M.visible_message("[user] beats [M] over the head with [src]!", \
"[user] beats [M] over the head with [src]!")
playsound(src.loc, "punch", 25, 1, -1)
add_logs(user, M, "attacked", src)
- else if(M.stat == 2)
+ else
M.visible_message("[user] smacks [M]'s lifeless corpse with [src].")
playsound(src.loc, "punch", 25, 1, -1)
- return
+
/obj/item/weapon/storage/book/bible/afterattack(atom/A, mob/user, proximity)
if(!proximity)
diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm
index 9e5801e16670..537c4d37c781 100644
--- a/code/game/objects/items/weapons/tanks/tanks.dm
+++ b/code/game/objects/items/weapons/tanks/tanks.dm
@@ -114,7 +114,7 @@
H.hair_style = "Bald"
H.update_hair()
H.bleed_rate = 5
- gibs(H.loc, H.viruses, H.dna)
+ new /obj/effect/gibspawner/generic(H.loc, H.viruses, H.dna)
H.adjustBruteLoss(1000) //to make the body super-bloody
return (BRUTELOSS)
diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm
index 906af763df6e..a48395a2cab8 100644
--- a/code/game/objects/items/weapons/tools.dm
+++ b/code/game/objects/items/weapons/tools.dm
@@ -298,7 +298,7 @@
var/obj/item/bodypart/affecting = H.get_bodypart(check_zone(user.zone_selected))
- if(affecting && affecting.status == ORGAN_ROBOTIC && user.a_intent != "harm")
+ if(affecting && affecting.status == BODYPART_ROBOTIC && user.a_intent != "harm")
if(src.remove_fuel(1))
playsound(loc, 'sound/items/Welder.ogg', 50, 1)
user.visible_message("[user] starts to fix some of the dents on [H]'s [affecting.name].", "You start fixing some of the dents on [H]'s [affecting.name].")
@@ -347,7 +347,7 @@
reagents.remove_reagent("welding_fuel", amount)
check_fuel()
if(M)
- M.flash_eyes(light_intensity)
+ M.flash_act(light_intensity)
return TRUE
else
if(M)
diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm
index 67792738d2b0..e597a00abca8 100644
--- a/code/game/objects/items/weapons/twohanded.dm
+++ b/code/game/objects/items/weapons/twohanded.dm
@@ -256,7 +256,7 @@
/obj/item/weapon/twohanded/dualsaber/proc/impale(mob/living/user)
user << "You twirl around a bit before losing your balance and impaling yourself on \the [src]."
if (force_wielded)
- user.take_organ_damage(20,25)
+ user.take_bodypart_damage(20,25)
else
user.adjustStaminaLoss(25)
diff --git a/code/modules/admin/verbs/manipulate_organs.dm b/code/modules/admin/verbs/manipulate_organs.dm
index 82703edaa3e0..289d1b6cd7d6 100644
--- a/code/modules/admin/verbs/manipulate_organs.dm
+++ b/code/modules/admin/verbs/manipulate_organs.dm
@@ -26,7 +26,8 @@
organ.implant(C)
if("drop organ/implant", "remove organ/implant")
- for(var/obj/item/organ/I in C.internal_organs)
+ for(var/X in C.internal_organs)
+ var/obj/item/organ/I = X
organs["[I.name] ([I.type])"] = I
for(var/obj/item/weapon/implant/I in C)
diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm
index 1008453f85bb..a229b10f337c 100644
--- a/code/modules/admin/verbs/randomverbs.dm
+++ b/code/modules/admin/verbs/randomverbs.dm
@@ -441,7 +441,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/datum/round_event/ion_storm/ion = new(0, announce_ion_laws, input)
ion.start()
-
+
feedback_add_details("admin_verb","IONC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_rejuvenate(mob/living/M in mob_list)
@@ -595,7 +595,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
message_admins("[key_name_admin(usr)] has gibbed [key_name_admin(M)]")
if(istype(M, /mob/dead/observer))
- gibs(M.loc, M.viruses)
+ new /obj/effect/gibspawner/generic(M.loc, M.viruses)
return
if(confirm == "Yes")
M.gib()
@@ -612,7 +612,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
log_admin("[key_name(usr)] used gibself.")
message_admins("[key_name_admin(usr)] used gibself.")
feedback_add_details("admin_verb","GIBS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
- mob.gib(1, 1)
+ mob.gib(1, 1, 1)
/client/proc/cmd_admin_check_contents(mob/living/M in mob_list)
set category = "Special Verbs"
@@ -1152,4 +1152,4 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits
for(var/datum/station_goal/S in ticker.mode.station_goals)
dat += "[S.name] - Announce | Remove
"
dat += "
Add New Goal"
- usr << browse(dat, "window=goals;size=400x400")
\ No newline at end of file
+ usr << browse(dat, "window=goals;size=400x400")
diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm
index 2ca234340538..aece047550c8 100644
--- a/code/modules/assembly/flash.dm
+++ b/code/modules/assembly/flash.dm
@@ -85,7 +85,7 @@
if(user && targeted)
if(M.weakeyes)
M.Weaken(3) //quick weaken bypasses eye protection but has no eye flash
- if(M.flash_eyes(1, 1))
+ if(M.flash_act(1, 1))
M.confused += power
terrible_conversion_proc(M, user)
M.Stun(1)
@@ -100,7 +100,7 @@
user << "You fail to blind [M] with the flash!"
M << "[user] fails to blind you with the flash!"
else
- if(M.flash_eyes())
+ if(M.flash_act())
M.confused += power
/obj/item/device/assembly/flash/attack(mob/living/M, mob/user)
@@ -117,7 +117,7 @@
update_icon(1)
M.Weaken(6)
R.confused += 5
- R.flash_eyes(affect_silicon = 1)
+ R.flash_act(affect_silicon = 1)
user.visible_message("[user] overloads [R]'s sensors with the flash!", "You overload [R]'s sensors with the flash!")
return 1
diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm
index 30adb230404c..31ecea937bd4 100644
--- a/code/modules/assembly/mousetrap.dm
+++ b/code/modules/assembly/mousetrap.dm
@@ -60,8 +60,7 @@
H.Stun(3)
if(affecting)
if(affecting.take_damage(1, 0))
- H.update_damage_overlays(0)
- H.updatehealth()
+ H.update_damage_overlays()
else if(ismouse(target))
var/mob/living/simple_animal/mouse/M = target
visible_message("SPLAT!")
diff --git a/code/modules/client/verbs/suicide.dm b/code/modules/client/verbs/suicide.dm
index cb6120efe3dd..659fe3f3c8dd 100644
--- a/code/modules/client/verbs/suicide.dm
+++ b/code/modules/client/verbs/suicide.dm
@@ -53,7 +53,7 @@
adjustOxyLoss(max(200 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
death(0)
-/mob/living/carbon/brain/verb/suicide()
+/mob/living/brain/verb/suicide()
set hidden = 1
if(!canSuicide())
return
diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm
index 1c5375434f21..19bf143a1cdd 100644
--- a/code/modules/clothing/glasses/glasses.dm
+++ b/code/modules/clothing/glasses/glasses.dm
@@ -9,7 +9,7 @@
if(!(H.disabilities & BLIND))
if(H.glasses == src)
H << "The [src] overloads and blinds you!"
- H.flash_eyes(visual = 1)
+ H.flash_act(visual = 1)
H.blind_eyes(3)
H.blur_eyes(5)
H.adjust_eye_damage(5)
diff --git a/code/modules/crafting/recipes.dm b/code/modules/crafting/recipes.dm
index 0bd4fff922ff..5dcbeb7c63b6 100644
--- a/code/modules/crafting/recipes.dm
+++ b/code/modules/crafting/recipes.dm
@@ -94,17 +94,17 @@
/datum/crafting_recipe/ed209
name = "ED209"
result = /mob/living/simple_animal/bot/ed209
- reqs = list(/obj/item/robot_parts/robot_suit = 1,
+ reqs = list(/obj/item/robot_suit = 1,
/obj/item/clothing/head/helmet = 1,
/obj/item/clothing/suit/armor/vest = 1,
- /obj/item/robot_parts/l_leg = 1,
- /obj/item/robot_parts/r_leg = 1,
+ /obj/item/bodypart/l_leg/robot = 1,
+ /obj/item/bodypart/r_leg/robot = 1,
/obj/item/stack/sheet/metal = 5,
/obj/item/stack/cable_coil = 5,
/obj/item/weapon/gun/energy/gun/advtaser = 1,
/obj/item/weapon/stock_parts/cell = 1,
/obj/item/device/assembly/prox_sensor = 1,
- /obj/item/robot_parts/r_arm = 1)
+ /obj/item/bodypart/r_arm/robot = 1)
tools = list(/obj/item/weapon/weldingtool, /obj/item/weapon/screwdriver)
time = 60
category = CAT_ROBOT
@@ -116,7 +116,7 @@
/obj/item/clothing/head/helmet/sec = 1,
/obj/item/weapon/melee/baton = 1,
/obj/item/device/assembly/prox_sensor = 1,
- /obj/item/robot_parts/r_arm = 1)
+ /obj/item/bodypart/r_arm/robot = 1)
tools = list(/obj/item/weapon/weldingtool)
time = 60
category = CAT_ROBOT
@@ -126,7 +126,7 @@
result = /mob/living/simple_animal/bot/cleanbot
reqs = list(/obj/item/weapon/reagent_containers/glass/bucket = 1,
/obj/item/device/assembly/prox_sensor = 1,
- /obj/item/robot_parts/r_arm = 1)
+ /obj/item/bodypart/r_arm/robot = 1)
time = 40
category = CAT_ROBOT
@@ -136,7 +136,7 @@
reqs = list(/obj/item/weapon/storage/toolbox/mechanical = 1,
/obj/item/stack/tile/plasteel = 1,
/obj/item/device/assembly/prox_sensor = 1,
- /obj/item/robot_parts/r_arm = 1)
+ /obj/item/bodypart/r_arm/robot = 1)
time = 40
category = CAT_ROBOT
@@ -146,7 +146,7 @@
reqs = list(/obj/item/device/healthanalyzer = 1,
/obj/item/weapon/storage/firstaid = 1,
/obj/item/device/assembly/prox_sensor = 1,
- /obj/item/robot_parts/r_arm = 1)
+ /obj/item/bodypart/r_arm/robot = 1)
time = 40
category = CAT_ROBOT
diff --git a/code/modules/events/anomaly_bluespace.dm b/code/modules/events/anomaly_bluespace.dm
index 19b3ac4abfa5..a2b2dbf31bc2 100644
--- a/code/modules/events/anomaly_bluespace.dm
+++ b/code/modules/events/anomaly_bluespace.dm
@@ -44,7 +44,7 @@
var/list/flashers = list()
for(var/mob/living/carbon/C in viewers(TO, null))
- if(C.flash_eyes())
+ if(C.flash_act())
flashers += C
var/y_distance = TO.y - FROM.y
diff --git a/code/modules/hydroponics/grown/nettle.dm b/code/modules/hydroponics/grown/nettle.dm
index 0dd97c68a360..be78c4ef8b25 100644
--- a/code/modules/hydroponics/grown/nettle.dm
+++ b/code/modules/hydroponics/grown/nettle.dm
@@ -51,16 +51,13 @@
if(!iscarbon(user))
return 0
var/mob/living/carbon/C = user
- if(ishuman(user))
- var/mob/living/carbon/human/H = C
- if(H.gloves)
- return 0
- var/organ = (H.held_index_to_dir(H.active_hand_index) == "l" ? "l_":"r_") + "arm"
- var/obj/item/bodypart/affecting = H.get_bodypart(organ)
- if(affecting && affecting.take_damage(0, force))
- H.update_damage_overlays(0)
- else
- C.take_organ_damage(0,force)
+ if(C.gloves)
+ return 0
+ var/hit_zone = (C.held_index_to_dir(C.active_hand_index) == "l" ? "l_":"r_") + "arm"
+ var/obj/item/bodypart/affecting = C.get_bodypart(hit_zone)
+ if(affecting)
+ if(affecting.take_damage(0, force))
+ C.update_damage_overlays()
C << "The nettle burns your bare hand!"
return 1
diff --git a/code/modules/mining/equipment.dm b/code/modules/mining/equipment.dm
index 1b8e9a566125..adcd2b4762c4 100644
--- a/code/modules/mining/equipment.dm
+++ b/code/modules/mining/equipment.dm
@@ -507,7 +507,7 @@
range = 6
var/obj/item/weapon/twohanded/required/mining_hammer/hammer_synced = null
-/obj/item/projectile/destabilizer/on_hit(atom/target, blocked = 0, hit_zone)
+/obj/item/projectile/destabilizer/on_hit(atom/target, blocked = 0)
if(hammer_synced)
if(hammer_synced.mark == target)
return ..()
diff --git a/code/modules/mob/interactive.dm b/code/modules/mob/interactive.dm
index ab0aa56e1c02..7be2862b0fc4 100644
--- a/code/modules/mob/interactive.dm
+++ b/code/modules/mob/interactive.dm
@@ -137,13 +137,14 @@
retal = 1
retal_target = user
-/mob/living/carbon/human/interactive/bullet_act(var/obj/item/projectile/P)
+/mob/living/carbon/human/interactive/bullet_act(obj/item/projectile/P, def_zone)
var/potentialAssault = locate(/mob/living) in view(2,P.starting)
if(potentialAssault)
retal = 1
retal_target = potentialAssault
..()
+
/client/proc/resetSNPC(var/mob/A in SSnpc.botPool_l)
set name = "Reset SNPC"
set desc = "Reset the SNPC"
@@ -296,9 +297,9 @@
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
if(prob((FUZZY_CHANCE_LOW+FUZZY_CHANCE_HIGH)/4))
- BP.change_bodypart_status(ORGAN_ROBOTIC)
+ BP.change_bodypart_status(BODYPART_ROBOTIC)
update_icons()
- update_damage_overlays(0)
+ update_damage_overlays()
functions = list("nearbyscan","combat","shitcurity","chatter") // stop customize adding multiple copies of a function
//job specific favours
switch(myjob.title)
@@ -422,10 +423,6 @@
if(C)
retalTarget(C)
-/mob/living/carbon/human/interactive/bullet_act(obj/item/projectile/P, def_zone)
- ..(P,def_zone)
- retalTarget(P.firer)
-
/mob/living/carbon/human/interactive/attack_hand(mob/living/carbon/human/M)
..(M)
retalTarget(M)
diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm
similarity index 92%
rename from code/modules/mob/living/carbon/brain/MMI.dm
rename to code/modules/mob/living/brain/MMI.dm
index 0e6e1ee5b031..4979cbd6c7d5 100644
--- a/code/modules/mob/living/carbon/brain/MMI.dm
+++ b/code/modules/mob/living/brain/MMI.dm
@@ -1,198 +1,197 @@
-//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
-
-/obj/item/device/mmi
- name = "Man-Machine Interface"
- desc = "The Warrior's bland acronym, MMI, obscures the true horror of this monstrosity, that nevertheless has become standard-issue on Nanotrasen stations."
- icon = 'icons/obj/assemblies.dmi'
- icon_state = "mmi_empty"
- w_class = 3
- origin_tech = "biotech=2;programming=3;engineering=2"
- var/braintype = "Cyborg"
- var/obj/item/device/radio/radio = null //Let's give it a radio.
- var/hacked = 0 //Whether or not this is a Syndicate MMI
- var/mob/living/carbon/brain/brainmob = null //The current occupant.
- var/mob/living/silicon/robot = null //Appears unused.
- var/obj/mecha = null //This does not appear to be used outside of reference in mecha.dm.
- var/obj/item/organ/brain/brain = null //The actual brain
- var/clockwork = FALSE //If this is a soul vessel
-
-/obj/item/device/mmi/update_icon()
- if(brain)
- if(istype(brain,/obj/item/organ/brain/alien))
- if(brainmob && brainmob.stat == DEAD)
- icon_state = "mmi_alien_dead"
- else
- icon_state = "mmi_alien"
- braintype = "Xenoborg" //HISS....Beep.
- else
- if(brainmob && brainmob.stat == DEAD)
- icon_state = "mmi_dead"
- else
- icon_state = "mmi_full"
- braintype = "Cyborg"
- else
- icon_state = "mmi_empty"
-
-/obj/item/device/mmi/New()
- ..()
- radio = new(src) //Spawns a radio inside the MMI.
- radio.broadcasting = 0 //researching radio mmis turned the robofabs into radios because this didnt start as 0.
-
-
-
-/obj/item/device/mmi/attackby(obj/item/O, mob/user, params)
- user.changeNext_move(CLICK_CD_MELEE)
- if(istype(O,/obj/item/organ/brain)) //Time to stick a brain in it --NEO
- var/obj/item/organ/brain/newbrain = O
- if(brain)
- user << "There's already a brain in the MMI!"
- return
- if(!newbrain.brainmob)
- user << "You aren't sure where this brain came from, but you're pretty sure it's a useless brain!"
- return
-
- if(!user.unEquip(O))
- return
- var/mob/living/carbon/brain/B = newbrain.brainmob
- if(!B.key)
- B.notify_ghost_cloning("Someone has put your brain in a MMI!", source = src)
- visible_message("[user] sticks \a [newbrain] into \the [src].")
-
- brainmob = newbrain.brainmob
- newbrain.brainmob = null
- brainmob.loc = src
- brainmob.container = src
- if(!newbrain.damaged_brain) // the brain organ hasn't been beaten to death.
- brainmob.stat = CONSCIOUS //we manually revive the brain mob
- dead_mob_list -= brainmob
- living_mob_list += brainmob
-
- brainmob.reset_perspective()
- if(clockwork)
- add_servant_of_ratvar(brainmob, TRUE)
- newbrain.loc = src //P-put your brain in it
- brain = newbrain
-
- name = "Man-Machine Interface: [brainmob.real_name]"
- update_icon()
-
- feedback_inc("cyborg_mmis_filled",1)
-
- return
-
- else if(brainmob)
- O.attack(brainmob, user) //Oh noooeeeee
- return
- ..()
-
-/obj/item/device/mmi/attack_self(mob/user)
- if(!brain)
- radio.on = !radio.on
- user << "You toggle the MMI's radio system [radio.on==1 ? "on" : "off"]."
- else
- user << "You unlock and upend the MMI, spilling the brain onto the floor."
-
- brainmob.container = null //Reset brainmob mmi var.
- brainmob.loc = brain //Throw mob into brain.
- brainmob.stat = DEAD
- brainmob.emp_damage = 0
- brainmob.reset_perspective() //so the brainmob follows the brain organ instead of the mmi. And to update our vision
- living_mob_list -= brainmob //Get outta here
- dead_mob_list += brainmob
- brain.brainmob = brainmob //Set the brain to use the brainmob
- brainmob = null //Set mmi brainmob var to null
-
- user.put_in_hands(brain) //puts brain in the user's hand or otherwise drops it on the user's turf
- brain = null //No more brain in here
-
- update_icon()
- name = "Man-Machine Interface"
-
-/obj/item/device/mmi/proc/transfer_identity(mob/living/L) //Same deal as the regular brain proc. Used for human-->robot people.
- if(!brainmob)
- brainmob = new(src)
- brainmob.name = L.real_name
- brainmob.real_name = L.real_name
- if(L.has_dna())
- var/mob/living/carbon/C = L
- if(!brainmob.dna)
- brainmob.dna = new /datum/dna(brainmob)
- C.dna.copy_dna(brainmob.dna)
- brainmob.container = src
-
- if(ishuman(L))
- var/mob/living/carbon/human/H = L
- var/obj/item/organ/brain/newbrain = H.getorgan(/obj/item/organ/brain)
- newbrain.loc = src
- brain = newbrain
- else if(!brain)
- brain = new(src)
- brain.name = "[L.real_name]'s brain"
-
- name = "Man-Machine Interface: [brainmob.real_name]"
- update_icon()
- return
-
-
-/obj/item/device/mmi/verb/Toggle_Listening()
- set name = "Toggle Listening"
- set desc = "Toggle listening channel on or off."
- set category = "MMI"
- set src = usr.loc
- set popup_menu = 0
-
- if(brainmob.stat)
- brainmob << "Can't do that while incapacitated or dead!"
- if(!radio.on)
- brainmob << "Your radio is disabled!"
- return
-
- radio.listening = radio.listening==1 ? 0 : 1
- brainmob << "Radio is [radio.listening==1 ? "now" : "no longer"] receiving broadcast."
-
-/obj/item/device/mmi/emp_act(severity)
- if(!brainmob)
- return
- else
- switch(severity)
- if(1)
- brainmob.emp_damage = min(brainmob.emp_damage + rand(20,30), 30)
- if(2)
- brainmob.emp_damage = min(brainmob.emp_damage + rand(10,20), 30)
- if(3)
- brainmob.emp_damage = min(brainmob.emp_damage + rand(0,10), 30)
- brainmob.emote("alarm")
- ..()
-
-/obj/item/device/mmi/Destroy()
- if(isrobot(loc))
- var/mob/living/silicon/robot/borg = loc
- borg.mmi = null
- if(brainmob)
- qdel(brainmob)
- brainmob = null
- return ..()
-
-/obj/item/device/mmi/examine(mob/user)
- ..()
- if(brainmob)
- var/mob/living/carbon/brain/B = brainmob
- if(!B.key || !B.mind || B.stat == DEAD)
- user << "The MMI indicates the brain is completely unresponsive."
-
- else if(!B.client)
- user << "The MMI indicates the brain is currently inactive; it might change."
-
- else
- user << "The MMI indicates the brain is active."
-
-
-/obj/item/device/mmi/syndie
- name = "Syndicate Man-Machine Interface"
- desc = "Syndicate's own brand of MMI. It enforces laws designed to help Syndicate agents achieve their goals upon cyborgs created with it, but doesn't fit in Nanotrasen AI cores."
- origin_tech = "biotech=4;programming=4;syndicate=2"
- hacked = 1
-
-/obj/item/device/mmi/syndie/New()
- ..()
- radio.on = 0
+//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
+
+/obj/item/device/mmi
+ name = "Man-Machine Interface"
+ desc = "The Warrior's bland acronym, MMI, obscures the true horror of this monstrosity, that nevertheless has become standard-issue on Nanotrasen stations."
+ icon = 'icons/obj/assemblies.dmi'
+ icon_state = "mmi_empty"
+ w_class = 3
+ origin_tech = "biotech=2;programming=3;engineering=2"
+ var/braintype = "Cyborg"
+ var/obj/item/device/radio/radio = null //Let's give it a radio.
+ var/hacked = 0 //Whether or not this is a Syndicate MMI
+ var/mob/living/brain/brainmob = null //The current occupant.
+ var/mob/living/silicon/robot = null //Appears unused.
+ var/obj/mecha = null //This does not appear to be used outside of reference in mecha.dm.
+ var/obj/item/organ/brain/brain = null //The actual brain
+ var/clockwork = FALSE //If this is a soul vessel
+
+/obj/item/device/mmi/update_icon()
+ if(brain)
+ if(istype(brain,/obj/item/organ/brain/alien))
+ if(brainmob && brainmob.stat == DEAD)
+ icon_state = "mmi_alien_dead"
+ else
+ icon_state = "mmi_alien"
+ braintype = "Xenoborg" //HISS....Beep.
+ else
+ if(brainmob && brainmob.stat == DEAD)
+ icon_state = "mmi_dead"
+ else
+ icon_state = "mmi_full"
+ braintype = "Cyborg"
+ else
+ icon_state = "mmi_empty"
+
+/obj/item/device/mmi/New()
+ ..()
+ radio = new(src) //Spawns a radio inside the MMI.
+ radio.broadcasting = 0 //researching radio mmis turned the robofabs into radios because this didnt start as 0.
+
+
+
+/obj/item/device/mmi/attackby(obj/item/O, mob/user, params)
+ user.changeNext_move(CLICK_CD_MELEE)
+ if(istype(O,/obj/item/organ/brain)) //Time to stick a brain in it --NEO
+ var/obj/item/organ/brain/newbrain = O
+ if(brain)
+ user << "There's already a brain in the MMI!"
+ return
+ if(!newbrain.brainmob)
+ user << "You aren't sure where this brain came from, but you're pretty sure it's a useless brain!"
+ return
+
+ if(!user.unEquip(O))
+ return
+ var/mob/living/brain/B = newbrain.brainmob
+ if(!B.key)
+ B.notify_ghost_cloning("Someone has put your brain in a MMI!", source = src)
+ visible_message("[user] sticks \a [newbrain] into \the [src].")
+
+ brainmob = newbrain.brainmob
+ newbrain.brainmob = null
+ brainmob.loc = src
+ brainmob.container = src
+ if(!newbrain.damaged_brain) // the brain organ hasn't been beaten to death.
+ brainmob.stat = CONSCIOUS //we manually revive the brain mob
+ dead_mob_list -= brainmob
+ living_mob_list += brainmob
+
+ brainmob.reset_perspective()
+ if(clockwork)
+ add_servant_of_ratvar(brainmob, TRUE)
+ newbrain.loc = src //P-put your brain in it
+ brain = newbrain
+
+ name = "Man-Machine Interface: [brainmob.real_name]"
+ update_icon()
+
+ feedback_inc("cyborg_mmis_filled",1)
+
+ else if(brainmob)
+ O.attack(brainmob, user) //Oh noooeeeee
+ else
+ return ..()
+
+
+/obj/item/device/mmi/attack_self(mob/user)
+ if(!brain)
+ radio.on = !radio.on
+ user << "You toggle the MMI's radio system [radio.on==1 ? "on" : "off"]."
+ else
+ user << "You unlock and upend the MMI, spilling the brain onto the floor."
+
+ brainmob.container = null //Reset brainmob mmi var.
+ brainmob.loc = brain //Throw mob into brain.
+ brainmob.stat = DEAD
+ brainmob.emp_damage = 0
+ brainmob.reset_perspective() //so the brainmob follows the brain organ instead of the mmi. And to update our vision
+ living_mob_list -= brainmob //Get outta here
+ dead_mob_list += brainmob
+ brain.brainmob = brainmob //Set the brain to use the brainmob
+ brainmob = null //Set mmi brainmob var to null
+
+ user.put_in_hands(brain) //puts brain in the user's hand or otherwise drops it on the user's turf
+ brain = null //No more brain in here
+
+ update_icon()
+ name = "Man-Machine Interface"
+
+/obj/item/device/mmi/proc/transfer_identity(mob/living/L) //Same deal as the regular brain proc. Used for human-->robot people.
+ if(!brainmob)
+ brainmob = new(src)
+ brainmob.name = L.real_name
+ brainmob.real_name = L.real_name
+ if(L.has_dna())
+ var/mob/living/carbon/C = L
+ if(!brainmob.stored_dna)
+ brainmob.stored_dna = new /datum/dna/stored(brainmob)
+ C.dna.copy_dna(brainmob.stored_dna)
+ brainmob.container = src
+
+ if(ishuman(L))
+ var/mob/living/carbon/human/H = L
+ var/obj/item/organ/brain/newbrain = H.getorgan(/obj/item/organ/brain)
+ newbrain.loc = src
+ brain = newbrain
+ else if(!brain)
+ brain = new(src)
+ brain.name = "[L.real_name]'s brain"
+
+ name = "Man-Machine Interface: [brainmob.real_name]"
+ update_icon()
+ return
+
+
+/obj/item/device/mmi/verb/Toggle_Listening()
+ set name = "Toggle Listening"
+ set desc = "Toggle listening channel on or off."
+ set category = "MMI"
+ set src = usr.loc
+ set popup_menu = 0
+
+ if(brainmob.stat)
+ brainmob << "Can't do that while incapacitated or dead!"
+ if(!radio.on)
+ brainmob << "Your radio is disabled!"
+ return
+
+ radio.listening = radio.listening==1 ? 0 : 1
+ brainmob << "Radio is [radio.listening==1 ? "now" : "no longer"] receiving broadcast."
+
+/obj/item/device/mmi/emp_act(severity)
+ if(!brainmob)
+ return
+ else
+ switch(severity)
+ if(1)
+ brainmob.emp_damage = min(brainmob.emp_damage + rand(20,30), 30)
+ if(2)
+ brainmob.emp_damage = min(brainmob.emp_damage + rand(10,20), 30)
+ if(3)
+ brainmob.emp_damage = min(brainmob.emp_damage + rand(0,10), 30)
+ brainmob.emote("alarm")
+ ..()
+
+/obj/item/device/mmi/Destroy()
+ if(isrobot(loc))
+ var/mob/living/silicon/robot/borg = loc
+ borg.mmi = null
+ if(brainmob)
+ qdel(brainmob)
+ brainmob = null
+ return ..()
+
+/obj/item/device/mmi/examine(mob/user)
+ ..()
+ if(brainmob)
+ var/mob/living/brain/B = brainmob
+ if(!B.key || !B.mind || B.stat == DEAD)
+ user << "The MMI indicates the brain is completely unresponsive."
+
+ else if(!B.client)
+ user << "The MMI indicates the brain is currently inactive; it might change."
+
+ else
+ user << "The MMI indicates the brain is active."
+
+
+/obj/item/device/mmi/syndie
+ name = "Syndicate Man-Machine Interface"
+ desc = "Syndicate's own brand of MMI. It enforces laws designed to help Syndicate agents achieve their goals upon cyborgs created with it, but doesn't fit in Nanotrasen AI cores."
+ origin_tech = "biotech=4;programming=4;syndicate=2"
+ hacked = 1
+
+/obj/item/device/mmi/syndie/New()
+ ..()
+ radio.on = 0
diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/brain/brain.dm
similarity index 50%
rename from code/modules/mob/living/carbon/brain/brain.dm
rename to code/modules/mob/living/brain/brain.dm
index a089a58bd776..dfdf30fb3c53 100644
--- a/code/modules/mob/living/carbon/brain/brain.dm
+++ b/code/modules/mob/living/brain/brain.dm
@@ -1,63 +1,67 @@
-//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
-
-/mob/living/carbon/brain
- languages_spoken = HUMAN
- languages_understood = HUMAN
- var/obj/item/device/mmi/container = null
- var/timeofhostdeath = 0
- var/emp_damage = 0//Handles a type of MMI damage
- has_limbs = 0
- stat = DEAD //we start dead by default
- see_invisible = SEE_INVISIBLE_MINIMUM
-
-/mob/living/carbon/brain/New(loc)
- ..()
- if(isturf(loc)) //not spawned in an MMI or brain organ (most likely adminspawned)
- var/obj/item/organ/brain/OB = new(loc) //we create a new brain organ for it.
- src.loc = OB
- OB.brainmob = src
-
-
-/mob/living/carbon/brain/Destroy()
- if(key) //If there is a mob connected to this thing. Have to check key twice to avoid false death reporting.
- if(stat!=DEAD) //If not dead.
- death(1) //Brains can die again. AND THEY SHOULD AHA HA HA HA HA HA
- ghostize() //Ghostize checks for key so nothing else is necessary.
- container = null
- return ..()
-
-/mob/living/carbon/brain/update_canmove()
- if(in_contents_of(/obj/mecha))
- canmove = 1
- else
- canmove = 0
- return canmove
-
-/mob/living/carbon/brain/toggle_throw_mode()
- return
-
-/mob/living/carbon/brain/ex_act() //you cant blow up brainmobs because it makes transfer_to() freak out when borgs blow up.
- return
-
-/mob/living/carbon/brain/blob_act(obj/effect/blob/B)
- return
-
-/mob/living/carbon/brain/UnarmedAttack(atom/A)//Stops runtimes due to attack_animal being the default
- return
-
-/mob/living/carbon/brain/check_ear_prot()
- return 1
-
-/mob/living/carbon/brain/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
- return // no eyes, no flashing
-
-/mob/living/carbon/brain/update_damage_hud()
- return //no red circles for brain
-
-/mob/living/carbon/brain/can_be_revived()
- . = 1
- if(!container || health <= HEALTH_THRESHOLD_DEAD)
- return 0
-
-/mob/living/carbon/brain/update_sight()
- return
+//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
+
+/mob/living/brain
+ languages_spoken = HUMAN
+ languages_understood = HUMAN
+ var/obj/item/device/mmi/container = null
+ var/timeofhostdeath = 0
+ var/emp_damage = 0//Handles a type of MMI damage
+ var/datum/dna/stored/stored_dna // dna var for brain. Used to store dna, brain dna is not considered like actual dna, brain.has_dna() returns FALSE.
+ stat = DEAD //we start dead by default
+ see_invisible = SEE_INVISIBLE_MINIMUM
+
+/mob/living/brain/New(loc)
+ ..()
+ create_dna(src)
+ stored_dna.initialize_dna(random_blood_type())
+ if(isturf(loc)) //not spawned in an MMI or brain organ (most likely adminspawned)
+ var/obj/item/organ/brain/OB = new(loc) //we create a new brain organ for it.
+ src.loc = OB
+ OB.brainmob = src
+
+
+/mob/living/brain/proc/create_dna()
+ stored_dna = new /datum/dna/stored(src)
+ if(!stored_dna.species)
+ var/rando_race = pick(config.roundstart_races)
+ stored_dna.species = new rando_race()
+
+/mob/living/brain/Destroy()
+ if(key) //If there is a mob connected to this thing. Have to check key twice to avoid false death reporting.
+ if(stat!=DEAD) //If not dead.
+ death(1) //Brains can die again. AND THEY SHOULD AHA HA HA HA HA HA
+ ghostize() //Ghostize checks for key so nothing else is necessary.
+ container = null
+ return ..()
+
+/mob/living/brain/update_canmove()
+ if(in_contents_of(/obj/mecha))
+ canmove = 1
+ else
+ canmove = 0
+ return canmove
+
+/mob/living/brain/ex_act() //you cant blow up brainmobs because it makes transfer_to() freak out when borgs blow up.
+ return
+
+/mob/living/brain/blob_act(obj/effect/blob/B)
+ return
+
+/mob/living/brain/get_eye_protection()//no eyes
+ return 2
+
+/mob/living/brain/get_ear_protection()//no ears
+ return 2
+
+/mob/living/brain/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
+ return // no eyes, no flashing
+
+/mob/living/brain/can_be_revived()
+ . = 1
+ if(!container || health <= HEALTH_THRESHOLD_DEAD)
+ return 0
+
+/mob/living/brain/fully_replace_character_name(oldname,newname)
+ ..()
+ if(stored_dna)
+ stored_dna.real_name = real_name
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm
similarity index 65%
rename from code/modules/mob/living/carbon/brain/brain_item.dm
rename to code/modules/mob/living/brain/brain_item.dm
index e5e7d511fc0e..4bccb03c2d80 100644
--- a/code/modules/mob/living/carbon/brain/brain_item.dm
+++ b/code/modules/mob/living/brain/brain_item.dm
@@ -1,127 +1,122 @@
-/obj/item/organ/brain
- name = "brain"
- desc = "A piece of juicy meat found in a person's head."
- icon_state = "brain"
- throw_speed = 3
- throw_range = 5
- layer = ABOVE_MOB_LAYER
- zone = "head"
- slot = "brain"
- vital = 1
- origin_tech = "biotech=5"
- attack_verb = list("attacked", "slapped", "whacked")
- var/mob/living/carbon/brain/brainmob = null
- var/damaged_brain = 0 //whether the brain organ is damaged.
-
-/obj/item/organ/brain/Insert(mob/living/carbon/M, special = 0)
- ..()
- name = "brain"
- if(brainmob)
- if(M.key)
- M.ghostize()
-
- if(brainmob.mind)
- brainmob.mind.transfer_to(M)
- else
- M.key = brainmob.key
-
- qdel(brainmob)
-
- //Update the body's icon so it doesnt appear debrained anymore
- if(ishuman(M))
- var/mob/living/carbon/human/H = M
- H.update_hair(0)
-
-/obj/item/organ/brain/Remove(mob/living/carbon/M, special = 0)
- ..()
- if(!special)
- transfer_identity(M)
- if(ishuman(M))
- var/mob/living/carbon/human/H = M
- H.update_hair(0)
-
-/obj/item/organ/brain/prepare_eat()
- return // Too important to eat.
-
-/obj/item/organ/brain/proc/transfer_identity(mob/living/L)
- name = "[L.name]'s brain"
- brainmob = new(src)
- brainmob.name = L.real_name
- brainmob.real_name = L.real_name
- brainmob.timeofhostdeath = L.timeofdeath
- if(L.has_dna())
- var/mob/living/carbon/C = L
- if(!brainmob.dna)
- brainmob.dna = new /datum/dna(brainmob)
- C.dna.copy_dna(brainmob.dna)
- if(L.mind && L.mind.current && (L.mind.current.stat == DEAD))
- L.mind.transfer_to(brainmob)
- brainmob << "You feel slightly disoriented. That's normal when you're just a brain."
-
-/obj/item/organ/brain/attackby(obj/item/O, mob/user, params)
- user.changeNext_move(CLICK_CD_MELEE)
- if(brainmob)
- O.attack(brainmob, user) //Oh noooeeeee
-
-/obj/item/organ/brain/examine(mob/user)
- ..()
-
- if(brainmob)
- if(brainmob.client)
- if(brainmob.health <= HEALTH_THRESHOLD_DEAD)
- user << "It's lifeless and severely damaged."
- else
- user << "You can feel the small spark of life still left in this one."
- else
- user << "This one seems particularly lifeless. Perhaps it will regain some of its luster later."
- else
- user << "This one is completely devoid of life."
-
-/obj/item/organ/brain/attack(mob/living/carbon/M, mob/user)
- if(!istype(M))
- return ..()
-
- add_fingerprint(user)
-
- if(user.zone_selected != "head")
- return ..()
-
- var/mob/living/carbon/human/H = M
- if(istype(H) && ((H.head && H.head.flags_cover & HEADCOVERSEYES) || (H.wear_mask && H.wear_mask.flags_cover & MASKCOVERSEYES) || (H.glasses && H.glasses.flags & GLASSESCOVERSEYES)))
- user << "You're going to need to remove their head cover first!"
- return
-
-//since these people will be dead M != usr
-
- if(!M.getorgan(/obj/item/organ/brain))
- if(istype(H) && !H.get_bodypart("head"))
- return
- user.drop_item()
- var/msg = "[M] has [src] inserted into \his head by [user]."
- if(M == user)
- msg = "[user] inserts [src] into \his head!"
-
- M.visible_message("[msg]",
- "[msg]")
-
- if(M != user)
- M << "[user] inserts [src] into your head."
- user << "You insert [src] into [M]'s head."
- else
- user << "You insert [src] into your head." //LOL
-
- Insert(M)
- else
- ..()
-
-/obj/item/organ/brain/Destroy() //copypasted from MMIs.
- if(brainmob)
- qdel(brainmob)
- brainmob = null
- return ..()
-
-/obj/item/organ/brain/alien
- name = "alien brain"
- desc = "We barely understand the brains of terrestial animals. Who knows what we may find in the brain of such an advanced species?"
- icon_state = "brain-x"
- origin_tech = "biotech=6"
+/obj/item/organ/brain
+ name = "brain"
+ desc = "A piece of juicy meat found in a person's head."
+ icon_state = "brain"
+ throw_speed = 3
+ throw_range = 5
+ layer = ABOVE_MOB_LAYER
+ zone = "head"
+ slot = "brain"
+ vital = 1
+ origin_tech = "biotech=5"
+ attack_verb = list("attacked", "slapped", "whacked")
+ var/mob/living/brain/brainmob = null
+ var/damaged_brain = 0 //whether the brain organ is damaged.
+
+/obj/item/organ/brain/Insert(mob/living/carbon/C, special = 0)
+ ..()
+ name = "brain"
+ if(brainmob)
+ if(C.key)
+ C.ghostize()
+
+ if(brainmob.mind)
+ brainmob.mind.transfer_to(C)
+ else
+ C.key = brainmob.key
+
+ qdel(brainmob)
+
+ //Update the body's icon so it doesnt appear debrained anymore
+ C.update_hair()
+
+/obj/item/organ/brain/Remove(mob/living/carbon/C, special = 0)
+ ..()
+ if(!special)
+ transfer_identity(C)
+ C.update_hair()
+
+/obj/item/organ/brain/prepare_eat()
+ return // Too important to eat.
+
+/obj/item/organ/brain/proc/transfer_identity(mob/living/L)
+ name = "[L.name]'s brain"
+ brainmob = new(src)
+ brainmob.name = L.real_name
+ brainmob.real_name = L.real_name
+ brainmob.timeofhostdeath = L.timeofdeath
+ if(L.has_dna())
+ var/mob/living/carbon/C = L
+ if(!brainmob.stored_dna)
+ brainmob.stored_dna = new /datum/dna/stored(brainmob)
+ C.dna.copy_dna(brainmob.stored_dna)
+ if(L.mind && L.mind.current && (L.mind.current.stat == DEAD))
+ L.mind.transfer_to(brainmob)
+ brainmob << "You feel slightly disoriented. That's normal when you're just a brain."
+
+/obj/item/organ/brain/attackby(obj/item/O, mob/user, params)
+ user.changeNext_move(CLICK_CD_MELEE)
+ if(brainmob)
+ O.attack(brainmob, user) //Oh noooeeeee
+
+/obj/item/organ/brain/examine(mob/user)
+ ..()
+
+ if(brainmob)
+ if(brainmob.client)
+ if(brainmob.health <= HEALTH_THRESHOLD_DEAD)
+ user << "It's lifeless and severely damaged."
+ else
+ user << "You can feel the small spark of life still left in this one."
+ else
+ user << "This one seems particularly lifeless. Perhaps it will regain some of its luster later."
+ else
+ user << "This one is completely devoid of life."
+
+/obj/item/organ/brain/attack(mob/living/carbon/C, mob/user)
+ if(!istype(C))
+ return ..()
+
+ add_fingerprint(user)
+
+ if(user.zone_selected != "head")
+ return ..()
+
+ if((C.head && (C.head.flags_cover & HEADCOVERSEYES)) || (C.wear_mask && (C.wear_mask.flags_cover & MASKCOVERSEYES)) || (C.glasses && (C.glasses.flags & GLASSESCOVERSEYES)))
+ user << "You're going to need to remove their head cover first!"
+ return
+
+//since these people will be dead M != usr
+
+ if(!C.getorgan(/obj/item/organ/brain))
+ if(!C.get_bodypart("head"))
+ return
+ user.drop_item()
+ var/msg = "[C] has [src] inserted into \his head by [user]."
+ if(C == user)
+ msg = "[user] inserts [src] into \his head!"
+
+ C.visible_message("[msg]",
+ "[msg]")
+
+ if(C != user)
+ C << "[user] inserts [src] into your head."
+ user << "You insert [src] into [C]'s head."
+ else
+ user << "You insert [src] into your head." //LOL
+
+ Insert(C)
+ else
+ ..()
+
+/obj/item/organ/brain/Destroy() //copypasted from MMIs.
+ if(brainmob)
+ qdel(brainmob)
+ brainmob = null
+ return ..()
+
+/obj/item/organ/brain/alien
+ name = "alien brain"
+ desc = "We barely understand the brains of terrestial animals. Who knows what we may find in the brain of such an advanced species?"
+ icon_state = "brain-x"
+ origin_tech = "biotech=6"
diff --git a/code/modules/mob/living/carbon/brain/death.dm b/code/modules/mob/living/brain/death.dm
similarity index 83%
rename from code/modules/mob/living/carbon/brain/death.dm
rename to code/modules/mob/living/brain/death.dm
index 67b700b2b08e..e98859b90ff2 100644
--- a/code/modules/mob/living/carbon/brain/death.dm
+++ b/code/modules/mob/living/brain/death.dm
@@ -1,20 +1,20 @@
-/mob/living/carbon/brain/death(gibbed)
- if(stat == DEAD)
- return
- stat = DEAD
-
- if(!gibbed && container)//If not gibbed but in a container.
- var/obj/item/device/mmi = container
- mmi.visible_message("[src]'s MMI flatlines!", \
- "You hear something flatline.")
- mmi.update_icon()
-
- return ..()
-
-/mob/living/carbon/brain/gib()
- if(container)
- qdel(container)//Gets rid of the MMI if there is one
- if(loc)
- if(istype(loc,/obj/item/organ/brain))
- qdel(loc)//Gets rid of the brain item
+/mob/living/brain/death(gibbed)
+ if(stat == DEAD)
+ return
+ stat = DEAD
+
+ if(!gibbed && container)//If not gibbed but in a container.
+ var/obj/item/device/mmi = container
+ mmi.visible_message("[src]'s MMI flatlines!", \
+ "You hear something flatline.")
+ mmi.update_icon()
+
+ return ..()
+
+/mob/living/brain/gib()
+ if(container)
+ qdel(container)//Gets rid of the MMI if there is one
+ if(loc)
+ if(istype(loc,/obj/item/organ/brain))
+ qdel(loc)//Gets rid of the brain item
..()
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/brain/emote.dm b/code/modules/mob/living/brain/emote.dm
similarity index 91%
rename from code/modules/mob/living/carbon/brain/emote.dm
rename to code/modules/mob/living/brain/emote.dm
index bd4be7c66f9b..8ab505f7a9ef 100644
--- a/code/modules/mob/living/carbon/brain/emote.dm
+++ b/code/modules/mob/living/brain/emote.dm
@@ -1,71 +1,71 @@
-/mob/living/carbon/brain/emote(act,m_type=1,message = null)
- if(!(container && istype(container, /obj/item/device/mmi)))//No MMI, no emotes
- return
-
- if (findtext(act, "-", 1, null))
- var/t1 = findtext(act, "-", 1, null)
- act = copytext(act, 1, t1)
-
-
- if(src.stat == DEAD)
- return
- switch(act)
- if ("alarm")
- src << "You sound an alarm."
- message = "[src] sounds an alarm."
- m_type = 2
-
- if ("alert")
- src << "You let out a distressed noise."
- message = "[src] lets out a distressed noise."
- m_type = 2
-
- if ("beep","beeps")
- src << "You beep."
- message = "[src] beeps."
- m_type = 2
-
- if ("blink","blinks")
- message = "[src] blinks."
- m_type = 1
-
- if ("boop","boops")
- src << "You boop."
- message = "[src] boops."
- m_type = 2
-
- if ("flash")
- message = "The lights on [src] flash quickly."
- m_type = 1
-
- if ("notice")
- src << "You play a loud tone."
- message = "[src] plays a loud tone."
- m_type = 2
-
- if ("whistle","whistles")
- src << "You whistle."
- message = "[src] whistles."
- m_type = 2
-
- if ("help")
- src << "Help for MMI emotes. You can use these emotes with say \"*emote\":\nalarm, alert, beep, blink, boop, flash, notice, whistle"
-
- else
- src << "Unusable emote '[act]'. Say *help for a list."
- return
-
- if (message)
- log_emote("[name]/[key] : [message]")
-
- for(var/mob/M in dead_mob_list)
- if (!M.client || istype(M, /mob/new_player))
- continue //skip monkeys, leavers, and new_players
- if(M.stat == DEAD && (M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT)) && !(M in viewers(src,null)))
- M.show_message(message)
-
-
- if (m_type & 1)
- visible_message(message)
- else if (m_type & 2)
+/mob/living/brain/emote(act,m_type=1,message = null)
+ if(!(container && istype(container, /obj/item/device/mmi)))//No MMI, no emotes
+ return
+
+ if (findtext(act, "-", 1, null))
+ var/t1 = findtext(act, "-", 1, null)
+ act = copytext(act, 1, t1)
+
+
+ if(src.stat == DEAD)
+ return
+ switch(act)
+ if ("alarm")
+ src << "You sound an alarm."
+ message = "[src] sounds an alarm."
+ m_type = 2
+
+ if ("alert")
+ src << "You let out a distressed noise."
+ message = "[src] lets out a distressed noise."
+ m_type = 2
+
+ if ("beep","beeps")
+ src << "You beep."
+ message = "[src] beeps."
+ m_type = 2
+
+ if ("blink","blinks")
+ message = "[src] blinks."
+ m_type = 1
+
+ if ("boop","boops")
+ src << "You boop."
+ message = "[src] boops."
+ m_type = 2
+
+ if ("flash")
+ message = "The lights on [src] flash quickly."
+ m_type = 1
+
+ if ("notice")
+ src << "You play a loud tone."
+ message = "[src] plays a loud tone."
+ m_type = 2
+
+ if ("whistle","whistles")
+ src << "You whistle."
+ message = "[src] whistles."
+ m_type = 2
+
+ if ("help")
+ src << "Help for MMI emotes. You can use these emotes with say \"*emote\":\nalarm, alert, beep, blink, boop, flash, notice, whistle"
+
+ else
+ src << "Unusable emote '[act]'. Say *help for a list."
+ return
+
+ if (message)
+ log_emote("[name]/[key] : [message]")
+
+ for(var/mob/M in dead_mob_list)
+ if (!M.client || istype(M, /mob/new_player))
+ continue //skip monkeys, leavers, and new_players
+ if(M.stat == DEAD && (M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTSIGHT)) && !(M in viewers(src,null)))
+ M.show_message(message)
+
+
+ if (m_type & 1)
+ visible_message(message)
+ else if (m_type & 2)
audible_message(message)
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/brain/life.dm
similarity index 57%
rename from code/modules/mob/living/carbon/brain/life.dm
rename to code/modules/mob/living/brain/life.dm
index 75f731b6e69a..9d87f412e8d9 100644
--- a/code/modules/mob/living/carbon/brain/life.dm
+++ b/code/modules/mob/living/brain/life.dm
@@ -1,60 +1,49 @@
-
-/mob/living/carbon/brain/Life()
- set invisibility = 0
- set background = BACKGROUND_ENABLED
-
- if (notransform)
- return
- if(!loc)
- return
- . = ..()
- handle_emp_damage()
-
-/mob/living/carbon/brain/handle_breathing()
- return
-
-/mob/living/carbon/brain/handle_mutations_and_radiation()
- return
-
-/mob/living/carbon/brain/handle_environment(datum/gas_mixture/environment)
- return
-
-/mob/living/carbon/brain/update_stat()
- if(status_flags & GODMODE)
- return
- if(health <= HEALTH_THRESHOLD_DEAD)
- if(stat != DEAD)
- death()
- var/obj/item/organ/brain/BR
- if(container && container.brain)
- BR = container.brain
- else if(istype(loc, /obj/item/organ/brain))
- BR = loc
- if(BR)
- BR.damaged_brain = 1 //beaten to a pulp
-
-/* //currently unused feature, since brain outside a mmi is always dead.
-/mob/living/carbon/brain/proc/handle_brain_revival_life()
- if(stat != DEAD)
- if(config.revival_brain_life != -1)
- if( !container && (world.time - timeofhostdeath) > config.revival_brain_life)
- death()
-*/
-
-/mob/living/carbon/brain/proc/handle_emp_damage()
- if(emp_damage)
- if(stat == DEAD)
- emp_damage = 0
- else
- emp_damage = max(emp_damage-1, 0)
-
-/mob/living/carbon/brain/handle_status_effects()
- return
-
-/mob/living/carbon/brain/handle_disabilities()
- return
-
-/mob/living/carbon/brain/handle_changeling()
- return
-
-
+
+/mob/living/brain/Life()
+ set invisibility = 0
+ set background = BACKGROUND_ENABLED
+
+ if (notransform)
+ return
+ if(!loc)
+ return
+ . = ..()
+ handle_emp_damage()
+
+/mob/living/brain/update_stat()
+ if(status_flags & GODMODE)
+ return
+ if(health <= HEALTH_THRESHOLD_DEAD)
+ if(stat != DEAD)
+ death()
+ var/obj/item/organ/brain/BR
+ if(container && container.brain)
+ BR = container.brain
+ else if(istype(loc, /obj/item/organ/brain))
+ BR = loc
+ if(BR)
+ BR.damaged_brain = 1 //beaten to a pulp
+
+/* //currently unused feature, since brain outside a mmi is always dead.
+/mob/living/brain/proc/handle_brain_revival_life()
+ if(stat != DEAD)
+ if(config.revival_brain_life != -1)
+ if( !container && (world.time - timeofhostdeath) > config.revival_brain_life)
+ death()
+*/
+
+/mob/living/brain/proc/handle_emp_damage()
+ if(emp_damage)
+ if(stat == DEAD)
+ emp_damage = 0
+ else
+ emp_damage = max(emp_damage-1, 0)
+
+/mob/living/brain/handle_status_effects()
+ return
+
+/mob/living/brain/handle_disabilities()
+ return
+
+
+
diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/brain/posibrain.dm
similarity index 98%
rename from code/modules/mob/living/carbon/brain/posibrain.dm
rename to code/modules/mob/living/brain/posibrain.dm
index 229f2b52fced..f7ad95798a5a 100644
--- a/code/modules/mob/living/carbon/brain/posibrain.dm
+++ b/code/modules/mob/living/brain/posibrain.dm
@@ -80,11 +80,10 @@ var/global/posibrain_notif_cooldown = 0
name = "[initial(name)] ([C])"
brainmob.name = C.real_name
brainmob.real_name = C.real_name
- brainmob.dna = C.dna
if(C.has_dna())
- if(!brainmob.dna)
- brainmob.dna = new /datum/dna(brainmob)
- C.dna.copy_dna(brainmob.dna)
+ if(!brainmob.stored_dna)
+ brainmob.stored_dna = new /datum/dna/stored(brainmob)
+ C.dna.copy_dna(brainmob.stored_dna)
brainmob.timeofhostdeath = C.timeofdeath
brainmob.stat = CONSCIOUS
if(brainmob.mind)
diff --git a/code/modules/mob/living/carbon/brain/say.dm b/code/modules/mob/living/brain/say.dm
similarity index 70%
rename from code/modules/mob/living/carbon/brain/say.dm
rename to code/modules/mob/living/brain/say.dm
index 77f72d484a7d..0aeb312ee0fd 100644
--- a/code/modules/mob/living/carbon/brain/say.dm
+++ b/code/modules/mob/living/brain/say.dm
@@ -1,23 +1,23 @@
-/mob/living/carbon/brain/say(message)
- if(!(container && istype(container, /obj/item/device/mmi)))
- return //No MMI, can't speak, bucko./N
- else
- if(prob(emp_damage*4))
- if(prob(10))//10% chane to drop the message entirely
- return
- else
- message = Gibberish(message, (emp_damage*6))//scrambles the message, gets worse when emp_damage is higher
- ..()
-
-/mob/living/carbon/brain/radio(message, message_mode, list/spans)
- if(message_mode && istype(container, /obj/item/device/mmi))
- var/obj/item/device/mmi/R = container
- if(R.radio)
- R.radio.talk_into(src, message, , spans)
- return ITALICS | REDUCE_RANGE
-
-/mob/living/carbon/brain/lingcheck()
- return 0
-
-/mob/living/carbon/brain/treat_message(message)
+/mob/living/brain/say(message)
+ if(!(container && istype(container, /obj/item/device/mmi)))
+ return //No MMI, can't speak, bucko./N
+ else
+ if(prob(emp_damage*4))
+ if(prob(10))//10% chane to drop the message entirely
+ return
+ else
+ message = Gibberish(message, (emp_damage*6))//scrambles the message, gets worse when emp_damage is higher
+ ..()
+
+/mob/living/brain/radio(message, message_mode, list/spans)
+ if(message_mode && istype(container, /obj/item/device/mmi))
+ var/obj/item/device/mmi/R = container
+ if(R.radio)
+ R.radio.talk_into(src, message, , spans)
+ return ITALICS | REDUCE_RANGE
+
+/mob/living/brain/lingcheck()
+ return 0
+
+/mob/living/brain/treat_message(message)
return message
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/brain/status_procs.dm b/code/modules/mob/living/brain/status_procs.dm
similarity index 52%
rename from code/modules/mob/living/carbon/brain/status_procs.dm
rename to code/modules/mob/living/brain/status_procs.dm
index dc8ff6ffc1e1..caf2bfe22c4c 100644
--- a/code/modules/mob/living/carbon/brain/status_procs.dm
+++ b/code/modules/mob/living/brain/status_procs.dm
@@ -4,35 +4,30 @@
/////////////////////////////////// EAR DAMAGE ////////////////////////////////////
-/mob/living/carbon/brain/adjustEarDamage()
+/mob/living/brain/adjustEarDamage()
return
-/mob/living/carbon/brain/setEarDamage() // no ears to damage or heal
+/mob/living/brain/setEarDamage() // no ears to damage or heal
return
/////////////////////////////////// EYE_BLIND ////////////////////////////////////
-/mob/living/carbon/brain/blind_eyes() // no eyes to damage or heal
+/mob/living/brain/blind_eyes() // no eyes to damage or heal
return
-/mob/living/carbon/brain/adjust_blindness()
+/mob/living/brain/adjust_blindness()
return
-/mob/living/carbon/brain/set_blindness()
+/mob/living/brain/set_blindness()
return
/////////////////////////////////// EYE_BLURRY ////////////////////////////////////
-/mob/living/carbon/brain/blur_eyes()
+/mob/living/brain/blur_eyes()
return
-/mob/living/carbon/brain/adjust_blurriness()
+/mob/living/brain/adjust_blurriness()
return
-/mob/living/carbon/brain/set_blurriness()
+/mob/living/brain/set_blurriness()
return
-
-/////////////////////////////////// BLIND DISABILITY ////////////////////////////////////
-
-/mob/living/carbon/brain/become_blind()
- return
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm
index c8f7ce99a227..42572b1c03ca 100644
--- a/code/modules/mob/living/carbon/alien/alien.dm
+++ b/code/modules/mob/living/carbon/alien/alien.dm
@@ -37,35 +37,22 @@
verbs += /mob/living/proc/mob_sleep
verbs += /mob/living/proc/lay_down
- internal_organs += new /obj/item/organ/brain/alien
- internal_organs += new /obj/item/organ/alien/hivenode
- internal_organs += new /obj/item/organ/tongue/alien
+ create_bodyparts() //initialize bodyparts
- for(var/obj/item/organ/I in internal_organs)
- I.Insert(src)
+ create_internal_organs()
AddAbility(new/obj/effect/proc_holder/alien/nightvisiontoggle(null))
..()
+/mob/living/carbon/alien/create_internal_organs()
+ internal_organs += new /obj/item/organ/brain/alien
+ internal_organs += new /obj/item/organ/alien/hivenode
+ internal_organs += new /obj/item/organ/tongue/alien
+ ..()
+
/mob/living/carbon/alien/assess_threat() // beepsky won't hunt aliums
return -10
-/mob/living/carbon/alien/adjustToxLoss(amount)
- return 0
-
-/mob/living/carbon/alien/adjustFireLoss(amount) // Weak to Fire
- if(amount > 0)
- ..(amount * 2)
- else
- ..(amount)
- return
-
-/mob/living/carbon/alien/check_eye_prot()
- return ..() + 2
-
-/mob/living/carbon/alien/getToxLoss()
- return 0
-
/mob/living/carbon/alien/handle_environment(datum/gas_mixture/environment)
if(!environment)
return
@@ -100,35 +87,6 @@
else
clear_alert("alien_fire")
-
-/mob/living/carbon/alien/ex_act(severity, target)
- ..()
-
- switch (severity)
- if (1)
- gib()
- return
-
- if (2)
- adjustBruteLoss(60)
- adjustFireLoss(60)
- adjustEarDamage(30,120)
-
- if(3)
- adjustBruteLoss(30)
- if (prob(50))
- Paralyse(1)
- adjustEarDamage(15,60)
-
- updatehealth()
-
-
-/mob/living/carbon/alien/handle_fire()//Aliens on fire code
- if(..())
- return
- bodytemperature += BODYTEMP_HEATING_MAX //If you're on fire, you heat up!
- return
-
/mob/living/carbon/alien/reagent_check(datum/reagent/R) //can metabolize all reagents
return 0
diff --git a/code/modules/mob/living/carbon/alien/alien_defense.dm b/code/modules/mob/living/carbon/alien/alien_defense.dm
index d9f5ef6fa98e..0d934446366d 100644
--- a/code/modules/mob/living/carbon/alien/alien_defense.dm
+++ b/code/modules/mob/living/carbon/alien/alien_defense.dm
@@ -1,3 +1,10 @@
+
+/mob/living/carbon/alien/get_eye_protection()
+ return ..() + 2 //potential cyber implants + natural eye protection
+
+/mob/living/carbon/alien/get_ear_protection()
+ return 2 //no ears
+
/mob/living/carbon/alien/hitby(atom/movable/AM, skipcatch, hitpush)
..(AM, skipcatch = 1, hitpush = 0)
@@ -40,7 +47,6 @@ In all, this is a lot like the monkey code. /N
updatehealth()
else
M << "[name] is too injured for that."
- return
/mob/living/carbon/alien/attack_larva(mob/living/carbon/alien/larva/L)
@@ -65,9 +71,10 @@ In all, this is a lot like the monkey code. /N
/mob/living/carbon/alien/attack_paw(mob/living/carbon/monkey/M)
if(..())
if (stat != DEAD)
- adjustBruteLoss(rand(1, 3))
- updatehealth()
- return
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
+ apply_damage(rand(1, 3), BRUTE, affecting)
+
+
/mob/living/carbon/alien/attack_animal(mob/living/simple_animal/M)
@@ -96,3 +103,22 @@ In all, this is a lot like the monkey code. /N
adjustBruteLoss(damage)
add_logs(M, src, "attacked")
updatehealth()
+
+/mob/living/carbon/alien/ex_act(severity, target)
+ ..()
+ switch (severity)
+ if (1)
+ gib()
+
+ if (2)
+ take_overall_damage(60, 60)
+ adjustEarDamage(30,120)
+
+ if(3)
+ take_overall_damage(30,0)
+ if(prob(50))
+ Paralyse(1)
+ adjustEarDamage(15,60)
+
+/mob/living/carbon/alien/soundbang_act(intensity = 1, stun_pwr = 1, damage_pwr = 5, deafen_pwr = 15)
+ return 0
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/alien/damage_procs.dm b/code/modules/mob/living/carbon/alien/damage_procs.dm
new file mode 100644
index 000000000000..7857c0b565e6
--- /dev/null
+++ b/code/modules/mob/living/carbon/alien/damage_procs.dm
@@ -0,0 +1,22 @@
+
+
+/mob/living/carbon/alien/getToxLoss()
+ return 0
+
+/mob/living/carbon/alien/adjustToxLoss(amount) //alien immune to tox damage
+ return 0
+
+/mob/living/carbon/alien/adjustFireLoss(amount) // Weak to Fire
+ if(amount > 0)
+ ..(amount * 2)
+ else
+ ..(amount)
+
+
+
+//aliens are immune to stamina damage.
+/mob/living/carbon/alien/adjustStaminaLoss(amount, updating_stamina = 1)
+ return
+
+/mob/living/carbon/alien/setStaminaLoss(amount, updating_stamina = 1)
+ return
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/alien/death.dm b/code/modules/mob/living/carbon/alien/death.dm
index 7583d0afaa7a..6211dc834936 100644
--- a/code/modules/mob/living/carbon/alien/death.dm
+++ b/code/modules/mob/living/carbon/alien/death.dm
@@ -1,5 +1,8 @@
-/mob/living/carbon/alien/spawn_gibs()
- xgibs(loc, viruses)
+/mob/living/carbon/alien/spawn_gibs(with_bodyparts)
+ if(with_bodyparts)
+ new /obj/effect/gibspawner/xeno(loc,viruses)
+ else
+ new /obj/effect/gibspawner/xenobodypartless(loc,viruses)
/mob/living/carbon/alien/gib_animation()
PoolOrNew(/obj/effect/overlay/temp/gib_animation, list(loc, "gibbed-a"))
diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm
index 8e078e4ed7c2..5f0dbd5635ed 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm
@@ -7,11 +7,14 @@
/mob/living/carbon/alien/humanoid/drone/New()
+ AddAbility(new/obj/effect/proc_holder/alien/evolve(null))
+ ..()
+
+
+/mob/living/carbon/alien/humanoid/drone/create_internal_organs()
internal_organs += new /obj/item/organ/alien/plasmavessel/large
internal_organs += new /obj/item/organ/alien/resinspinner
internal_organs += new /obj/item/organ/alien/acid
-
- AddAbility(new/obj/effect/proc_holder/alien/evolve(null))
..()
/mob/living/carbon/alien/humanoid/drone/movement_delay()
diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm
index 379500f5002e..3a9e938df390 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm
@@ -6,7 +6,7 @@
icon_state = "alienh_s"
var/obj/screen/leap_icon = null
-/mob/living/carbon/alien/humanoid/hunter/New()
+/mob/living/carbon/alien/humanoid/hunter/create_internal_organs()
internal_organs += new /obj/item/organ/alien/plasmavessel/small
..()
diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/praetorian.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/praetorian.dm
index 8da5304ff77b..d16c06bea538 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/caste/praetorian.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/caste/praetorian.dm
@@ -11,14 +11,18 @@
real_name = name
+ AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/repulse/xeno(src))
+ AddAbility(new /obj/effect/proc_holder/alien/royal/praetorian/evolve())
+ ..()
+
+/mob/living/carbon/alien/humanoid/royal/praetorian/create_internal_organs()
internal_organs += new /obj/item/organ/alien/plasmavessel/large
internal_organs += new /obj/item/organ/alien/resinspinner
internal_organs += new /obj/item/organ/alien/acid
internal_organs += new /obj/item/organ/alien/neurotoxin
- AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/repulse/xeno(src))
- AddAbility(new /obj/effect/proc_holder/alien/royal/praetorian/evolve())
..()
+
/mob/living/carbon/alien/humanoid/royal/praetorian/movement_delay()
. = ..()
. += 1
diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm
index a22ab106dd4e..dacd4ff7d4a7 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm
@@ -7,11 +7,15 @@
/mob/living/carbon/alien/humanoid/sentinel/New()
- internal_organs += new /obj/item/organ/alien/plasmavessel
- internal_organs += new /obj/item/organ/alien/acid
- internal_organs += new /obj/item/organ/alien/neurotoxin
AddAbility(new /obj/effect/proc_holder/alien/sneak)
..()
+/mob/living/carbon/alien/humanoid/sentinel/create_internal_organs()
+ internal_organs += new /obj/item/organ/alien/plasmavessel
+ internal_organs += new /obj/item/organ/alien/acid
+ internal_organs += new /obj/item/organ/alien/neurotoxin
+ ..()
+
+
/mob/living/carbon/alien/humanoid/sentinel/movement_delay()
. = ..()
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
index 89acb9ab91c2..98c1df7b382a 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
@@ -15,75 +15,19 @@
var/custom_pixel_y_offset = 0
var/sneaking = 0 //For sneaky-sneaky mode and appropriate slowdown
var/drooling = 0 //For Neruotoxic spit overlays
+ bodyparts = list(/obj/item/bodypart/chest/alien, /obj/item/bodypart/head/alien, /obj/item/bodypart/l_arm/alien,
+ /obj/item/bodypart/r_arm/alien, /obj/item/bodypart/r_leg/alien, /obj/item/bodypart/l_leg/alien)
+
//This is fine right now, if we're adding organ specific damage this needs to be updated
/mob/living/carbon/alien/humanoid/New()
AddAbility(new/obj/effect/proc_holder/alien/regurgitate(null))
..()
-
/mob/living/carbon/alien/humanoid/movement_delay()
. = ..()
. += move_delay_add + config.alien_delay + sneaking //move_delay_add is used to slow aliens with stuns
-/mob/living/carbon/alien/humanoid/emp_act(severity)
- if(r_store) r_store.emp_act(severity)
- if(l_store) l_store.emp_act(severity)
- ..()
-
-/mob/living/carbon/alien/humanoid/attack_hulk(mob/living/carbon/human/user)
- if(user.a_intent == "harm")
- ..(user, 1)
- adjustBruteLoss(15)
- var/hitverb = "punched"
- if(mob_size < MOB_SIZE_LARGE)
- step_away(src,user,15)
- sleep(1)
- step_away(src,user,15)
- hitverb = "slammed"
- playsound(loc, "punch", 25, 1, -1)
- visible_message("[user] has [hitverb] [src]!", \
- "[user] has [hitverb] [src]!")
- return 1
-
-/mob/living/carbon/alien/humanoid/attack_hand(mob/living/carbon/human/M)
- if(..())
- switch(M.a_intent)
- if ("harm")
- var/damage = rand(1, 9)
- if (prob(90))
- playsound(loc, "punch", 25, 1, -1)
- visible_message("[M] has punched [src]!", \
- "[M] has punched [src]!")
- if ((stat != DEAD) && (damage > 9 || prob(5)))//Regular humans have a very small chance of weakening an alien.
- Paralyse(2)
- visible_message("[M] has weakened [src]!", \
- "[M] has weakened [src]!")
- adjustBruteLoss(damage)
- add_logs(M, src, "attacked")
- updatehealth()
- else
- playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
- visible_message("[M] has attempted to punch [src]!")
-
- if ("disarm")
- if (!lying)
- if (prob(5))
- Paralyse(2)
- playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
- add_logs(M, src, "pushed")
- visible_message("[M] has pushed down [src]!", \
- "[M] has pushed down [src]!")
- else
- if (prob(50))
- drop_item()
- playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
- visible_message("[M] has disarmed [src]!", \
- "[M] has disarmed [src]!")
- else
- playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
- visible_message("[M] has attempted to disarm [src]!")
-
/mob/living/carbon/alien/humanoid/restrained(ignore_grab)
. = handcuffed
@@ -150,9 +94,6 @@
else
return initial(pixel_x)
-/mob/living/carbon/alien/humanoid/check_ear_prot()
- return 1
-
/mob/living/carbon/alien/humanoid/get_permeability_protection()
return 0.8
@@ -179,9 +120,3 @@ proc/get_alien_type(var/alienpath)
if(breath && breath.total_moles() > 0 && !sneaking)
playsound(get_turf(src), pick('sound/voice/lowHiss2.ogg', 'sound/voice/lowHiss3.ogg', 'sound/voice/lowHiss4.ogg'), 50, 0, -5)
..()
-
-/mob/living/carbon/alien/humanoid/grabbedby(mob/living/carbon/user, supress_message = 0)
- if(user == src && pulling && grab_state >= GRAB_AGGRESSIVE && !pulling.anchored && iscarbon(pulling))
- devour_mob(pulling, devour_time = 60)
- else
- ..()
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm
new file mode 100644
index 000000000000..4f08997c40fa
--- /dev/null
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm
@@ -0,0 +1,59 @@
+
+/mob/living/carbon/alien/humanoid/grabbedby(mob/living/carbon/user, supress_message = 0)
+ if(user == src && pulling && grab_state >= GRAB_AGGRESSIVE && !pulling.anchored && iscarbon(pulling))
+ devour_mob(pulling, devour_time = 60)
+ else
+ ..()
+
+/mob/living/carbon/alien/humanoid/attack_hulk(mob/living/carbon/human/user)
+ if(user.a_intent == "harm")
+ ..(user, 1)
+ adjustBruteLoss(15)
+ var/hitverb = "punched"
+ if(mob_size < MOB_SIZE_LARGE)
+ step_away(src,user,15)
+ sleep(1)
+ step_away(src,user,15)
+ hitverb = "slammed"
+ playsound(loc, "punch", 25, 1, -1)
+ visible_message("[user] has [hitverb] [src]!", \
+ "[user] has [hitverb] [src]!")
+ return 1
+
+/mob/living/carbon/alien/humanoid/attack_hand(mob/living/carbon/human/M)
+ if(..())
+ switch(M.a_intent)
+ if ("harm")
+ var/damage = rand(1, 9)
+ if (prob(90))
+ playsound(loc, "punch", 25, 1, -1)
+ visible_message("[M] has punched [src]!", \
+ "[M] has punched [src]!")
+ if ((stat != DEAD) && (damage > 9 || prob(5)))//Regular humans have a very small chance of weakening an alien.
+ Paralyse(2)
+ visible_message("[M] has weakened [src]!", \
+ "[M] has weakened [src]!")
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
+ apply_damage(damage, BRUTE, affecting)
+ add_logs(M, src, "attacked")
+ else
+ playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
+ visible_message("[M] has attempted to punch [src]!")
+
+ if ("disarm")
+ if (!lying)
+ if (prob(5))
+ Paralyse(2)
+ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+ add_logs(M, src, "pushed")
+ visible_message("[M] has pushed down [src]!", \
+ "[M] has pushed down [src]!")
+ else
+ if (prob(50))
+ drop_item()
+ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+ visible_message("[M] has disarmed [src]!", \
+ "[M] has disarmed [src]!")
+ else
+ playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
+ visible_message("[M] has attempted to disarm [src]!")
diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm
index 5f48d88c55d2..5559ebffe016 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm
@@ -57,14 +57,17 @@
real_name = src.name
+ AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/repulse/xeno(src))
+ AddAbility(new/obj/effect/proc_holder/alien/royal/queen/promote())
+ smallsprite.Grant(src)
+ ..()
+
+/mob/living/carbon/alien/humanoid/royal/queen/create_internal_organs()
internal_organs += new /obj/item/organ/alien/plasmavessel/large/queen
internal_organs += new /obj/item/organ/alien/resinspinner
internal_organs += new /obj/item/organ/alien/acid
internal_organs += new /obj/item/organ/alien/neurotoxin
internal_organs += new /obj/item/organ/alien/eggsac
- AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/repulse/xeno(src))
- AddAbility(new/obj/effect/proc_holder/alien/royal/queen/promote())
- smallsprite.Grant(src)
..()
/mob/living/carbon/alien/humanoid/royal/queen/movement_delay()
diff --git a/code/modules/mob/living/carbon/alien/larva/death.dm b/code/modules/mob/living/carbon/alien/larva/death.dm
index 136572fb5c51..43a2f196255e 100644
--- a/code/modules/mob/living/carbon/alien/larva/death.dm
+++ b/code/modules/mob/living/carbon/alien/larva/death.dm
@@ -8,3 +8,18 @@
visible_message("[src] lets out a waning high-pitched cry.")
return ..(gibbed)
+
+/mob/living/carbon/alien/larva/spawn_gibs(with_bodyparts)
+ if(with_bodyparts)
+ new /obj/effect/gibspawner/larva(loc,viruses)
+ else
+ new /obj/effect/gibspawner/larvabodypartless(loc,viruses)
+
+/mob/living/carbon/alien/larva/gib_animation()
+ PoolOrNew(/obj/effect/overlay/temp/gib_animation, list(loc, "gibbed-l"))
+
+/mob/living/carbon/alien/larva/spawn_dust()
+ new /obj/effect/decal/remains/xeno(loc)
+
+/mob/living/carbon/alien/larva/dust_animation()
+ PoolOrNew(/obj/effect/overlay/temp/dust_animation, list(loc, "dust-l"))
diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm
index 887cf139996e..f6ceff4774a2 100644
--- a/code/modules/mob/living/carbon/alien/larva/larva.dm
+++ b/code/modules/mob/living/carbon/alien/larva/larva.dm
@@ -14,16 +14,20 @@
var/time_of_birth
rotate_on_lying = 0
+ bodyparts = list(/obj/item/bodypart/chest/larva, /obj/item/bodypart/head/larva)
+
//This is fine right now, if we're adding organ specific damage this needs to be updated
/mob/living/carbon/alien/larva/New()
- regenerate_icons()
- internal_organs += new /obj/item/organ/alien/plasmavessel/small/tiny
AddAbility(new/obj/effect/proc_holder/alien/hide(null))
AddAbility(new/obj/effect/proc_holder/alien/larva_evolve(null))
..()
+/mob/living/carbon/alien/larva/create_internal_organs()
+ internal_organs += new /obj/item/organ/alien/plasmavessel/small/tiny
+ ..()
+
//This needs to be fixed
/mob/living/carbon/alien/larva/Stat()
..()
@@ -39,36 +43,6 @@
/mob/living/carbon/alien/larva/attack_ui(slot_id)
return
-/mob/living/carbon/alien/larva/attack_hulk(mob/living/carbon/human/user)
- if(user.a_intent == "harm")
- ..(user, 1)
- adjustBruteLoss(5 + rand(1,9))
- spawn()
- step_away(src,user,15)
- sleep(1)
- step_away(src,user,15)
- return 1
-
-/mob/living/carbon/alien/larva/attack_hand(mob/living/carbon/human/M)
- if(..())
- var/damage = rand(1, 9)
- if (prob(90))
- playsound(loc, "punch", 25, 1, -1)
- add_logs(M, src, "attacked")
- visible_message("[M] has kicked [src]!", \
- "[M] has kicked [src]!")
- if ((stat != DEAD) && (damage > 4.9))
- Paralyse(rand(5,10))
-
- adjustBruteLoss(damage)
- updatehealth()
- else
- playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
- visible_message("[M] has attempted to kick [src]!", \
- "[M] has attempted to kick [src]!")
-
- return
-
/mob/living/carbon/alien/larva/restrained(ignore_grab)
. = 0
diff --git a/code/modules/mob/living/carbon/alien/larva/larva_defense.dm b/code/modules/mob/living/carbon/alien/larva/larva_defense.dm
new file mode 100644
index 000000000000..77bab6cdf040
--- /dev/null
+++ b/code/modules/mob/living/carbon/alien/larva/larva_defense.dm
@@ -0,0 +1,29 @@
+
+
+/mob/living/carbon/alien/larva/attack_hand(mob/living/carbon/human/M)
+ if(..())
+ var/damage = rand(1, 9)
+ if (prob(90))
+ playsound(loc, "punch", 25, 1, -1)
+ add_logs(M, src, "attacked")
+ visible_message("[M] has kicked [src]!", \
+ "[M] has kicked [src]!")
+ if ((stat != DEAD) && (damage > 4.9))
+ Paralyse(rand(5,10))
+
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
+ apply_damage(damage, BRUTE, affecting)
+ else
+ playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
+ visible_message("[M] has attempted to kick [src]!", \
+ "[M] has attempted to kick [src]!")
+
+/mob/living/carbon/alien/larva/attack_hulk(mob/living/carbon/human/user)
+ if(user.a_intent == "harm")
+ ..(user, 1)
+ adjustBruteLoss(5 + rand(1,9))
+ spawn()
+ step_away(src,user,15)
+ sleep(1)
+ step_away(src,user,15)
+ return 1
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm
index 91bddef2cde8..f0192cf2a96b 100644
--- a/code/modules/mob/living/carbon/alien/life.dm
+++ b/code/modules/mob/living/carbon/alien/life.dm
@@ -45,4 +45,10 @@
move_delay_add = max(0, move_delay_add - rand(1, 2))
/mob/living/carbon/alien/handle_changeling()
+ return
+
+/mob/living/carbon/alien/handle_fire()//Aliens on fire code
+ if(..())
+ return
+ bodytemperature += BODYTEMP_HEATING_MAX //If you're on fire, you heat up!
return
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
index 9a531fdf956a..f2382721cff7 100644
--- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
+++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
@@ -41,7 +41,7 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds
if(prob(4))
owner << "Your muscles ache."
if(prob(20))
- owner.take_organ_damage(1)
+ owner.take_bodypart_damage(1)
if(prob(4))
owner << "Your stomach hurts."
if(prob(20))
diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm
index a1292a9c9ab5..95387d856910 100644
--- a/code/modules/mob/living/carbon/alien/special/facehugger.dm
+++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm
@@ -68,7 +68,6 @@ var/const/MAX_ACTIVE_TIME = 400
/obj/item/clothing/mask/facehugger/bullet_act(obj/item/projectile/P)
if(P.damage)
Die()
- return
/obj/item/clothing/mask/facehugger/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
@@ -124,7 +123,7 @@ var/const/MAX_ACTIVE_TIME = 400
return 0
if(stat != CONSCIOUS)
return 0
- if(!sterile) M.take_organ_damage(strength,0) //done here so that even borgs and humans in helmets take damage
+ if(!sterile) M.take_bodypart_damage(strength,0) //done here so that even borgs and humans in helmets take damage
M.visible_message("[src] leaps at [M]'s face!", \
"[src] leaps at [M]'s face!")
if(ishuman(M))
@@ -180,7 +179,7 @@ var/const/MAX_ACTIVE_TIME = 400
icon_state = "[initial(icon_state)]_impregnated"
var/obj/item/bodypart/chest/LC = target.get_bodypart("chest")
- if((!LC || LC.status != ORGAN_ROBOTIC) && !target.getorgan(/obj/item/organ/body_egg/alien_embryo))
+ if((!LC || LC.status != BODYPART_ROBOTIC) && !target.getorgan(/obj/item/organ/body_egg/alien_embryo))
new /obj/item/organ/body_egg/alien_embryo(target)
if(iscorgi(target))
diff --git a/code/modules/mob/living/carbon/alien/update_icons.dm b/code/modules/mob/living/carbon/alien/update_icons.dm
new file mode 100644
index 000000000000..ec3753e69790
--- /dev/null
+++ b/code/modules/mob/living/carbon/alien/update_icons.dm
@@ -0,0 +1,11 @@
+
+
+
+/mob/living/carbon/alien/update_damage_overlays() //aliens don't have damage overlays.
+ return
+
+/mob/living/carbon/alien/update_body() // we don't use the bodyparts or body layers for aliens.
+ return
+
+/mob/living/carbon/alien/update_body_parts()//we don't use the bodyparts layer for aliens.
+ return
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 8175cf4e862d..0198c4a1cf8f 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -3,10 +3,11 @@
/mob/living/carbon/New()
create_reagents(1000)
+ update_body_parts() //to update the carbon's new bodyparts appearance
..()
/mob/living/carbon/Destroy()
- for(var/atom/movable/guts in internal_organs)
+ for(var/guts in internal_organs)
qdel(guts)
for(var/atom/movable/food in stomach_contents)
qdel(food)
@@ -28,16 +29,9 @@
var/obj/item/I = user.get_active_held_item()
if(I && I.force)
var/d = rand(round(I.force / 4), I.force)
- if(istype(src, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = src
- var/organ = H.get_bodypart("chest")
- if (istype(organ, /obj/item/bodypart))
- var/obj/item/bodypart/temp = organ
- if(temp.take_damage(d, 0))
- H.update_damage_overlays(0)
- H.updatehealth()
- else
- src.take_organ_damage(d)
+ var/obj/item/bodypart/BP = get_bodypart("chest")
+ if(BP.take_damage(d, 0))
+ update_damage_overlays()
visible_message("[user] attacks [src]'s stomach wall with the [I.name]!", \
"[user] attacks your stomach wall with the [I.name]!")
playsound(user.loc, 'sound/effects/attackblob.ogg', 50, 1)
@@ -49,36 +43,6 @@
src.gib()
-/mob/living/carbon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, override = 0, tesla_shock = 0)
- shock_damage *= siemens_coeff
- if(dna && dna.species)
- shock_damage *= dna.species.siemens_coeff
- if(shock_damage<1 && !override)
- return 0
- if(reagents.has_reagent("teslium"))
- shock_damage *= 1.5 //If the mob has teslium in their body, shocks are 50% more damaging!
- take_overall_damage(0,shock_damage)
- visible_message(
- "[src] was shocked by \the [source]!", \
- "You feel a powerful shock coursing through your body!", \
- "You hear a heavy electrical crack." \
- )
- jitteriness += 1000 //High numbers for violent convulsions
- do_jitter_animation(jitteriness)
- stuttering += 2
- if(!tesla_shock || (tesla_shock && siemens_coeff > 0.5))
- Stun(2)
- spawn(20)
- jitteriness = max(jitteriness - 990, 10) //Still jittery, but vastly less
- if(!tesla_shock || (tesla_shock && siemens_coeff > 0.5))
- Stun(3)
- Weaken(3)
- if(override)
- return override
- else
- return shock_damage
-
-
/mob/living/carbon/swap_hand(held_index)
if(!held_index)
held_index = (active_hand_index % held_items.len)+1
@@ -117,73 +81,27 @@
else
mode() // Activate held item
-/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M)
- if(on_fire)
- M << "You can't put them out with just your bare hands!"
- return
+/mob/living/carbon/attackby(obj/item/I, mob/user, params)
+ if(lying && surgeries.len)
+ if(user != src && user.a_intent == "help")
+ for(var/datum/surgery/S in surgeries)
+ if(S.next_step(user))
+ return 1
+ return ..()
- if(health >= 0 && !(status_flags & FAKEDEATH))
-
- if(lying)
- M.visible_message("[M] shakes [src] trying to get them up!", \
- "You shake [src] trying to get them up!")
- else
- M.visible_message("[M] hugs [src] to make them feel better!", \
- "You hug [src] to make them feel better!")
- AdjustSleeping(-5)
- AdjustParalysis(-3)
- AdjustStunned(-3)
- AdjustWeakened(-3)
- if(resting)
- resting = 0
- update_canmove()
-
- playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
-
-/mob/living/carbon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0)
+/mob/living/carbon/throw_impact(atom/hit_atom)
. = ..()
-
- var/damage = intensity - check_eye_prot()
- if(.) // we've been flashed
- if(visual)
- return
- if(weakeyes)
- Stun(2)
-
- if (damage == 1)
- src << "Your eyes sting a little."
- if(prob(40))
- adjust_eye_damage(1)
-
- else if (damage == 2)
- src << "Your eyes burn."
- adjust_eye_damage(rand(2, 4))
-
- else if( damage > 3)
- src << "Your eyes itch and burn severely!"
- adjust_eye_damage(rand(12, 16))
-
- if(eye_damage > 10)
- blind_eyes(damage)
- blur_eyes(damage * rand(3, 6))
-
- if(eye_damage > 20)
- if(prob(eye_damage - 20))
- if(become_nearsighted())
- src << "Your eyes start to burn badly!"
- else if(prob(eye_damage - 25))
- if(become_blind())
- src << "You can't see anything!"
- else
- src << "Your eyes are really starting to hurt. This can't be good for you!"
- if(has_bane(BANE_LIGHT))
- mind.disrupt_spells(-500)
- return 1
- else if(damage == 0) // just enough protection
- if(prob(20))
- src << "Something bright flashes in the corner of your vision!"
- if(has_bane(BANE_LIGHT))
- mind.disrupt_spells(0)
+ if(hit_atom.density && isturf(hit_atom))
+ Weaken(1)
+ take_bodypart_damage(10)
+ if(iscarbon(hit_atom))
+ var/mob/living/carbon/victim = hit_atom
+ victim.Weaken(1)
+ Weaken(1)
+ victim.take_bodypart_damage(10)
+ take_bodypart_damage(10)
+ visible_message("[src] crashes into [victim], knocking them both over!", "You violently crash into [victim]!")
+ playsound(src,'sound/weapons/punch1.ogg',50,1)
//Throwing stuff
@@ -308,13 +226,6 @@
/mob/living/carbon/is_muzzled()
return(istype(src.wear_mask, /obj/item/clothing/mask/muzzle))
-/mob/living/carbon/blob_act(obj/effect/blob/B)
- if (stat == DEAD)
- return
- else
- show_message("The blob attacks!")
- adjustBruteLoss(10)
-
/mob/living/carbon/proc/spin(spintime, speed)
set waitfor = 0
var/D = dir
@@ -467,10 +378,6 @@
else
return initial(pixel_y)
-/mob/living/carbon/check_ear_prot()
- if(head && (head.flags & HEADBANGPROTECT))
- return 1
-
/mob/living/carbon/proc/accident(obj/item/I)
if(!I || (I.flags & (NODROP|ABSTRACT)))
return
@@ -499,17 +406,6 @@
var/turf/target = get_turf(loc)
I.throw_at(target,I.throw_range,I.throw_speed,src)
-/mob/living/carbon/emp_act(severity)
- for(var/obj/item/organ/O in internal_organs)
- O.emp_act(severity)
- ..()
-
-/mob/living/carbon/check_eye_prot()
- var/number = ..()
- for(var/obj/item/organ/cyberimp/eyes/EFP in internal_organs)
- number += EFP.flash_protect
- return number
-
/mob/living/carbon/proc/AddAbility(obj/effect/proc_holder/alien/A)
abilities.Add(A)
A.on_gain(src)
@@ -538,6 +434,11 @@
add_abilities_to_panel()
+/mob/living/carbon/attack_ui(slot)
+ if(!has_hand_for_held_index(active_hand_index))
+ return 0
+ return ..()
+
/mob/living/carbon/proc/vomit(var/lost_nutrition = 10, var/blood = 0, var/stun = 1, var/distance = 0, var/message = 1, var/toxic = 0)
if(nutrition < 100 && !blood)
if(message)
@@ -578,12 +479,29 @@
return 1
-
/mob/living/carbon/fully_replace_character_name(oldname,newname)
..()
if(dna)
dna.real_name = real_name
+//Updates the mob's health from bodyparts and mob damage variables
+/mob/living/carbon/updatehealth()
+ if(status_flags & GODMODE)
+ return
+ var/total_burn = 0
+ var/total_brute = 0
+ for(var/X in bodyparts) //hardcoded to streamline things a bit
+ var/obj/item/bodypart/BP = X
+ total_brute += BP.brute_dam
+ total_burn += BP.burn_dam
+ health = maxHealth - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute
+ update_stat()
+ if(((maxHealth - total_burn) < HEALTH_THRESHOLD_DEAD) && stat == DEAD )
+ become_husk()
+ if(on_fire)
+ shred_clothing()
+ med_hud_set_health()
+
/mob/living/carbon/update_sight()
if(!client)
return
@@ -756,6 +674,7 @@
for(var/datum/disease/D in viruses)
D.cure(0)
if(admin_revive)
+ regenerate_limbs()
handcuffed = initial(handcuffed)
for(var/obj/item/weapon/restraints/R in contents) //actually remove cuffs from inventory
qdel(R)
@@ -773,7 +692,8 @@
if(qdeleted(src))
return
var/organs_amt = 0
- for(var/obj/item/organ/O in internal_organs)
+ for(var/X in internal_organs)
+ var/obj/item/organ/O = X
if(prob(50))
organs_amt++
O.Remove(src)
@@ -783,15 +703,6 @@
..()
-/mob/living/carbon/adjustToxLoss(amount, updating_health=1)
- if(has_dna() && TOXINLOVER in dna.species.specflags) //damage becomes healing and healing becomes damage
- amount = -amount
- if(amount > 0)
- blood_volume -= 5*amount
- else
- blood_volume -= amount
- return ..()
-
/mob/living/carbon/fakefire(var/fire_icon = "Generic_mob_burning")
overlays_standing[FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"= fire_icon, "layer"=-FIRE_LAYER)
apply_overlay(FIRE_LAYER)
@@ -799,3 +710,34 @@
/mob/living/carbon/fakefireextinguish()
remove_overlay(FIRE_LAYER)
+
+/mob/living/carbon/proc/devour_mob(mob/living/carbon/C, devour_time = 130)
+ C.visible_message("[src] is attempting to devour [C]!", \
+ "[src] is attempting to devour you!")
+ if(!do_mob(src, C, devour_time))
+ return
+ if(pulling && pulling == C && grab_state >= GRAB_AGGRESSIVE && a_intent == "grab")
+ C.visible_message("[src] devours [C]!", \
+ "[src] devours you!")
+ C.forceMove(src)
+ stomach_contents.Add(C)
+ add_logs(src, C, "devoured")
+
+/mob/living/carbon/proc/create_bodyparts()
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/O = new X()
+ O.owner = src
+ bodyparts.Remove(X)
+ bodyparts.Add(O)
+ if(O.body_part == ARM_LEFT)
+ O.held_index = 1
+ hand_bodyparts += O
+ else if(O.body_part == ARM_RIGHT)
+ O.held_index = 2
+ hand_bodyparts += O
+
+
+/mob/living/carbon/proc/create_internal_organs()
+ for(var/X in internal_organs)
+ var/obj/item/organ/I = X
+ I.Insert(src)
diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm
index 6a82174e41ec..4de7733bd266 100644
--- a/code/modules/mob/living/carbon/carbon_defense.dm
+++ b/code/modules/mob/living/carbon/carbon_defense.dm
@@ -1,3 +1,19 @@
+
+/mob/living/carbon/get_eye_protection()
+ var/number = ..()
+ for(var/obj/item/organ/cyberimp/eyes/EFP in internal_organs)
+ number += EFP.flash_protect
+ return number
+
+/mob/living/carbon/get_ear_protection()
+ if(head && (head.flags & HEADBANGPROTECT))
+ return 1
+
+/mob/living/carbon/check_projectile_dismemberment(obj/item/projectile/P, def_zone)
+ var/obj/item/bodypart/affecting = get_bodypart(def_zone)
+ if(affecting && affecting.dismemberable && affecting.get_damage() >= (affecting.max_damage - P.dismemberment))
+ affecting.dismember(P.damtype)
+
/mob/living/carbon/hitby(atom/movable/AM, skipcatch, hitpush = 1, blocked = 0)
if(!skipcatch) //ugly, but easy
if(in_throw_mode && !get_active_held_item()) //empty active hand and we're in throw mode
@@ -11,32 +27,42 @@
return 1
..()
-/mob/living/carbon/throw_impact(atom/hit_atom)
- . = ..()
- if(hit_atom.density && isturf(hit_atom))
- Weaken(1)
- take_organ_damage(10)
- if(iscarbon(hit_atom))
- var/mob/living/carbon/victim = hit_atom
- victim.Weaken(1)
- Weaken(1)
- victim.take_organ_damage(10)
- take_organ_damage(10)
- visible_message("[src] crashes into [victim], knocking them both over!", "You violently crash into [victim]!")
- playsound(src,'sound/weapons/punch1.ogg',50,1)
-/mob/living/carbon/attackby(obj/item/I, mob/user, params)
- if(lying && surgeries.len)
- if(user != src && user.a_intent == "help")
- for(var/datum/surgery/S in surgeries)
- if(S.next_step(user))
- return 1
- return ..()
+/mob/living/carbon/attacked_by(obj/item/I, mob/living/user)
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(user.zone_selected))
+ if(!affecting) //missing limb? we select the first bodypart (you can never have zero, because of chest)
+ affecting = bodyparts[1]
+ send_item_attack_message(I, user, affecting.name)
+ if(I.force)
+ apply_damage(I.force, I.damtype, affecting)
+ if(I.damtype == BRUTE && affecting.status == BODYPART_ORGANIC)
+ if(prob(33))
+ I.add_mob_blood(src)
+ var/turf/location = get_turf(src)
+ add_splatter_floor(location)
+ if(get_dist(user, src) <= 1) //people with TK won't get smeared with blood
+ user.add_mob_blood(src)
+ if(affecting.body_zone == "head")
+ if(wear_mask)
+ wear_mask.add_mob_blood(src)
+ update_inv_wear_mask()
+ if(head)
+ head.add_mob_blood(src)
+ update_inv_head()
+
+ //dismemberment
+ var/probability = I.get_dismemberment_chance(affecting)
+ if(prob(probability))
+ if(affecting.dismember(I.damtype))
+ I.add_mob_blood(src)
+ playsound(get_turf(src), I.get_dismember_sound(), 80, 1)
+ return TRUE //successful attack
+
+/mob/living/carbon/attack_drone(mob/living/simple_animal/drone/user)
+ return //so we don't call the carbon's attack_hand().
/mob/living/carbon/attack_hand(mob/living/carbon/human/user)
- if(!iscarbon(user))
- return
for(var/datum/disease/D in viruses)
if(D.IsSpreadByTouch())
@@ -55,9 +81,6 @@
/mob/living/carbon/attack_paw(mob/living/carbon/monkey/M)
- if(!istype(M, /mob/living/carbon))
- return 0
-
for(var/datum/disease/D in viruses)
if(D.IsSpreadByTouch())
M.ContractDisease(D)
@@ -101,20 +124,8 @@
updatehealth()
return 1
-/mob/living/carbon/proc/devour_mob(mob/living/carbon/C, devour_time = 130)
- C.visible_message("[src] is attempting to devour [C]!", \
- "[src] is attempting to devour you!")
- if(!do_mob(src, C, devour_time))
- return
- if(pulling && pulling == C && grab_state >= GRAB_AGGRESSIVE && a_intent == "grab")
- C.visible_message("[src] devours [C]!", \
- "[src] devours you!")
- C.forceMove(src)
- stomach_contents.Add(C)
- add_logs(src, C, "devoured")
-
/mob/living/carbon/proc/dismembering_strike(mob/living/attacker, dam_zone)
- if(!attacker.limb_destroyer || !has_limbs)
+ if(!attacker.limb_destroyer)
return dam_zone
var/obj/item/bodypart/affecting
if(dam_zone && attacker.client)
@@ -134,3 +145,136 @@
return null
return affecting.body_zone
return dam_zone
+
+
+/mob/living/carbon/blob_act(obj/effect/blob/B)
+ if (stat == DEAD)
+ return
+ else
+ show_message("The blob attacks!")
+ adjustBruteLoss(10)
+
+/mob/living/carbon/emp_act(severity)
+ for(var/X in internal_organs)
+ var/obj/item/organ/O = X
+ O.emp_act(severity)
+ ..()
+
+/mob/living/carbon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, override = 0, tesla_shock = 0)
+ shock_damage *= siemens_coeff
+ if(dna && dna.species)
+ shock_damage *= dna.species.siemens_coeff
+ if(shock_damage<1 && !override)
+ return 0
+ if(reagents.has_reagent("teslium"))
+ shock_damage *= 1.5 //If the mob has teslium in their body, shocks are 50% more damaging!
+ take_overall_damage(0,shock_damage)
+ visible_message(
+ "[src] was shocked by \the [source]!", \
+ "You feel a powerful shock coursing through your body!", \
+ "You hear a heavy electrical crack." \
+ )
+ jitteriness += 1000 //High numbers for violent convulsions
+ do_jitter_animation(jitteriness)
+ stuttering += 2
+ if(!tesla_shock || (tesla_shock && siemens_coeff > 0.5))
+ Stun(2)
+ spawn(20)
+ jitteriness = max(jitteriness - 990, 10) //Still jittery, but vastly less
+ if(!tesla_shock || (tesla_shock && siemens_coeff > 0.5))
+ Stun(3)
+ Weaken(3)
+ if(override)
+ return override
+ else
+ return shock_damage
+
+/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M)
+ if(on_fire)
+ M << "You can't put them out with just your bare hands!"
+ return
+
+ if(health >= 0 && !(status_flags & FAKEDEATH))
+
+ if(lying)
+ M.visible_message("[M] shakes [src] trying to get them up!", \
+ "You shake [src] trying to get them up!")
+ else
+ M.visible_message("[M] hugs [src] to make them feel better!", \
+ "You hug [src] to make them feel better!")
+ AdjustSleeping(-5)
+ AdjustParalysis(-3)
+ AdjustStunned(-3)
+ AdjustWeakened(-3)
+ if(resting)
+ resting = 0
+ update_canmove()
+
+ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+
+
+/mob/living/carbon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0)
+ . = ..()
+
+ var/damage = intensity - get_eye_protection()
+ if(.) // we've been flashed
+ if(visual)
+ return
+ if(weakeyes)
+ Stun(2)
+
+ if (damage == 1)
+ src << "Your eyes sting a little."
+ if(prob(40))
+ adjust_eye_damage(1)
+
+ else if (damage == 2)
+ src << "Your eyes burn."
+ adjust_eye_damage(rand(2, 4))
+
+ else if( damage > 3)
+ src << "Your eyes itch and burn severely!"
+ adjust_eye_damage(rand(12, 16))
+
+ if(eye_damage > 10)
+ blind_eyes(damage)
+ blur_eyes(damage * rand(3, 6))
+
+ if(eye_damage > 20)
+ if(prob(eye_damage - 20))
+ if(become_nearsighted())
+ src << "Your eyes start to burn badly!"
+ else if(prob(eye_damage - 25))
+ if(become_blind())
+ src << "You can't see anything!"
+ else
+ src << "Your eyes are really starting to hurt. This can't be good for you!"
+ if(has_bane(BANE_LIGHT))
+ mind.disrupt_spells(-500)
+ return 1
+ else if(damage == 0) // just enough protection
+ if(prob(20))
+ src << "Something bright flashes in the corner of your vision!"
+ if(has_bane(BANE_LIGHT))
+ mind.disrupt_spells(0)
+
+
+/mob/living/carbon/soundbang_act(intensity = 1, stun_pwr = 1, damage_pwr = 5, deafen_pwr = 15)
+ var/ear_safety = get_ear_protection()
+ if(ear_safety < 2) //has ears
+ var/effect_amount = intensity - ear_safety
+ if(effect_amount > 0)
+ if(stun_pwr)
+ Stun(stun_pwr*effect_amount)
+ Weaken(stun_pwr*effect_amount)
+ if(deafen_pwr || damage_pwr)
+ setEarDamage(ear_damage + damage_pwr*effect_amount, max(ear_deaf, deafen_pwr*effect_amount))
+ if (ear_damage >= 15)
+ src << "Your ears start to ring badly!"
+ if(prob(ear_damage - 5))
+ src << "You can't hear anything!"
+ disabilities |= DEAF
+ else if(ear_damage >= 5)
+ src << "Your ears start to ring!"
+ src << sound('sound/weapons/flash_ring.ogg',0,1,0,250)
+ return effect_amount //how soundbanged we are
diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm
index 103fcbe50d70..f73ad1053c12 100644
--- a/code/modules/mob/living/carbon/carbon_defines.dm
+++ b/code/modules/mob/living/carbon/carbon_defines.dm
@@ -16,6 +16,11 @@
var/obj/item/weapon/tank/internal = null
var/obj/item/head = null
+ var/obj/item/gloves = null //only used by humans
+ var/obj/item/shoes = null //only used by humans.
+ var/obj/item/clothing/glasses/glasses = null //only used by humans.
+ var/obj/item/ears = null //only used by humans.
+
var/datum/dna/dna = null//Carbon
var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
@@ -32,4 +37,8 @@
var/tinttotal = 0 // Total level of visualy impairing items
- var/list/bodyparts = list() //Gets filled up in the constructor (New() proc in human.dm and monkey.dm)
+ var/list/bodyparts = list(/obj/item/bodypart/chest, /obj/item/bodypart/head, /obj/item/bodypart/l_arm,
+ /obj/item/bodypart/r_arm, /obj/item/bodypart/r_leg, /obj/item/bodypart/l_leg)
+ //Gets filled up in create_bodyparts()
+
+ var/list/hand_bodyparts = list() //a collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems)
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/carbon_movement.dm b/code/modules/mob/living/carbon/carbon_movement.dm
index 479e9459c5c1..6b2e19c19592 100644
--- a/code/modules/mob/living/carbon/carbon_movement.dm
+++ b/code/modules/mob/living/carbon/carbon_movement.dm
@@ -1,6 +1,13 @@
/mob/living/carbon/movement_delay()
. = ..()
- . += grab_state * 3
+ . += grab_state * 3 //can't go fast while grabbing something.
+
+ if(!get_leg_ignore()) //ignore the fact we lack legs
+ var/leg_amount = get_num_legs()
+ . += 6 - 3*leg_amount //the fewer the legs, the slower the mob
+ if(!leg_amount)
+ . += 6 - 3*get_num_arms() //crawling is harder with fewer arms
+
if(legcuffed)
. += legcuffed.slowdown
diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm
new file mode 100644
index 000000000000..6da20373f62c
--- /dev/null
+++ b/code/modules/mob/living/carbon/damage_procs.dm
@@ -0,0 +1,191 @@
+
+
+/mob/living/carbon/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked = 0)
+ var/hit_percent = (100-blocked)/100
+ if(!damage || hit_percent <= 0)
+ return 0
+
+ var/obj/item/bodypart/BP = null
+ if(islimb(def_zone)) //we specified a bodypart object
+ BP = def_zone
+ else
+ if(!def_zone)
+ def_zone = ran_zone(def_zone)
+ BP = get_bodypart(check_zone(def_zone))
+ if(!BP)
+ BP = bodyparts[1]
+
+ switch(damagetype)
+ if(BRUTE)
+ if(BP)
+ if(BP.take_damage(damage * hit_percent, 0))
+ update_damage_overlays()
+ else //no bodypart, we deal damage with a more general method.
+ adjustBruteLoss(damage * hit_percent)
+ if(BURN)
+ if(BP)
+ if(BP.take_damage(0, damage * hit_percent))
+ update_damage_overlays()
+ else
+ adjustFireLoss(damage * hit_percent)
+ if(TOX)
+ adjustToxLoss(damage * hit_percent)
+ if(OXY)
+ adjustOxyLoss(damage * hit_percent)
+ if(CLONE)
+ adjustCloneLoss(damage * hit_percent)
+ if(STAMINA)
+ adjustStaminaLoss(damage * hit_percent)
+ return 1
+
+
+//These procs fetch a cumulative total damage from all bodyparts
+/mob/living/carbon/getBruteLoss()
+ var/amount = 0
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/BP = X
+ amount += BP.brute_dam
+ return amount
+
+/mob/living/carbon/getFireLoss()
+ var/amount = 0
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/BP = X
+ amount += BP.burn_dam
+ return amount
+
+
+/mob/living/carbon/adjustBruteLoss(amount, updating_health = 1)
+ if(status_flags & GODMODE)
+ return 0
+ if(amount > 0)
+ take_overall_damage(amount, 0)
+ else
+ heal_overall_damage(-amount, 0, 0, 1, updating_health)
+
+/mob/living/carbon/adjustFireLoss(amount)
+ if(status_flags & GODMODE)
+ return 0
+ if(amount > 0)
+ take_overall_damage(0, amount)
+ else
+ heal_overall_damage(0, -amount)
+
+
+/mob/living/carbon/adjustToxLoss(amount, updating_health=1)
+ if(has_dna() && TOXINLOVER in dna.species.specflags) //damage becomes healing and healing becomes damage
+ amount = -amount
+ if(amount > 0)
+ blood_volume -= 5*amount
+ else
+ blood_volume -= amount
+ return ..()
+
+////////////////////////////////////////////
+
+//Returns a list of damaged bodyparts
+/mob/living/carbon/proc/get_damaged_bodyparts(brute, burn)
+ var/list/obj/item/bodypart/parts = list()
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/BP = X
+ if((brute && BP.brute_dam) || (burn && BP.burn_dam))
+ parts += BP
+ return parts
+
+//Returns a list of damageable bodyparts
+/mob/living/carbon/proc/get_damageable_bodyparts()
+ var/list/obj/item/bodypart/parts = list()
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/BP = X
+ if(BP.brute_dam + BP.burn_dam < BP.max_damage)
+ parts += BP
+ return parts
+
+//Heals ONE bodypart randomly selected from damaged ones.
+//It automatically updates damage overlays if necessary
+//It automatically updates health status
+/mob/living/carbon/heal_bodypart_damage(brute, burn, only_robotic = 0, only_organic = 1)
+ var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute,burn)
+ if(!parts.len)
+ return
+ var/obj/item/bodypart/picked = pick(parts)
+ if(picked.heal_damage(brute, burn, only_robotic, only_organic))
+ update_damage_overlays()
+
+//Damages ONE bodypart randomly selected from damagable ones.
+//It automatically updates damage overlays if necessary
+//It automatically updates health status
+/mob/living/carbon/take_bodypart_damage(brute, burn)
+ var/list/obj/item/bodypart/parts = get_damageable_bodyparts()
+ if(!parts.len)
+ return
+ var/obj/item/bodypart/picked = pick(parts)
+ if(picked.take_damage(brute,burn))
+ update_damage_overlays()
+
+
+//Heal MANY bodyparts, in random order
+/mob/living/carbon/heal_overall_damage(brute, burn, only_robotic = 0, only_organic = 1, updating_health = 1)
+ var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute,burn)
+
+ var/update = 0
+ while(parts.len && (brute>0 || burn>0) )
+ var/obj/item/bodypart/picked = pick(parts)
+
+ var/brute_was = picked.brute_dam
+ var/burn_was = picked.burn_dam
+
+ update |= picked.heal_damage(brute,burn, only_robotic, only_organic, 0)
+
+ brute -= (brute_was-picked.brute_dam)
+ burn -= (burn_was-picked.burn_dam)
+
+ parts -= picked
+ if(updating_health)
+ updatehealth()
+ if(update)
+ update_damage_overlays()
+
+// damage MANY bodyparts, in random order
+/mob/living/carbon/take_overall_damage(brute, burn, updating_health = 1)
+ if(status_flags & GODMODE)
+ return //godmode
+
+ var/list/obj/item/bodypart/parts = get_damageable_bodyparts()
+ var/update = 0
+ while(parts.len && (brute>0 || burn>0) )
+ var/obj/item/bodypart/picked = pick(parts)
+ var/brute_per_part = round(brute/parts.len, 0.01)
+ var/burn_per_part = round(burn/parts.len, 0.01)
+
+ var/brute_was = picked.brute_dam
+ var/burn_was = picked.burn_dam
+
+
+ update |= picked.take_damage(brute_per_part,burn_per_part, 0)
+
+ brute -= (picked.brute_dam - brute_was)
+ burn -= (picked.burn_dam - burn_was)
+
+ parts -= picked
+ if(updating_health)
+ updatehealth()
+ if(update)
+ update_damage_overlays()
+
+
+
+/mob/living/carbon/adjustStaminaLoss(amount, updating_stamina = 1)
+ if(status_flags & GODMODE)
+ return 0
+ staminaloss = Clamp(staminaloss + amount, 0, maxHealth*2)
+ if(updating_stamina)
+ update_stamina()
+
+
+/mob/living/carbon/setStaminaLoss(amount, updating_stamina = 1)
+ if(status_flags & GODMODE)
+ return 0
+ staminaloss = amount
+ if(updating_stamina)
+ update_stamina()
diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm
index 3db1d738a964..f1a2a526a7aa 100644
--- a/code/modules/mob/living/carbon/death.dm
+++ b/code/modules/mob/living/carbon/death.dm
@@ -3,19 +3,43 @@
losebreath = 0
..()
-/mob/living/carbon/gib(no_brain, no_organs)
+/mob/living/carbon/gib(no_brain, no_organs, no_bodyparts)
for(var/mob/M in src)
if(M in stomach_contents)
stomach_contents.Remove(M)
- M.loc = loc
+ M.forceMove(loc)
visible_message("[M] bursts out of [src]!")
..()
-/mob/living/carbon/spill_organs(no_brain)
- for(var/obj/item/organ/I in internal_organs)
- if(no_brain && istype(I, /obj/item/organ/brain))
- continue
- if(I)
+/mob/living/carbon/spill_organs(no_brain, no_organs, no_bodyparts)
+ if(!no_bodyparts)
+ if(no_organs)//so the organs don't get transfered inside the bodyparts we'll drop.
+ for(var/X in internal_organs)
+ qdel(X)
+ else //we're going to drop all bodyparts except chest, so the only organs that needs spilling are those inside it.
+ for(var/X in internal_organs)
+ var/obj/item/organ/O = X
+ if(no_brain && istype(O, /obj/item/organ/brain))
+ qdel(O) //so the brain isn't transfered to the head when the head drops.
+ continue
+ var/org_zone = check_zone(O.zone) //both groin and chest organs.
+ if(org_zone == "chest")
+ O.Remove(src)
+ O.forceMove(get_turf(src))
+ O.throw_at_fast(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5)
+ else
+ for(var/X in internal_organs)
+ var/obj/item/organ/I = X
+ if(no_brain && istype(I, /obj/item/organ/brain))
+ qdel(I)
+ continue
I.Remove(src)
- I.loc = get_turf(src)
+ I.forceMove(get_turf(src))
I.throw_at_fast(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5)
+
+
+/mob/living/carbon/spread_bodyparts()
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/BP = X
+ BP.drop_limb()
+ BP.throw_at_fast(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5)
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/examine.dm b/code/modules/mob/living/carbon/examine.dm
index 1be55c38a125..61d30f7b8e9c 100644
--- a/code/modules/mob/living/carbon/examine.dm
+++ b/code/modules/mob/living/carbon/examine.dm
@@ -2,7 +2,7 @@
var/msg = "*---------*\nThis is \icon[src] \a [src]!\n"
if (handcuffed)
- msg += "It is \icon[src.handcuffed] handcuffed!\n"
+ msg += "It is \icon[src.handcuffed] handcuffed!\n"
if (head)
msg += "It has \icon[src.head] \a [src.head] on its head. \n"
if (wear_mask)
@@ -17,52 +17,65 @@
if (back)
msg += "It has \icon[src.back] \a [src.back] on its back.\n"
+ var/appears_dead = 0
if (stat == DEAD)
- msg += "It is limp and unresponsive, with no signs of life.\n"
- else
- msg += ""
- var/temp = getBruteLoss()
- if(temp)
- if (temp < 30)
- msg += "It has minor bruising.\n"
- else
- msg += "It has severe bruising!\n"
+ appears_dead = 1
+ if(getorgan(/obj/item/organ/brain))
+ msg += "It is limp and unresponsive, with no signs of life.\n"
+ else if(get_bodypart("head"))
+ msg += "It appears that it's brain is missing...\n"
- temp = getFireLoss()
- if(temp)
- if (temp < 30)
- msg += "It has minor burns.\n"
- else
- msg += "It has severe burns!\n"
+ var/list/missing = get_missing_limbs()
+ for(var/t in missing)
+ if(t=="head")
+ msg += "Its [parse_zone(t)] is missing!\n"
+ continue
+ msg += "<Its [parse_zone(t)] is missing!\n"
- temp = getCloneLoss()
- if(temp)
- if(getCloneLoss() < 30)
- msg += "It is slightly deformed.\n"
- else
- msg += "It is severely deformed.\n"
+ msg += ""
+ var/temp = getBruteLoss()
+ if(temp)
+ if (temp < 30)
+ msg += "It has minor bruising.\n"
+ else
+ msg += "It has severe bruising!\n"
- if(getBrainLoss() > 60)
- msg += "It seems to be clumsy and unable to think.\n"
+ temp = getFireLoss()
+ if(temp)
+ if (temp < 30)
+ msg += "It has minor burns.\n"
+ else
+ msg += "It has severe burns!\n"
- if(fire_stacks > 0)
- msg += "It's covered in something flammable.\n"
- if(fire_stacks < 0)
- msg += "It's soaked in water.\n"
+ temp = getCloneLoss()
+ if(temp)
+ if(getCloneLoss() < 30)
+ msg += "It is slightly deformed.\n"
+ else
+ msg += "It is severely deformed.\n"
- if(pulledby && pulledby.grab_state)
- msg += "It's restrained by [pulledby]'s grip.\n"
+ if(getBrainLoss() > 60)
+ msg += "It seems to be clumsy and unable to think.\n"
+ if(fire_stacks > 0)
+ msg += "It's covered in something flammable.\n"
+ if(fire_stacks < 0)
+ msg += "It's soaked in water.\n"
+
+ if(pulledby && pulledby.grab_state)
+ msg += "It's restrained by [pulledby]'s grip.\n"
+
+ msg += ""
+
+ if(!appears_dead)
if(stat == UNCONSCIOUS)
msg += "It isn't responding to anything around it; it seems to be asleep.\n"
- msg += ""
- if(digitalcamo)
- msg += "It is moving its body in an unnatural and blatantly unsimian manner.\n"
+ if(digitalcamo)
+ msg += "It is moving its body in an unnatural and blatantly unsimian manner.\n"
+
- if(!getorgan(/obj/item/organ/brain))
- msg += "It appears that it's brain is missing...\n"
msg += "*---------*"
- user << msg
\ No newline at end of file
+ user << msg
diff --git a/code/modules/mob/living/carbon/human/damage_procs.dm b/code/modules/mob/living/carbon/human/damage_procs.dm
new file mode 100644
index 000000000000..aa49718753f2
--- /dev/null
+++ b/code/modules/mob/living/carbon/human/damage_procs.dm
@@ -0,0 +1,5 @@
+
+
+/mob/living/carbon/human/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = 0)
+ // depending on the species, it will run the corresponding apply_damage code there
+ return dna.species.apply_damage(damage, damagetype, def_zone, blocked, src)
diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm
index d1b085ca3b94..83bf44f8e14a 100644
--- a/code/modules/mob/living/carbon/human/death.dm
+++ b/code/modules/mob/living/carbon/human/death.dm
@@ -4,8 +4,11 @@
/mob/living/carbon/human/dust_animation()
PoolOrNew(/obj/effect/overlay/temp/dust_animation, list(loc, "dust-h"))
-/mob/living/carbon/human/spawn_gibs()
- hgibs(loc, viruses, dna)
+/mob/living/carbon/human/spawn_gibs(with_bodyparts)
+ if(with_bodyparts)
+ new /obj/effect/gibspawner/human(loc, viruses, dna)
+ else
+ new /obj/effect/gibspawner/humanbodypartless(loc, viruses, dna)
/mob/living/carbon/human/spawn_dust()
new /obj/effect/decal/remains/human(loc)
@@ -40,21 +43,9 @@
set_species(/datum/species/skeleton)
return 1
-/mob/living/carbon/proc/ChangeToHusk()
- if(disabilities & HUSK)
- return
- disabilities |= HUSK
- status_flags |= DISFIGURED //makes them unknown without fucking up other stuff like admintools
- return 1
-
-/mob/living/carbon/human/ChangeToHusk()
- . = ..()
- if(.)
- update_hair()
- update_body()
/mob/living/carbon/proc/Drain()
- ChangeToHusk()
+ become_husk()
disabilities |= NOCLONE
blood_volume = 0
return 1
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 48f191b4e747..1c7a02138df7 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -3,7 +3,7 @@
real_name = "Unknown"
voice_name = "Unknown"
icon = 'icons/mob/human.dmi'
- icon_state = "caucasian1_m_s"
+ icon_state = "caucasian_m_s"
@@ -18,18 +18,7 @@
verbs += /mob/living/proc/lay_down
//initialize limbs first
- bodyparts = newlist(/obj/item/bodypart/chest, /obj/item/bodypart/head, /obj/item/bodypart/r_leg, /obj/item/bodypart/l_leg)
- var/obj/item/bodypart/l_arm/l_arm = new()
- var/obj/item/bodypart/r_arm/r_arm = new()
- bodyparts += l_arm
- bodyparts += r_arm
- l_arm.held_index = 1
- r_arm.held_index = 2
- hand_bodyparts += l_arm
- hand_bodyparts += r_arm
- for(var/X in bodyparts)
- var/obj/item/bodypart/O = X
- O.owner = src
+ create_bodyparts()
//initialize dna. for spawned humans; overwritten by other code
create_dna(src)
@@ -40,21 +29,7 @@
set_species(dna.species.type)
//initialise organs
- if(!(NOHUNGER in dna.species.specflags))
- internal_organs += new /obj/item/organ/appendix
-
- if(!(NOBREATH in dna.species.specflags))
- internal_organs += new /obj/item/organ/lungs
-
- if(!(NOBLOOD in dna.species.specflags))
- internal_organs += new /obj/item/organ/heart
-
- internal_organs += new /obj/item/organ/brain
-
- //Note: Additional organs are generated/replaced on the dna.species level
-
- for(var/obj/item/organ/I in internal_organs)
- I.Insert(src)
+ create_internal_organs()
martial_art = default_martial_art
@@ -62,6 +37,16 @@
..()
+/mob/living/carbon/human/create_internal_organs()
+ if(!(NOHUNGER in dna.species.specflags))
+ internal_organs += new /obj/item/organ/appendix
+ if(!(NOBREATH in dna.species.specflags))
+ internal_organs += new /obj/item/organ/lungs
+ if(!(NOBLOOD in dna.species.specflags))
+ internal_organs += new /obj/item/organ/heart
+ internal_organs += new /obj/item/organ/brain
+ ..()
+
/mob/living/carbon/human/OpenCraftingMenu()
handcrafting.ui_interact(src)
@@ -123,87 +108,6 @@
stat("*", "[D.name], Type: [D.spread_text], Stage: [D.stage]/[D.max_stages], Possible Cure: [D.cure_text]")
-/mob/living/carbon/human/ex_act(severity, ex_target)
- var/b_loss = null
- var/f_loss = null
- var/bomb_armor = getarmor(null, "bomb")
- if(istype(ex_target, /datum/spacevine_mutation) && isvineimmune(src))
- return
-
- switch (severity)
- if (1)
- b_loss += 500
- if (prob(bomb_armor))
- shred_clothing(1,150)
- var/atom/target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src)))
- throw_at(target, 200, 4)
- else
- gib()
- return
-
- if (2)
- b_loss += 60
-
- f_loss += 60
- if (prob(bomb_armor))
- b_loss = b_loss/1.5
- f_loss = f_loss/1.5
- shred_clothing(1,25)
- else
- shred_clothing(1,50)
-
- if (!istype(ears, /obj/item/clothing/ears/earmuffs))
- adjustEarDamage(30, 120)
- if (prob(70))
- Paralyse(10)
-
- if(3)
- b_loss += 30
- if (prob(bomb_armor))
- b_loss = b_loss/2
- if (!istype(ears, /obj/item/clothing/ears/earmuffs))
- adjustEarDamage(15,60)
- if (prob(50))
- Paralyse(10)
-
- take_overall_damage(b_loss,f_loss)
- //attempt to dismember bodyparts
- if(severity <= 2 || !bomb_armor)
- var/max_limb_loss = round(4/severity) //so you don't lose four limbs at severity 3.
- for(var/X in bodyparts)
- var/obj/item/bodypart/BP = X
- if(prob(50/severity) && !prob(getarmor(BP, "bomb")) && BP.body_zone != "head" && BP.body_zone != "chest")
- BP.brute_dam = BP.max_damage
- BP.dismember()
- max_limb_loss--
- if(!max_limb_loss)
- break
- ..()
-
-/mob/living/carbon/human/blob_act(obj/effect/blob/B)
- if(stat == DEAD)
- return
- show_message("The blob attacks you!")
- var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
- var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
- apply_damage(5, BRUTE, affecting, run_armor_check(affecting, "melee"))
- return
-
-/mob/living/carbon/human/bullet_act()
- if(martial_art && martial_art.deflection_chance) //Some martial arts users can deflect projectiles!
- if(!prob(martial_art.deflection_chance))
- return ..()
- if(!src.lying && dna && !dna.check_mutation(HULK)) //But only if they're not lying down, and hulks can't do it
- src.visible_message("[src] deflects the projectile; they can't be hit with ranged weapons!", "You deflect the projectile!")
- playsound(src, pick("sound/weapons/bulletflyby.ogg","sound/weapons/bulletflyby2.ogg","sound/weapons/bulletflyby3.ogg"), 75, 1)
- return 0
- ..()
-
-/mob/living/carbon/human/attack_ui(slot)
- if(!has_hand_for_held_index(active_hand_index))
- return 0
- return ..()
-
/mob/living/carbon/human/show_inv(mob/user)
user.set_machine(src)
var/has_breathable_mask = istype(wear_mask, /obj/item/clothing/mask)
@@ -300,35 +204,6 @@
spreadFire(AM)
-//Added a safety check in case you want to shock a human mob directly through electrocute_act.
-/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0)
- if(tesla_shock)
- var/total_coeff = 1
- if(gloves)
- var/obj/item/clothing/gloves/G = gloves
- if(G.siemens_coefficient <= 0)
- total_coeff -= 0.5
- if(wear_suit)
- var/obj/item/clothing/suit/S = wear_suit
- if(S.siemens_coefficient <= 0)
- total_coeff -= 0.95
- siemens_coeff = total_coeff
- else if(!safety)
- var/gloves_siemens_coeff = 1
- if(gloves)
- var/obj/item/clothing/gloves/G = gloves
- gloves_siemens_coeff = G.siemens_coefficient
- siemens_coeff = gloves_siemens_coeff
- if(heart_attack)
- if(shock_damage * siemens_coeff >= 1 && prob(25))
- heart_attack = 0
- if(stat == CONSCIOUS)
- src << "You feel your heart beating again!"
- . = ..(shock_damage,source,siemens_coeff,safety,override,tesla_shock)
- if(.)
- electrocution_animation(40)
-
-
/mob/living/carbon/human/Topic(href, href_list)
if(usr.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
@@ -734,17 +609,6 @@
update_body()
update_hair()
-/mob/living/carbon/human/singularity_act()
- var/gain = 20
- if(mind)
- if((mind.assigned_role == "Station Engineer") || (mind.assigned_role == "Chief Engineer") )
- gain = 100
- if(mind.assigned_role == "Clown")
- gain = rand(-300, 300)
- investigate_log("([key_name(src)]) has been consumed by the singularity.","singulo") //Oh that's where the clown ended up!
- gib()
- return(gain)
-
/mob/living/carbon/human/singularity_pull(S, current_size)
if(current_size >= STAGE_THREE)
for(var/obj/item/hand in held_items)
@@ -756,71 +620,6 @@
return
..()
-
-/mob/living/carbon/human/help_shake_act(mob/living/carbon/M)
- if(!istype(M))
- return
-
- if(health >= 0)
- if(src == M)
- visible_message( \
- "[src] examines \himself.", \
- "You check yourself for injuries.")
-
- var/list/missing = list("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg")
- for(var/X in bodyparts)
- var/obj/item/bodypart/LB = X
- missing -= LB.body_zone
- var/status = ""
- var/brutedamage = LB.brute_dam
- var/burndamage = LB.burn_dam
- if(hallucination)
- if(prob(30))
- brutedamage += rand(30,40)
- if(prob(30))
- burndamage += rand(30,40)
-
- if(brutedamage > 0)
- status = "bruised"
- if(brutedamage > 20)
- status = "battered"
- if(brutedamage > 40)
- status = "mangled"
- if(brutedamage > 0 && burndamage > 0)
- status += " and "
- if(burndamage > 40)
- status += "peeling away"
-
- else if(burndamage > 10)
- status += "blistered"
- else if(burndamage > 0)
- status += "numb"
- if(status == "")
- status = "OK"
- src << "\t [status == "OK" ? "\blue" : "\red"] Your [LB.name] is [status]."
-
- for(var/obj/item/I in LB.embedded_objects)
- src << "\t \red There is \a [I] embedded in your [LB.name]!"
-
- for(var/t in missing)
- src << "Your [parse_zone(t)] is missing!"
-
- if(bleed_rate)
- src << "You are bleeding!"
- if(staminaloss)
- if(staminaloss > 30)
- src << "You're completely exhausted."
- else
- src << "You feel fatigued."
- else
- if(wear_suit)
- wear_suit.add_fingerprint(M)
- else if(w_uniform)
- w_uniform.add_fingerprint(M)
-
- ..()
-
-
/mob/living/carbon/human/proc/do_cpr(mob/living/carbon/C)
CHECK_DNA_AND_SPECIES(C)
@@ -1010,7 +809,6 @@
hud_used.healthdoll.icon_state = "healthdoll_DEAD"
/mob/living/carbon/human/fully_heal(admin_revive = 0)
- CHECK_DNA_AND_SPECIES(src)
if(admin_revive)
regenerate_limbs()
diff --git a/code/modules/mob/living/carbon/human/human_attackalien.dm b/code/modules/mob/living/carbon/human/human_attackalien.dm
deleted file mode 100644
index b407a2881a93..000000000000
--- a/code/modules/mob/living/carbon/human/human_attackalien.dm
+++ /dev/null
@@ -1,39 +0,0 @@
-/mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M)
- if(check_shields(0, M.name))
- visible_message("[M] attempted to touch [src]!")
- return 0
-
- if(..())
- if(M.a_intent == "harm")
- if (w_uniform)
- w_uniform.add_fingerprint(M)
- var/damage = prob(90) ? 20 : 0
- if(!damage)
- playsound(loc, 'sound/weapons/slashmiss.ogg', 50, 1, -1)
- visible_message("[M] has lunged at [src]!", \
- "[M] has lunged at [src]!")
- return 0
- var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
- var/armor_block = run_armor_check(affecting, "melee","","",10)
-
- playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
- visible_message("[M] has slashed at [src]!", \
- "[M] has slashed at [src]!")
- if(!dismembering_strike(M, M.zone_selected)) //Dismemberment successful
- return 1
- apply_damage(damage, BRUTE, affecting, armor_block)
- add_logs(M, src, "attacked")
- updatehealth()
-
- if(M.a_intent == "disarm") //Always drop item in hand, if no item, get stunned instead.
- if(get_active_held_item() && drop_item())
- playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
- visible_message("[M] disarmed [src]!", \
- "[M] disarmed [src]!")
- else
- playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
- Weaken(5)
- add_logs(M, src, "tackled")
- visible_message("[M] has tackled down [src]!", \
- "[M] has tackled down [src]!")
- return
diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm
deleted file mode 100644
index 43e4dfaae761..000000000000
--- a/code/modules/mob/living/carbon/human/human_attackhand.dm
+++ /dev/null
@@ -1,14 +0,0 @@
-/mob/living/carbon/human/attack_hulk(mob/living/carbon/human/user)
- if(user.a_intent == "harm")
- ..(user, 1)
- playsound(loc, user.dna.species.attack_sound, 25, 1, -1)
- var/hulk_verb = pick("smash","pummel")
- visible_message("[user] has [hulk_verb]ed [src]!", \
- "[user] has [hulk_verb]ed [src]!")
- adjustBruteLoss(15)
- return 1
-
-/mob/living/carbon/human/attack_hand(mob/living/carbon/human/M)
- if(..()) //to allow surgery to return properly.
- return
- dna.species.spec_attack_hand(M, src)
diff --git a/code/modules/mob/living/carbon/human/human_attackpaw.dm b/code/modules/mob/living/carbon/human/human_attackpaw.dm
deleted file mode 100644
index 4c666a86799a..000000000000
--- a/code/modules/mob/living/carbon/human/human_attackpaw.dm
+++ /dev/null
@@ -1,18 +0,0 @@
-/mob/living/carbon/human/attack_paw(mob/living/carbon/monkey/M)
- var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
- var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
-
- if(M.a_intent == "help")
- ..() //shaking
- return 0
-
- if(M.limb_destroyer)
- dismembering_strike(M, affecting.body_zone)
-
- if(can_inject(M, 1, affecting))//Thick suits can stop monkey bites.
- if(..()) //successful monkey bite, this handles disease contraction.
- var/damage = rand(1, 3)
- if(stat != DEAD)
- apply_damage(damage, BRUTE, affecting, run_armor_check(affecting, "melee"))
- updatehealth()
- return 1
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm
deleted file mode 100644
index c218fbb84450..000000000000
--- a/code/modules/mob/living/carbon/human/human_damage.dm
+++ /dev/null
@@ -1,161 +0,0 @@
-//Updates the mob's health from bodyparts and mob damage variables
-/mob/living/carbon/human/updatehealth()
- if(status_flags & GODMODE)
- return
- var/total_burn = 0
- var/total_brute = 0
- for(var/X in bodyparts) //hardcoded to streamline things a bit
- var/obj/item/bodypart/BP = X
- total_brute += BP.brute_dam
- total_burn += BP.burn_dam
- health = maxHealth - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute
- update_stat()
- if(((maxHealth - total_burn) < HEALTH_THRESHOLD_DEAD) && stat == DEAD )
- ChangeToHusk()
- if(on_fire)
- shred_clothing()
- med_hud_set_health()
- med_hud_set_status()
-
-
-//These procs fetch a cumulative total damage from all bodyparts
-/mob/living/carbon/human/getBruteLoss()
- var/amount = 0
- for(var/X in bodyparts)
- var/obj/item/bodypart/BP = X
- amount += BP.brute_dam
- return amount
-
-/mob/living/carbon/human/getFireLoss()
- var/amount = 0
- for(var/X in bodyparts)
- var/obj/item/bodypart/BP = X
- amount += BP.burn_dam
- return amount
-
-
-/mob/living/carbon/human/adjustBruteLoss(amount)
- if(status_flags & GODMODE)
- return 0
- if(amount > 0)
- take_overall_damage(amount, 0)
- else
- heal_overall_damage(-amount, 0)
-
-/mob/living/carbon/human/adjustFireLoss(amount)
- if(status_flags & GODMODE)
- return 0
- if(amount > 0)
- take_overall_damage(0, amount)
- else
- heal_overall_damage(0, -amount)
-
-/mob/living/carbon/human/proc/hat_fall_prob()
- var/multiplier = 1
- var/obj/item/clothing/head/H = head
- var/loose = 40
- if(stat || (status_flags & FAKEDEATH))
- multiplier = 2
- if(H.flags_cover & (HEADCOVERSEYES | HEADCOVERSMOUTH) || H.flags_inv & (HIDEEYES | HIDEFACE))
- loose = 0
- return loose * multiplier
-
-////////////////////////////////////////////
-
-//Returns a list of damaged bodyparts
-/mob/living/carbon/human/proc/get_damaged_bodyparts(brute, burn)
- var/list/obj/item/bodypart/parts = list()
- for(var/X in bodyparts)
- var/obj/item/bodypart/BP = X
- if((brute && BP.brute_dam) || (burn && BP.burn_dam))
- parts += BP
- return parts
-
-//Returns a list of damageable bodyparts
-/mob/living/carbon/human/proc/get_damageable_bodyparts()
- var/list/obj/item/bodypart/parts = list()
- for(var/X in bodyparts)
- var/obj/item/bodypart/BP = X
- if(BP.brute_dam + BP.burn_dam < BP.max_damage)
- parts += BP
- return parts
-
-//Heals ONE external organ, organ gets randomly selected from damaged ones.
-//It automatically updates damage overlays if necesary
-//It automatically updates health status
-/mob/living/carbon/human/heal_organ_damage(brute, burn)
- var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute,burn)
- if(!parts.len)
- return
- var/obj/item/bodypart/picked = pick(parts)
- if(picked.heal_damage(brute,burn,0))
- update_damage_overlays(0)
- updatehealth()
-
-//Damages ONE external organ, organ gets randomly selected from damagable ones.
-//It automatically updates damage overlays if necesary
-//It automatically updates health status
-/mob/living/carbon/human/take_organ_damage(brute, burn)
- var/list/obj/item/bodypart/parts = get_damageable_bodyparts()
- if(!parts.len)
- return
- var/obj/item/bodypart/picked = pick(parts)
- if(picked.take_damage(brute,burn))
- update_damage_overlays(0)
- updatehealth()
-
-
-//Heal MANY bodyparts, in random order
-/mob/living/carbon/human/heal_overall_damage(brute, burn, updating_health=1)
- var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute,burn)
-
- var/update = 0
- while(parts.len && (brute>0 || burn>0) )
- var/obj/item/bodypart/picked = pick(parts)
-
- var/brute_was = picked.brute_dam
- var/burn_was = picked.burn_dam
-
- update |= picked.heal_damage(brute,burn,0)
-
- brute -= (brute_was-picked.brute_dam)
- burn -= (burn_was-picked.burn_dam)
-
- parts -= picked
- if(updating_health)
- updatehealth()
- if(update)
- update_damage_overlays(0)
-
-// damage MANY bodyparts, in random order
-/mob/living/carbon/human/take_overall_damage(brute, burn)
- if(status_flags & GODMODE)
- return //godmode
-
- var/list/obj/item/bodypart/parts = get_damageable_bodyparts()
- var/update = 0
- while(parts.len && (brute>0 || burn>0) )
- var/obj/item/bodypart/picked = pick(parts)
- var/brute_per_part = brute/parts.len
- var/burn_per_part = burn/parts.len
-
- var/brute_was = picked.brute_dam
- var/burn_was = picked.burn_dam
-
-
- update |= picked.take_damage(brute_per_part,burn_per_part)
-
- brute -= (picked.brute_dam - brute_was)
- burn -= (picked.burn_dam - burn_was)
-
- parts -= picked
- updatehealth()
- if(update)
- update_damage_overlays(0)
-
-////////////////////////////////////////////
-
-
-/mob/living/carbon/human/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = 0)
- // depending on the species, it will run the corresponding apply_damage code there
- return dna.species.apply_damage(damage, damagetype, def_zone, blocked, src)
diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm
index f19d05675654..535f7f39ffb8 100644
--- a/code/modules/mob/living/carbon/human/human_defense.dm
+++ b/code/modules/mob/living/carbon/human/human_defense.dm
@@ -31,10 +31,36 @@
protection += C.armor[type]
return protection
+///checkeyeprot()
+///Returns a number between -1 to 2
+/mob/living/carbon/human/get_eye_protection()
+ var/number = ..()
+ if(istype(src.head, /obj/item/clothing/head)) //are they wearing something on their head
+ var/obj/item/clothing/head/HFP = src.head //if yes gets the flash protection value from that item
+ number += HFP.flash_protect
+ if(istype(src.glasses, /obj/item/clothing/glasses)) //glasses
+ var/obj/item/clothing/glasses/GFP = src.glasses
+ number += GFP.flash_protect
+ if(istype(src.wear_mask, /obj/item/clothing/mask)) //mask
+ var/obj/item/clothing/mask/MFP = src.wear_mask
+ number += MFP.flash_protect
+ return number
+
+/mob/living/carbon/human/get_ear_protection()
+ if((ears && (ears.flags & EARBANGPROTECT)) || (head && (head.flags & HEADBANGPROTECT)))
+ return 1
+
/mob/living/carbon/human/on_hit(proj_type)
dna.species.on_hit(proj_type, src)
+
/mob/living/carbon/human/bullet_act(obj/item/projectile/P, def_zone)
+ if(martial_art && martial_art.deflection_chance) //Some martial arts users can deflect projectiles!
+ if(prob(martial_art.deflection_chance))
+ if(!lying && dna && !dna.check_mutation(HULK)) //But only if they're not lying down, and hulks can't do it
+ visible_message("[src] deflects the projectile; they can't be hit with ranged weapons!", "You deflect the projectile!")
+ playsound(src, pick("sound/weapons/bulletflyby.ogg","sound/weapons/bulletflyby2.ogg","sound/weapons/bulletflyby3.ogg"), 75, 1)
+ return 0
if(!(P.original == src && P.firer == src)) //can't block or reflect when shooting yourself
if(istype(P, /obj/item/projectile/energy) || istype(P, /obj/item/projectile/beam))
if(check_reflect(def_zone)) // Checks if you've passed a reflection% check
@@ -63,11 +89,6 @@
return (..(P , def_zone))
-/mob/living/check_projectile_dismemberment(obj/item/projectile/P, def_zone)
- var/obj/item/bodypart/affecting = get_bodypart(def_zone)
- if(affecting && affecting.get_damage() >= (affecting.max_damage - P.dismemberment))
- affecting.dismember(P.damtype)
-
/mob/living/carbon/human/proc/check_reflect(def_zone) //Reflection checks for anything in your l_hand, r_hand, or wear_suit based on the reflection chance of the object
if(wear_suit)
if(wear_suit.IsReflect(def_zone) == 1)
@@ -96,22 +117,309 @@
return 0
+/mob/living/carbon/human/hitby(atom/movable/AM, skipcatch = 0, hitpush = 1, blocked = 0)
+ var/obj/item/I
+ var/throwpower = 30
+ if(istype(AM, /obj/item))
+ I = AM
+ throwpower = I.throwforce
+ if(I.thrownby == src) //No throwing stuff at yourself to trigger hit reactions
+ return ..()
+ if(check_shields(throwpower, "\the [AM.name]", AM, THROWN_PROJECTILE_ATTACK))
+ hitpush = 0
+ skipcatch = 1
+ blocked = 1
+ else if(I)
+ if(I.throw_speed >= EMBED_THROWSPEED_THRESHOLD)
+ if(can_embed(I))
+ if(prob(I.embed_chance) && !(dna && (PIERCEIMMUNE in dna.species.specflags)))
+ throw_alert("embeddedobject", /obj/screen/alert/embeddedobject)
+ var/obj/item/bodypart/L = pick(bodyparts)
+ L.embedded_objects |= I
+ I.add_mob_blood(src)//it embedded itself in you, of course it's bloody!
+ I.loc = src
+ L.take_damage(I.w_class*I.embedded_impact_pain_multiplier)
+ visible_message("\the [I.name] embeds itself in [src]'s [L.name]!","\the [I.name] embeds itself in your [L.name]!")
+ hitpush = 0
+ skipcatch = 1 //can't catch the now embedded item
+
+ return ..()
+
+/mob/living/carbon/human/grabbedby(mob/living/carbon/user, supress_message = 0)
+ if(user == src && pulling && !pulling.anchored && grab_state >= GRAB_AGGRESSIVE && (disabilities & FAT) && ismonkey(pulling))
+ devour_mob(pulling)
+ else
+ ..()
+
+/mob/living/carbon/human/grippedby(mob/living/user)
+ if(w_uniform)
+ w_uniform.add_fingerprint(user)
+ ..()
+
+
/mob/living/carbon/human/attacked_by(obj/item/I, mob/living/user)
if(!I || !user)
return 0
- var/obj/item/bodypart/affecting = get_bodypart(ran_zone(user.zone_selected))
- var/target_area = parse_zone(check_zone(user.zone_selected))
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(user.zone_selected)) //what we're actually ending up trying to hit.
+ var/target_area = parse_zone(check_zone(user.zone_selected)) //our intended target
feedback_add_details("item_used_for_combat","[I.type]|[I.force]")
feedback_add_details("zone_targeted","[target_area]")
// the attacked_by code varies among species
- return dna.species.spec_attacked_by(I, user, affecting, a_intent, target_area, src)
+ return dna.species.spec_attacked_by(I, user, affecting, a_intent, src)
+
+
+/mob/living/carbon/human/attack_hulk(mob/living/carbon/human/user)
+ if(user.a_intent == "harm")
+ ..(user, 1)
+ playsound(loc, user.dna.species.attack_sound, 25, 1, -1)
+ var/hulk_verb = pick("smash","pummel")
+ visible_message("[user] has [hulk_verb]ed [src]!", \
+ "[user] has [hulk_verb]ed [src]!")
+ adjustBruteLoss(15)
+ return 1
+
+/mob/living/carbon/human/attack_hand(mob/living/carbon/human/M)
+ if(..()) //to allow surgery to return properly.
+ return
+ dna.species.spec_attack_hand(M, src)
+
+
+/mob/living/carbon/human/attack_paw(mob/living/carbon/monkey/M)
+ var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
+
+ if(M.a_intent == "help")
+ ..() //shaking
+ return 0
+
+ if(M.limb_destroyer)
+ dismembering_strike(M, affecting.body_zone)
+
+ if(can_inject(M, 1, affecting))//Thick suits can stop monkey bites.
+ if(..()) //successful monkey bite, this handles disease contraction.
+ var/damage = rand(1, 3)
+ if(stat != DEAD)
+ apply_damage(damage, BRUTE, affecting, run_armor_check(affecting, "melee"))
+ return 1
+
+/mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M)
+ if(check_shields(0, M.name))
+ visible_message("[M] attempted to touch [src]!")
+ return 0
+
+ if(..())
+ if(M.a_intent == "harm")
+ if (w_uniform)
+ w_uniform.add_fingerprint(M)
+ var/damage = prob(90) ? 20 : 0
+ if(!damage)
+ playsound(loc, 'sound/weapons/slashmiss.ogg', 50, 1, -1)
+ visible_message("[M] has lunged at [src]!", \
+ "[M] has lunged at [src]!")
+ return 0
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
+ var/armor_block = run_armor_check(affecting, "melee","","",10)
+
+ playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
+ visible_message("[M] has slashed at [src]!", \
+ "[M] has slashed at [src]!")
+ add_logs(M, src, "attacked")
+ if(!dismembering_strike(M, M.zone_selected)) //Dismemberment successful
+ return 1
+ apply_damage(damage, BRUTE, affecting, armor_block)
+
+ if(M.a_intent == "disarm") //Always drop item in hand, if no item, get stunned instead.
+ if(get_active_held_item() && drop_item())
+ playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
+ visible_message("[M] disarmed [src]!", \
+ "[M] disarmed [src]!")
+ else
+ playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
+ Weaken(5)
+ add_logs(M, src, "tackled")
+ visible_message("[M] has tackled down [src]!", \
+ "[M] has tackled down [src]!")
+
+
+/mob/living/carbon/human/attack_larva(mob/living/carbon/alien/larva/L)
+
+ if(..()) //successful larva bite.
+ var/damage = rand(1, 3)
+ if(check_shields(damage, "the [L.name]"))
+ return 0
+ if(stat != DEAD)
+ L.amount_grown = min(L.amount_grown + damage, L.max_grown)
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(L.zone_selected))
+ var/armor_block = run_armor_check(affecting, "melee")
+ apply_damage(damage, BRUTE, affecting, armor_block)
+
+
+/mob/living/carbon/human/attack_animal(mob/living/simple_animal/M)
+ if(..())
+ var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
+ if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK, M.armour_penetration))
+ return 0
+ var/dam_zone = dismembering_strike(M, pick("chest", "l_hand", "r_hand", "l_leg", "r_leg"))
+ if(!dam_zone) //Dismemberment successful
+ return 1
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
+ var/armor = run_armor_check(affecting, "melee", armour_penetration = M.armour_penetration)
+ apply_damage(damage, M.melee_damage_type, affecting, armor)
+
+
+
+/mob/living/carbon/human/attack_slime(mob/living/simple_animal/slime/M)
+ if(..()) //successful slime attack
+ var/damage = rand(5, 25)
+ if(M.is_adult)
+ damage = rand(10, 35)
+
+ if(check_shields(damage, "the [M.name]"))
+ return 0
+
+ var/dam_zone = dismembering_strike(M, pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg"))
+ if(!dam_zone) //Dismemberment successful
+ return 1
+
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
+ var/armor_block = run_armor_check(affecting, "melee")
+ apply_damage(damage, BRUTE, affecting, armor_block)
+
+/mob/living/carbon/human/mech_melee_attack(obj/mecha/M)
+
+ if(M.occupant.a_intent == "harm")
+ M.do_attack_animation(src)
+ if(M.damtype == "brute")
+ step_away(src,M,15)
+ var/obj/item/bodypart/temp = get_bodypart(pick("chest", "chest", "chest", "head"))
+ if(temp)
+ var/update = 0
+ switch(M.damtype)
+ if("brute")
+ if(M.force > 20)
+ Paralyse(1)
+ update |= temp.take_damage(rand(M.force/2, M.force), 0)
+ playsound(src, 'sound/weapons/punch4.ogg', 50, 1)
+ if("fire")
+ update |= temp.take_damage(0, rand(M.force/2, M.force))
+ playsound(src, 'sound/items/Welder.ogg', 50, 1)
+ if("tox")
+ M.mech_toxin_damage(src)
+ else
+ return
+ if(update)
+ update_damage_overlays()
+ updatehealth()
+
+ visible_message("[M.name] has hit [src]!", \
+ "[M.name] has hit [src]!")
+ add_logs(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])")
+
+ else
+ ..()
+
+
+/mob/living/carbon/human/ex_act(severity, ex_target)
+ var/b_loss = null
+ var/f_loss = null
+ var/bomb_armor = getarmor(null, "bomb")
+ if(istype(ex_target, /datum/spacevine_mutation) && isvineimmune(src))
+ return
+
+ switch (severity)
+ if (1)
+ b_loss += 500
+ if (prob(bomb_armor))
+ shred_clothing(1,150)
+ var/atom/target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src)))
+ throw_at(target, 200, 4)
+ else
+ gib()
+ return
+
+ if (2)
+ b_loss += 60
+
+ f_loss += 60
+ if (prob(bomb_armor))
+ b_loss = b_loss/1.5
+ f_loss = f_loss/1.5
+ shred_clothing(1,25)
+ else
+ shred_clothing(1,50)
+
+ if (!istype(ears, /obj/item/clothing/ears/earmuffs))
+ adjustEarDamage(30, 120)
+ if (prob(70))
+ Paralyse(10)
+
+ if(3)
+ b_loss += 30
+ if (prob(bomb_armor))
+ b_loss = b_loss/2
+ if (!istype(ears, /obj/item/clothing/ears/earmuffs))
+ adjustEarDamage(15,60)
+ if (prob(50))
+ Paralyse(8)
+
+ take_overall_damage(b_loss,f_loss)
+ //attempt to dismember bodyparts
+ if(severity <= 2 || !bomb_armor)
+ var/max_limb_loss = round(4/severity) //so you don't lose four limbs at severity 3.
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/BP = X
+ if(prob(50/severity) && !prob(getarmor(BP, "bomb")) && BP.body_zone != "head" && BP.body_zone != "chest")
+ BP.brute_dam = BP.max_damage
+ BP.dismember()
+ max_limb_loss--
+ if(!max_limb_loss)
+ break
+ ..()
+
+/mob/living/carbon/human/blob_act(obj/effect/blob/B)
+ if(stat == DEAD)
+ return
+ show_message("The blob attacks you!")
+ var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
+ apply_damage(5, BRUTE, affecting, run_armor_check(affecting, "melee"))
+
+
+//Added a safety check in case you want to shock a human mob directly through electrocute_act.
+/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0)
+ if(tesla_shock)
+ var/total_coeff = 1
+ if(gloves)
+ var/obj/item/clothing/gloves/G = gloves
+ if(G.siemens_coefficient <= 0)
+ total_coeff -= 0.5
+ if(wear_suit)
+ var/obj/item/clothing/suit/S = wear_suit
+ if(S.siemens_coefficient <= 0)
+ total_coeff -= 0.95
+ siemens_coeff = total_coeff
+ else if(!safety)
+ var/gloves_siemens_coeff = 1
+ if(gloves)
+ var/obj/item/clothing/gloves/G = gloves
+ gloves_siemens_coeff = G.siemens_coefficient
+ siemens_coeff = gloves_siemens_coeff
+ if(heart_attack)
+ if(shock_damage * siemens_coeff >= 1 && prob(25))
+ heart_attack = 0
+ if(stat == CONSCIOUS)
+ src << "You feel your heart beating again!"
+ . = ..(shock_damage,source,siemens_coeff,safety,override,tesla_shock)
+ if(.)
+ electrocution_animation(40)
+
/mob/living/carbon/human/emp_act(severity)
var/informed = 0
for(var/obj/item/bodypart/L in src.bodyparts)
- if(L.status == ORGAN_ROBOTIC)
+ if(L.status == BODYPART_ROBOTIC)
if(!informed)
src << "You feel a sharp pain as your robotic limbs overload."
informed = 1
@@ -264,123 +572,76 @@
acid_volume_left = max(acid_volume_left - acid_decay, 0)
-/mob/living/carbon/human/attack_animal(mob/living/simple_animal/M)
- if(..())
- var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
- if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK, M.armour_penetration))
- return 0
- var/dam_zone = dismembering_strike(M, pick("chest", "l_hand", "r_hand", "l_leg", "r_leg"))
- if(!dam_zone) //Dismemberment successful
- return 1
- var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
- var/armor = run_armor_check(affecting, "melee", armour_penetration = M.armour_penetration)
- apply_damage(damage, M.melee_damage_type, affecting, armor)
- updatehealth()
+/mob/living/carbon/human/singularity_act()
+ var/gain = 20
+ if(mind)
+ if((mind.assigned_role == "Station Engineer") || (mind.assigned_role == "Chief Engineer") )
+ gain = 100
+ if(mind.assigned_role == "Clown")
+ gain = rand(-300, 300)
+ investigate_log("([key_name(src)]) has been consumed by the singularity.","singulo") //Oh that's where the clown ended up!
+ gib()
+ return(gain)
+/mob/living/carbon/human/help_shake_act(mob/living/carbon/M)
+ if(!istype(M))
+ return
-/mob/living/carbon/human/attack_larva(mob/living/carbon/alien/larva/L)
+ if(health >= 0)
+ if(src == M)
+ visible_message( \
+ "[src] examines \himself.", \
+ "You check yourself for injuries.")
- if(..()) //successful larva bite.
- var/damage = rand(1, 3)
- if(check_shields(damage, "the [L.name]"))
- return 0
- if(stat != DEAD)
- L.amount_grown = min(L.amount_grown + damage, L.max_grown)
- var/obj/item/bodypart/affecting = get_bodypart(ran_zone(L.zone_selected))
- var/armor_block = run_armor_check(affecting, "melee")
- apply_damage(damage, BRUTE, affecting, armor_block)
- updatehealth()
+ var/list/missing = list("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg")
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/LB = X
+ missing -= LB.body_zone
+ var/status = ""
+ var/brutedamage = LB.brute_dam
+ var/burndamage = LB.burn_dam
+ if(hallucination)
+ if(prob(30))
+ brutedamage += rand(30,40)
+ if(prob(30))
+ burndamage += rand(30,40)
+ if(brutedamage > 0)
+ status = "bruised"
+ if(brutedamage > 20)
+ status = "battered"
+ if(brutedamage > 40)
+ status = "mangled"
+ if(brutedamage > 0 && burndamage > 0)
+ status += " and "
+ if(burndamage > 40)
+ status += "peeling away"
-/mob/living/carbon/human/attack_slime(mob/living/simple_animal/slime/M)
- if(..()) //successful slime attack
- var/damage = rand(5, 25)
- if(M.is_adult)
- damage = rand(10, 35)
+ else if(burndamage > 10)
+ status += "blistered"
+ else if(burndamage > 0)
+ status += "numb"
+ if(status == "")
+ status = "OK"
+ src << "\t [status == "OK" ? "\blue" : "\red"] Your [LB.name] is [status]."
- if(check_shields(damage, "the [M.name]"))
- return 0
+ for(var/obj/item/I in LB.embedded_objects)
+ src << "\t \red There is \a [I] embedded in your [LB.name]!"
- var/dam_zone = dismembering_strike(M, pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg"))
- if(!dam_zone) //Dismemberment successful
- return 1
+ for(var/t in missing)
+ src << "Your [parse_zone(t)] is missing!"
- var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
- var/armor_block = run_armor_check(affecting, "melee")
- apply_damage(damage, BRUTE, affecting, armor_block)
-
-/mob/living/carbon/human/mech_melee_attack(obj/mecha/M)
-
- if(M.occupant.a_intent == "harm")
- M.do_attack_animation(src)
- if(M.damtype == "brute")
- step_away(src,M,15)
- var/obj/item/bodypart/temp = get_bodypart(pick("chest", "chest", "chest", "head"))
- if(temp)
- var/update = 0
- switch(M.damtype)
- if("brute")
- if(M.force > 20)
- Paralyse(1)
- update |= temp.take_damage(rand(M.force/2, M.force), 0)
- playsound(src, 'sound/weapons/punch4.ogg', 50, 1)
- if("fire")
- update |= temp.take_damage(0, rand(M.force/2, M.force))
- playsound(src, 'sound/items/Welder.ogg', 50, 1)
- if("tox")
- M.mech_toxin_damage(src)
+ if(bleed_rate)
+ src << "You are bleeding!"
+ if(staminaloss)
+ if(staminaloss > 30)
+ src << "You're completely exhausted."
else
- return
- if(update)
- update_damage_overlays(0)
- updatehealth()
+ src << "You feel fatigued."
+ else
+ if(wear_suit)
+ wear_suit.add_fingerprint(M)
+ else if(w_uniform)
+ w_uniform.add_fingerprint(M)
- visible_message("[M.name] has hit [src]!", \
- "[M.name] has hit [src]!")
- add_logs(M.occupant, src, "attacked", M, "(INTENT: [uppertext(M.occupant.a_intent)]) (DAMTYPE: [uppertext(M.damtype)])")
-
- else
- ..()
-
-/mob/living/carbon/human/hitby(atom/movable/AM, skipcatch = 0, hitpush = 1, blocked = 0)
- var/obj/item/I
- var/throwpower = 30
- if(istype(AM, /obj/item))
- I = AM
- throwpower = I.throwforce
- if(I.thrownby == src) //No throwing stuff at yourself to trigger hit reactions
- return ..()
- if(check_shields(throwpower, "\the [AM.name]", AM, THROWN_PROJECTILE_ATTACK))
- hitpush = 0
- skipcatch = 1
- blocked = 1
- else if(I)
- if(I.throw_speed >= EMBED_THROWSPEED_THRESHOLD)
- if(can_embed(I))
- if(prob(I.embed_chance) && !(dna && (PIERCEIMMUNE in dna.species.specflags)))
- throw_alert("embeddedobject", /obj/screen/alert/embeddedobject)
- var/obj/item/bodypart/L = pick(bodyparts)
- L.embedded_objects |= I
- I.add_mob_blood(src)//it embedded itself in you, of course it's bloody!
- I.loc = src
- L.take_damage(I.w_class*I.embedded_impact_pain_multiplier)
- visible_message("\the [I.name] embeds itself in [src]'s [L.name]!","\the [I.name] embeds itself in your [L.name]!")
- hitpush = 0
- skipcatch = 1 //can't catch the now embedded item
-
- return ..()
-
-/mob/living/carbon/human/grabbedby(mob/living/carbon/user, supress_message = 0)
- if(user == src && pulling && !pulling.anchored && grab_state >= GRAB_AGGRESSIVE && (disabilities & FAT) && ismonkey(pulling))
- devour_mob(pulling)
- else
- ..()
-
-/mob/living/carbon/human/grippedby(mob/living/user)
- if(w_uniform)
- w_uniform.add_fingerprint(user)
- ..()
-
-/mob/living/carbon/human/Stun(amount, updating_canmove = 1)
- amount = dna.species.spec_stun(src,amount)
- ..()
\ No newline at end of file
+ ..()
diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm
index 2bccce619fa1..abf9dffc00c9 100644
--- a/code/modules/mob/living/carbon/human/human_defines.dm
+++ b/code/modules/mob/living/carbon/human/human_defines.dm
@@ -30,11 +30,7 @@ var/global/default_martial_art = new/datum/martial_art
//Equipment slots
var/obj/item/wear_suit = null
var/obj/item/w_uniform = null
- var/obj/item/shoes = null
var/obj/item/belt = null
- var/obj/item/gloves = null
- var/obj/item/clothing/glasses/glasses = null
- var/obj/item/ears = null
var/obj/item/wear_id = null
var/obj/item/r_store = null
var/obj/item/l_store = null
@@ -53,5 +49,3 @@ var/global/default_martial_art = new/datum/martial_art
var/drunkenness = 0 //Overall drunkenness - check handle_alcohol() in life.dm for effects
var/datum/personal_crafting/handcrafting
-
- var/list/hand_bodyparts = list() //a collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems)
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm
index 69863d41b9b4..984260604620 100644
--- a/code/modules/mob/living/carbon/human/human_helpers.dm
+++ b/code/modules/mob/living/carbon/human/human_helpers.dm
@@ -81,24 +81,6 @@
if(wear_id)
return wear_id.GetID()
-///checkeyeprot()
-///Returns a number between -1 to 2
-/mob/living/carbon/human/check_eye_prot()
- var/number = ..()
- if(istype(src.head, /obj/item/clothing/head)) //are they wearing something on their head
- var/obj/item/clothing/head/HFP = src.head //if yes gets the flash protection value from that item
- number += HFP.flash_protect
- if(istype(src.glasses, /obj/item/clothing/glasses)) //glasses
- var/obj/item/clothing/glasses/GFP = src.glasses
- number += GFP.flash_protect
- if(istype(src.wear_mask, /obj/item/clothing/mask)) //mask
- var/obj/item/clothing/mask/MFP = src.wear_mask
- number += MFP.flash_protect
- return number
-
-/mob/living/carbon/human/check_ear_prot()
- if((ears && (ears.flags & EARBANGPROTECT)) || (head && (head.flags & HEADBANGPROTECT)))
- return 1
/mob/living/carbon/human/abiotic(full_body = 0)
var/abiotic_hands = FALSE
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index cf9504df7102..3283e04d22ee 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -200,7 +200,16 @@
//Cycles through all clothing slots and tests them for destruction
-/mob/living/carbon/human/proc/shred_clothing(bomb,shock)
+/mob/living/carbon/proc/shred_clothing(bomb,shock)
+ if(back)
+ back.shred(bomb,shock-20,src)
+ if(head)
+ head.shred(bomb,shock,src)
+ if(wear_mask)
+ wear_mask.shred(bomb,shock,src)
+
+
+/mob/living/carbon/human/shred_clothing(bomb,shock)
var/covered_parts = 0 //The body parts that are protected by exterior clothing/armor
var/head_absorbed = 0 //How much of the shock the headgear absorbs when it is shredded. -1=it survives
var/suit_absorbed = 0 //How much of the shock the exosuit absorbs when it is shredded. -1=it survives
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index 619e9a7e139d..852a19fd1ab2 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -54,7 +54,7 @@
var/punchdamagehigh = 9 //highest possible punch damage
var/punchstunthreshold = 9//damage at which punches from this race will stun //yes it should be to the attacked race but it's not useful that way even if it's logical
var/siemens_coeff = 1 //base electrocution coefficient
- var/exotic_damage_overlay = ""
+ var/damage_overlay_type = "human" //what kind of damage overlays (if any) appear on our species when wounded?
var/fixed_mut_color = "" //to use MUTCOLOR with a fixed color that's independent of dna.feature["mcolor"]
var/invis_sight = SEE_INVISIBLE_LIVING
@@ -132,8 +132,6 @@
var/obj/item/thing = C.get_item_by_slot(slot_id)
if(thing && (!thing.species_exception || !is_type_in_list(src,thing.species_exception)))
C.unEquip(thing)
- if(NODISMEMBER in specflags)
- C.regenerate_limbs() //if we don't handle dismemberment, we grow our missing limbs back
var/obj/item/organ/heart/heart = C.getorganslot("heart")
var/obj/item/organ/lungs/lungs = C.getorganslot("lungs")
@@ -226,7 +224,8 @@
hair_hidden = 1
if(!hair_hidden)
if(!H.getorgan(/obj/item/organ/brain)) //Applies the debrained overlay if there is no brain
- standing += image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s", "layer" = -HAIR_LAYER)
+ if(!(NOBLOOD in specflags))
+ standing += image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s", "layer" = -HAIR_LAYER)
else if(H.hair_style && (HAIR in specflags))
S = hair_styles_list[H.hair_style]
@@ -263,17 +262,18 @@
var/obj/item/bodypart/head/HD = H.get_bodypart("head")
- // lipstick
- if(H.lip_style && (LIPS in specflags) && HD)
- var/image/lips = image("icon"='icons/mob/human_face.dmi', "icon_state"="lips_[H.lip_style]_s", "layer" = -BODY_LAYER)
- lips.color = H.lip_color
- standing += lips
+ if(!(H.disabilities & HUSK))
+ // lipstick
+ if(H.lip_style && (LIPS in specflags) && HD)
+ var/image/lips = image("icon"='icons/mob/human_face.dmi', "icon_state"="lips_[H.lip_style]_s", "layer" = -BODY_LAYER)
+ lips.color = H.lip_color
+ standing += lips
- // eyes
- if((EYECOLOR in specflags) && HD)
- var/image/img_eyes_s = image("icon" = 'icons/mob/human_face.dmi', "icon_state" = "[eyes]_s", "layer" = -BODY_LAYER)
- img_eyes_s.color = "#" + H.eye_color
- standing += img_eyes_s
+ // eyes
+ if((EYECOLOR in specflags) && HD)
+ var/image/img_eyes_s = image("icon" = 'icons/mob/human_face.dmi', "icon_state" = "[eyes]_s", "layer" = -BODY_LAYER)
+ img_eyes_s.color = "#" + H.eye_color
+ standing += img_eyes_s
//Underwear, Undershirts & Socks
if(H.underwear)
@@ -346,19 +346,19 @@
bodyparts_to_add -= "waggingspines"
if("snout" in mutant_bodyparts) //Take a closer look at that snout!
- if((H.wear_mask && (H.wear_mask.flags_inv & HIDEFACE)) || (H.head && (H.head.flags_inv & HIDEFACE)) || !HD || HD.status == ORGAN_ROBOTIC)
+ if((H.wear_mask && (H.wear_mask.flags_inv & HIDEFACE)) || (H.head && (H.head.flags_inv & HIDEFACE)) || !HD || HD.status == BODYPART_ROBOTIC)
bodyparts_to_add -= "snout"
if("frills" in mutant_bodyparts)
- if(!H.dna.features["frills"] || H.dna.features["frills"] == "None" || H.head && (H.head.flags_inv & HIDEEARS) || !HD || HD.status == ORGAN_ROBOTIC)
+ if(!H.dna.features["frills"] || H.dna.features["frills"] == "None" || H.head && (H.head.flags_inv & HIDEEARS) || !HD || HD.status == BODYPART_ROBOTIC)
bodyparts_to_add -= "frills"
if("horns" in mutant_bodyparts)
- if(!H.dna.features["horns"] || H.dna.features["horns"] == "None" || H.head && (H.head.flags_inv & HIDEHAIR) || (H.wear_mask && (H.wear_mask.flags_inv & HIDEHAIR)) || !HD || HD.status == ORGAN_ROBOTIC)
+ if(!H.dna.features["horns"] || H.dna.features["horns"] == "None" || H.head && (H.head.flags_inv & HIDEHAIR) || (H.wear_mask && (H.wear_mask.flags_inv & HIDEHAIR)) || !HD || HD.status == BODYPART_ROBOTIC)
bodyparts_to_add -= "horns"
if("ears" in mutant_bodyparts)
- if(!H.dna.features["ears"] || H.dna.features["ears"] == "None" || H.head && (H.head.flags_inv & HIDEHAIR) || (H.wear_mask && (H.wear_mask.flags_inv & HIDEHAIR)) || !HD || HD.status == ORGAN_ROBOTIC)
+ if(!H.dna.features["ears"] || H.dna.features["ears"] == "None" || H.head && (H.head.flags_inv & HIDEHAIR) || (H.wear_mask && (H.wear_mask.flags_inv & HIDEHAIR)) || !HD || HD.status == BODYPART_ROBOTIC)
bodyparts_to_add -= "ears"
if("wings" in mutant_bodyparts)
@@ -830,7 +830,7 @@
if(75 to 100)
if(prob(1))
H << "You mutate!"
- randmutb(H)
+ H.randmutb()
H.emote("gasp")
H.domutcheck()
return 0
@@ -894,13 +894,6 @@
if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT)
. += (BODYTEMP_COLD_DAMAGE_LIMIT - H.bodytemperature) / COLD_SLOWDOWN_FACTOR
- if(!(FLYING in specflags))
- var/leg_amount = H.get_num_legs()
- . += 6 - 3*leg_amount //the fewer the legs, the slower the mob
- if(!leg_amount)
- . += 6 - 3*H.get_num_arms() //crawling is harder with fewer arms
-
-
. += speedmod
//////////////////
@@ -1027,10 +1020,9 @@
"[M] attemped to disarm [H]!")
return
-/datum/species/proc/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, target_area, mob/living/carbon/human/H)
+/datum/species/proc/spec_attacked_by(obj/item/I, mob/living/user, obj/item/bodypart/affecting, intent, mob/living/carbon/human/H)
// Allows you to put in item-specific reactions based on species
if(user != H)
- user.do_attack_animation(H)
if(H.check_shields(I.force, "the [I.name]", I, MELEE_ATTACK, I.armour_penetration))
return 0
@@ -1062,7 +1054,7 @@
var/bloody = 0
if(((I.damtype == BRUTE) && I.force && prob(25 + (I.force * 2))))
- if(affecting.status == ORGAN_ORGANIC)
+ if(affecting.status == BODYPART_ORGANIC)
I.add_mob_blood(H) //Make the weapon bloody, not the person.
if(prob(I.force * 2)) //blood spatter!
bloody = 1
@@ -1112,39 +1104,43 @@
return TRUE
/datum/species/proc/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked, mob/living/carbon/human/H)
- blocked = (100-(blocked+armor))/100
- if(!damage || blocked <= 0)
+ var/hit_percent = (100-(blocked+armor))/100
+ if(!damage || hit_percent <= 0)
return 0
- var/obj/item/bodypart/organ = null
+ var/obj/item/bodypart/BP = null
if(islimb(def_zone))
- organ = def_zone
+ BP = def_zone
else
if(!def_zone)
def_zone = ran_zone(def_zone)
- organ = H.get_bodypart(check_zone(def_zone))
- if(!organ)
- return 0
-
- damage = (damage * blocked)
+ BP = H.get_bodypart(check_zone(def_zone))
+ if(!BP)
+ BP = H.bodyparts[1]
switch(damagetype)
if(BRUTE)
H.damageoverlaytemp = 20
- if(organ.take_damage(damage*brutemod, 0))
- H.update_damage_overlays(0)
+ if(BP)
+ if(BP.take_damage(damage * hit_percent * brutemod, 0))
+ H.update_damage_overlays()
+ else//no bodypart, we deal damage with a more general method.
+ H.adjustBruteLoss(damage * hit_percent * brutemod)
if(BURN)
H.damageoverlaytemp = 20
- if(organ.take_damage(0, damage*burnmod))
- H.update_damage_overlays(0)
+ if(BP)
+ if(BP.take_damage(0, damage * hit_percent * burnmod))
+ H.update_damage_overlays()
+ else
+ H.adjustFireLoss(damage * hit_percent* burnmod)
if(TOX)
- H.adjustToxLoss(damage)
+ H.adjustToxLoss(damage * hit_percent)
if(OXY)
- H.adjustOxyLoss(damage)
+ H.adjustOxyLoss(damage * hit_percent)
if(CLONE)
- H.adjustCloneLoss(damage)
+ H.adjustCloneLoss(damage * hit_percent)
if(STAMINA)
- H.adjustStaminaLoss(damage)
+ H.adjustStaminaLoss(damage * hit_percent)
return 1
/datum/species/proc/on_hit(obj/item/projectile/proj_type, mob/living/carbon/human/H)
diff --git a/code/modules/mob/living/carbon/human/species_types.dm b/code/modules/mob/living/carbon/human/species_types.dm
index 9677c1b0bfcd..c3e0bc205e1d 100644
--- a/code/modules/mob/living/carbon/human/species_types.dm
+++ b/code/modules/mob/living/carbon/human/species_types.dm
@@ -146,9 +146,9 @@
H.Weaken(5)
H.visible_message("[H] writhes in pain as \his vacuoles boil.", "You writhe in pain as your vacuoles boil!", "You hear the crunching of leaves.")
if(prob(80))
- randmutb(H)
+ H.randmutb()
else
- randmutg(H)
+ H.randmutg()
H.domutcheck()
else
H.adjustFireLoss(rand(5,15))
@@ -642,6 +642,7 @@
meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/human/mutant/skeleton
specflags = list(NOBREATH,RESISTTEMP,NOBLOOD,RADIMMUNE,VIRUSIMMUNE,PIERCEIMMUNE,NOHUNGER,EASYDISMEMBER,EASYLIMBATTACHMENT)
mutant_organs = list(/obj/item/organ/tongue/bone)
+ damage_overlay_type = ""//let's not show bloody wounds or burns over bones.
/*
ZOMBIES
@@ -730,6 +731,7 @@ var/global/image/plasmaman_on_fire = image("icon"='icons/mob/OnFire.dmi', "icon_
burnmod = 2
heatmod = 2
speedmod = 1
+ damage_overlay_type = ""//let's not show bloody wounds or burns over bones.
/datum/species/plasmaman/spec_life(mob/living/carbon/human/H)
var/datum/gas_mixture/environment = H.loc.return_air()
@@ -781,7 +783,7 @@ var/global/image/plasmaman_on_fire = image("icon"='icons/mob/OnFire.dmi', "icon_
dangerous_existence = 1
blacklisted = 1
meat = null
- exotic_damage_overlay = "synth"
+ damage_overlay_type = "synth"
limbs_id = "synth"
var/list/initial_specflags = list(NOTRANSSTING,NOBREATH,VIRUSIMMUNE,NODISMEMBER,NOHUNGER) //for getting these values back for assume_disguise()
var/disguise_fail_health = 75 //When their health gets to this level their synthflesh partially falls off
diff --git a/code/modules/mob/living/carbon/human/status_procs.dm b/code/modules/mob/living/carbon/human/status_procs.dm
new file mode 100644
index 000000000000..adcf57433c41
--- /dev/null
+++ b/code/modules/mob/living/carbon/human/status_procs.dm
@@ -0,0 +1,15 @@
+
+/mob/living/carbon/human/Stun(amount, updating = 1, ignore_canstun = 0)
+ amount = dna.species.spec_stun(src,amount)
+ ..()
+
+
+/mob/living/carbon/human/cure_husk()
+ . = ..()
+ if(.)
+ update_hair()
+
+/mob/living/carbon/human/become_husk()
+ . = ..()
+ if(.)
+ update_hair()
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm
index cb7289a7ef5b..4bbde09513de 100644
--- a/code/modules/mob/living/carbon/human/update_icons.dm
+++ b/code/modules/mob/living/carbon/human/update_icons.dm
@@ -48,28 +48,6 @@ There are several things that need to be remembered:
*/
-//DAMAGE OVERLAYS
-//constructs damage icon for each organ from mask * damage field and saves it in our overlays_ lists
-/mob/living/carbon/human/update_damage_overlays()
- remove_overlay(DAMAGE_LAYER)
-
- var/image/standing = image("icon"='icons/mob/dam_human.dmi', "icon_state"="blank", "layer"=-DAMAGE_LAYER)
- overlays_standing[DAMAGE_LAYER] = standing
-
- var/dmgoverlaytype = ""
- if(dna.species.exotic_damage_overlay)
- dmgoverlaytype = dna.species.exotic_damage_overlay + "_"
-
- for(var/X in bodyparts)
- var/obj/item/bodypart/BP = X
- if(BP.brutestate)
- standing.overlays += "[dmgoverlaytype][BP.body_zone]_[BP.brutestate]0" //we're adding icon_states of the base image as overlays
- if(BP.burnstate)
- standing.overlays += "[dmgoverlaytype][BP.body_zone]_0[BP.burnstate]"
-
- apply_overlay(DAMAGE_LAYER)
-
-
//HAIR OVERLAY
/mob/living/carbon/human/update_hair()
dna.species.handle_hair(src)
@@ -79,47 +57,14 @@ There are several things that need to be remembered:
dna.species.handle_mutant_bodyparts(src)
-/mob/living/carbon/human/proc/update_body()
+/mob/living/carbon/human/update_body()
remove_overlay(BODY_LAYER)
dna.species.handle_body(src)
- update_body_parts()
+ ..()
/mob/living/carbon/human/update_fire()
..("Standing")
-/mob/living/carbon/human/proc/update_body_parts()
- //CHECK FOR UPDATE
- var/oldkey = icon_render_key
- icon_render_key = generate_icon_render_key()
- if(oldkey == icon_render_key)
- return
-
- remove_overlay(BODYPARTS_LAYER)
-
- //LOAD ICONS
- if(limb_icon_cache[icon_render_key])
- load_limb_from_cache()
- update_damage_overlays()
- update_mutant_bodyparts()
- update_hair()
- return
-
- //GENERATE NEW LIMBS
- var/list/new_limbs = list()
- for(var/X in bodyparts)
- var/obj/item/bodypart/BP = X
- if(!BP.no_update)
- BP.update_limb()
- var/image/temp = BP.get_limb_icon()
- if(temp)
- new_limbs += temp
- if(new_limbs.len)
- overlays_standing[BODYPARTS_LAYER] = new_limbs
- limb_icon_cache[icon_render_key] = new_limbs
-
- apply_overlay(BODYPARTS_LAYER)
- update_damage_overlays()
-
/* --------------------------------------- */
//For legacy support.
@@ -219,9 +164,16 @@ There are several things that need to be remembered:
remove_overlay(GLOVES_LAYER)
if(get_num_arms() <2)
+ if(!gloves && blood_DNA)
+ if(has_left_hand())
+ overlays_standing[GLOVES_LAYER] = image("icon"='icons/effects/blood.dmi', "icon_state"="bloodyhands_left", "layer"=-GLOVES_LAYER)
+ apply_overlay(GLOVES_LAYER)
+ else if(has_right_hand())
+ overlays_standing[GLOVES_LAYER] = image("icon"='icons/effects/blood.dmi', "icon_state"="bloodyhands_right", "layer"=-GLOVES_LAYER)
+ apply_overlay(GLOVES_LAYER)
return
- if(client && hud_used)
+ if(client && hud_used && hud_used.inv_slots[slot_gloves])
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_gloves]
inv.update_icon()
@@ -246,7 +198,6 @@ There are several things that need to be remembered:
apply_overlay(GLOVES_LAYER)
-
/mob/living/carbon/human/update_inv_glasses()
remove_overlay(GLASSES_LAYER)
@@ -336,19 +287,10 @@ There are several things that need to be remembered:
apply_overlay(SUIT_STORE_LAYER)
-
/mob/living/carbon/human/update_inv_head()
- remove_overlay(HEAD_LAYER)
- if(!get_bodypart("head")) //Decapitated
- return
..()
- if(client && hud_used)
- var/obj/screen/inventory/inv = hud_used.inv_slots[slot_head]
- inv.update_icon()
-
update_mutant_bodyparts()
-
/mob/living/carbon/human/update_inv_belt()
remove_overlay(BELT_LAYER)
@@ -382,16 +324,16 @@ There are several things that need to be remembered:
inv.update_icon()
if(istype(wear_suit, /obj/item/clothing/suit))
- wear_suit.screen_loc = ui_oclothing //TODO //Todo what?
+ wear_suit.screen_loc = ui_oclothing
if(client && hud_used && hud_used.hud_shown)
- if(hud_used.inventory_shown) //if the inventory is open ...
- client.screen += wear_suit //Either way, add the item to the HUD
+ if(hud_used.inventory_shown)
+ client.screen += wear_suit
update_observer_view(wear_suit,1)
var/image/standing = wear_suit.build_worn_icon(state = wear_suit.icon_state, default_layer = SUIT_LAYER, default_icon_file = 'icons/mob/suit.dmi')
overlays_standing[SUIT_LAYER] = standing
- if(istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
+ if(wear_suit.breakouttime) //suit is restraining
drop_all_held_items()
update_hair()
@@ -423,22 +365,10 @@ There are several things that need to be remembered:
update_observer_view(r_store)
-
/mob/living/carbon/human/update_inv_wear_mask()
- remove_overlay(FACEMASK_LAYER)
- if(!get_bodypart("head")) //Decapitated
- return
..()
- if(client && hud_used)
- var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_mask]
- inv.update_icon()
- update_mutant_bodyparts()
+ update_mutant_bodyparts() //e.g. upgate needed because mask now hides lizard snout
-/mob/living/carbon/human/update_inv_handcuffed()
- remove_overlay(HANDCUFF_LAYER)
- if(handcuffed)
- overlays_standing[HANDCUFF_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="handcuff1", "layer"=-HANDCUFF_LAYER)
- apply_overlay(HANDCUFF_LAYER)
/mob/living/carbon/human/update_inv_legcuffed()
remove_overlay(LEGCUFF_LAYER)
@@ -492,6 +422,8 @@ There are several things that need to be remembered:
update_observer_view(I)
+
+
/*
Does everything in relation to building the /image used in the mob's overlays list
covers:
@@ -581,31 +513,8 @@ generate/load female uniform sprites matching all previously decided variables
-
-
-
-/////////////////////
-// Limb Icon Cache //
-/////////////////////
-/*
- Called from update_body_parts() these procs handle the limb icon cache.
- the limb icon cache adds an icon_render_key to a human mob, it represents:
- - skin_tone (if applicable)
- - gender
- - limbs (stores as the limb name and whether it is removed/fine, organic/robotic)
- These procs only store limbs as to increase the number of matching icon_render_keys
- This cache exists because drawing 6/7 icons for humans constantly is quite a waste
- See RemieRichards on irc.rizon.net #coderbus
-*/
-
-var/global/list/limb_icon_cache = list()
-
-/mob/living/carbon/human
- var/icon_render_key = ""
-
-
//produces a key based on the human's limbs
-/mob/living/carbon/human/proc/generate_icon_render_key()
+/mob/living/carbon/human/generate_icon_render_key()
. = "[dna.species.limbs_id]"
if(dna.check_mutation(HULK))
@@ -624,7 +533,7 @@ var/global/list/limb_icon_cache = list()
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
. += "-[BP.body_zone]"
- if(BP.status == ORGAN_ORGANIC)
+ if(BP.status == BODYPART_ORGANIC)
. += "-organic"
else
. += "-robotic"
@@ -632,16 +541,14 @@ var/global/list/limb_icon_cache = list()
if(disabilities & HUSK)
. += "-husk"
-
-//change the human's icon to the one matching it's key
-/mob/living/carbon/human/proc/load_limb_from_cache()
- if(limb_icon_cache[icon_render_key])
- remove_overlay(BODYPARTS_LAYER)
- overlays_standing[BODYPARTS_LAYER] = limb_icon_cache[icon_render_key]
- apply_overlay(BODYPARTS_LAYER)
+/mob/living/carbon/human/load_limb_from_cache()
+ ..()
+ update_mutant_bodyparts()
+ update_hair()
-/mob/living/carbon/human/proc/update_observer_view(var/obj/item/I,var/inventory)
+
+/mob/living/carbon/human/proc/update_observer_view(obj/item/I, inventory)
if(observers && observers.len)
for(var/M in observers)
var/mob/dead/observe = M
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index 2f4ca6da1191..aa701d7f1b38 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -14,7 +14,8 @@
handle_blood()
- for(var/obj/item/organ/O in internal_organs)
+ for(var/X in internal_organs)
+ var/obj/item/organ/O = X
O.on_life()
//Updates the number of stored chemicals for powers
diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm
index d3e541143b03..3e87fa5c1ab9 100644
--- a/code/modules/mob/living/carbon/monkey/life.dm
+++ b/code/modules/mob/living/carbon/monkey/life.dm
@@ -39,7 +39,7 @@
if(75 to 100)
if(prob(1))
src << "You mutate!"
- randmutb(src)
+ randmutb()
emote("gasp")
domutcheck()
..()
@@ -83,29 +83,29 @@
switch(bodytemperature)
if(360 to 400)
throw_alert("temp", /obj/screen/alert/hot, 1)
- adjustFireLoss(2)
+ apply_damage(HEAT_DAMAGE_LEVEL_1, BURN)
if(400 to 460)
throw_alert("temp", /obj/screen/alert/hot, 2)
- adjustFireLoss(3)
+ apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
if(460 to INFINITY)
throw_alert("temp", /obj/screen/alert/hot, 3)
if(on_fire)
- adjustFireLoss(8)
+ apply_damage(HEAT_DAMAGE_LEVEL_3, BURN)
else
- adjustFireLoss(3)
+ apply_damage(HEAT_DAMAGE_LEVEL_2, BURN)
else if(bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT)
if(!istype(loc, /obj/machinery/atmospherics/components/unary/cryo_cell))
switch(bodytemperature)
if(200 to 260)
throw_alert("temp", /obj/screen/alert/cold, 1)
- adjustFireLoss(0.5)
+ apply_damage(COLD_DAMAGE_LEVEL_1, BURN)
if(120 to 200)
throw_alert("temp", /obj/screen/alert/cold, 2)
- adjustFireLoss(1.5)
+ apply_damage(COLD_DAMAGE_LEVEL_2, BURN)
if(-INFINITY to 120)
throw_alert("temp", /obj/screen/alert/cold, 3)
- adjustFireLoss(3)
+ apply_damage(COLD_DAMAGE_LEVEL_3, BURN)
else
clear_alert("temp")
diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm
index 6ae41f3c8592..33cbce3edb14 100644
--- a/code/modules/mob/living/carbon/monkey/monkey.dm
+++ b/code/modules/mob/living/carbon/monkey/monkey.dm
@@ -3,7 +3,7 @@
voice_name = "monkey"
verb_say = "chimpers"
icon = 'icons/mob/monkey.dmi'
- icon_state = "monkey1"
+ icon_state = ""
gender = NEUTER
pass_flags = PASSTABLE
languages_spoken = MONKEY
@@ -13,6 +13,10 @@
type_of_meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/monkey
gib_type = /obj/effect/decal/cleanable/blood/gibs
unique_name = 1
+ bodyparts = list(/obj/item/bodypart/chest/monkey, /obj/item/bodypart/head/monkey, /obj/item/bodypart/l_arm/monkey,
+ /obj/item/bodypart/r_arm/monkey, /obj/item/bodypart/r_leg/monkey, /obj/item/bodypart/l_leg/monkey)
+
+
/mob/living/carbon/monkey/New()
verbs += /mob/living/proc/mob_sleep
@@ -22,24 +26,13 @@
gender = pick(MALE, FEMALE)
real_name = name
- //initialize limbs, currently only used to handle cavity implant surgery, no dismemberment.
- bodyparts = newlist(/obj/item/bodypart/chest, /obj/item/bodypart/head, /obj/item/bodypart/l_arm,
- /obj/item/bodypart/r_arm, /obj/item/bodypart/r_leg, /obj/item/bodypart/l_leg)
- for(var/X in bodyparts)
- var/obj/item/bodypart/O = X
- O.owner = src
+ //initialize limbs
+ create_bodyparts()
if(good_mutations.len) //genetic mutations have been set up.
- initialize()
+ initialize() //initialize monkey dna
- internal_organs += new /obj/item/organ/appendix
- internal_organs += new /obj/item/organ/lungs
- internal_organs += new /obj/item/organ/heart
- internal_organs += new /obj/item/organ/brain
- internal_organs += new /obj/item/organ/tongue
-
- for(var/obj/item/organ/I in internal_organs)
- I.Insert(src)
+ create_internal_organs()
..()
@@ -47,6 +40,15 @@
create_dna(src)
dna.initialize_dna(random_blood_type())
+
+/mob/living/carbon/monkey/create_internal_organs()
+ internal_organs += new /obj/item/organ/appendix
+ internal_organs += new /obj/item/organ/lungs
+ internal_organs += new /obj/item/organ/heart
+ internal_organs += new /obj/item/organ/brain
+ internal_organs += new /obj/item/organ/tongue
+ ..()
+
/mob/living/carbon/monkey/movement_delay()
if(reagents)
if(reagents.has_reagent("morphine"))
@@ -64,133 +66,6 @@
. += (283.222 - bodytemperature) / 10 * 1.75
return . + config.monkey_delay
-/mob/living/carbon/monkey/attack_paw(mob/living/M)
- if(..()) //successful monkey bite.
- var/damage = rand(1, 5)
- if (stat != DEAD)
- adjustBruteLoss(damage)
- updatehealth()
- return
-
-/mob/living/carbon/monkey/attack_larva(mob/living/carbon/alien/larva/L)
- if(..()) //successful larva bite.
- var/damage = rand(1, 3)
- if(stat != DEAD)
- L.amount_grown = min(L.amount_grown + damage, L.max_grown)
- adjustBruteLoss(damage)
- updatehealth()
-
-/mob/living/carbon/monkey/attack_hand(mob/living/carbon/human/M)
- if(..()) //To allow surgery to return properly.
- return
-
- switch(M.a_intent)
- if("help")
- help_shake_act(M)
- if("grab")
- grabbedby(M)
- if("harm")
- M.do_attack_animation(src)
- if (prob(75))
- visible_message("[M] has punched [name]!", \
- "[M] has punched [name]!")
-
- playsound(loc, "punch", 25, 1, -1)
- var/damage = rand(5, 10)
- if (prob(40))
- damage = rand(10, 15)
- if ( (paralysis < 5) && (health > 0) )
- Paralyse(rand(10, 15))
- visible_message("[M] has knocked out [name]!", \
- "[M] has knocked out [name]!")
- adjustBruteLoss(damage)
- add_logs(M, src, "attacked")
- updatehealth()
- else
- playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
- visible_message("[M] has attempted to punch [name]!", \
- "[M] has attempted to punch [name]!")
- if("disarm")
- if (!( paralysis ))
- M.do_attack_animation(src)
- if (prob(25))
- Paralyse(2)
- playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
- add_logs(M, src, "pushed")
- visible_message("[M] has pushed down [src]!", \
- "[M] has pushed down [src]!")
- else
- if(drop_item())
- playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
- visible_message("[M] has disarmed [src]!", \
- "[M] has disarmed [src]!")
-
-/mob/living/carbon/monkey/attack_alien(mob/living/carbon/alien/humanoid/M)
- if(..()) //if harm or disarm intent.
- if (M.a_intent == "harm")
- if ((prob(95) && health > 0))
- playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
- var/damage = rand(15, 30)
- if (damage >= 25)
- damage = rand(20, 40)
- if (paralysis < 15)
- Paralyse(rand(10, 15))
- visible_message("[M] has wounded [name]!", \
- "[M] has wounded [name]!")
- else
- visible_message("[M] has slashed [name]!", \
- "[M] has slashed [name]!")
-
- if (stat != DEAD)
- adjustBruteLoss(damage)
- updatehealth()
- add_logs(M, src, "attacked")
- else
- playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
- visible_message("[M] has attempted to lunge at [name]!", \
- "[M] has attempted to lunge at [name]!")
-
- if (M.a_intent == "disarm")
- playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
- if(prob(95))
- Weaken(10)
- visible_message("[M] has tackled down [name]!", \
- "[M] has tackled down [name]!")
- else
- if(drop_item())
- visible_message("[M] has disarmed [name]!", \
- "[M] has disarmed [name]!")
- add_logs(M, src, "disarmed")
- updatehealth()
- return
-
-/mob/living/carbon/monkey/attack_animal(mob/living/simple_animal/M)
- if(..())
- var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
- switch(M.melee_damage_type)
- if(BRUTE)
- adjustBruteLoss(damage)
- if(BURN)
- adjustFireLoss(damage)
- if(TOX)
- adjustToxLoss(damage)
- if(OXY)
- adjustOxyLoss(damage)
- if(CLONE)
- adjustCloneLoss(damage)
- if(STAMINA)
- adjustStaminaLoss(damage)
- updatehealth()
-
-
-/mob/living/carbon/monkey/attack_slime(mob/living/simple_animal/slime/M)
- if(..()) //successful slime attack
- var/damage = rand(5, 35)
- if(M.is_adult)
- damage = rand(20, 40)
- adjustBruteLoss(damage)
- updatehealth()
-
/mob/living/carbon/monkey/Stat()
..()
if(statpanel("Status"))
@@ -209,24 +84,6 @@
internal = null
return
-/mob/living/carbon/monkey/ex_act(severity, target)
- ..()
- switch(severity)
- if(1)
- gib()
- return
- if(2)
- adjustBruteLoss(60)
- adjustFireLoss(60)
- adjustEarDamage(30,120)
- if(3)
- adjustBruteLoss(30)
- if (prob(50))
- Paralyse(10)
- adjustEarDamage(15,60)
-
- updatehealth()
- return
/mob/living/carbon/monkey/IsAdvancedToolUser()//Unless its monkey mode monkeys cant use advanced tools
return 0
@@ -270,24 +127,6 @@
return threatcount
-/mob/living/carbon/monkey/acid_act(acidpwr, toxpwr, acid_volume)
- if(wear_mask)
- if(!wear_mask.unacidable)
- wear_mask.acid_act(acidpwr)
- update_inv_wear_mask()
- else
- src << "Your mask protects you from the acid."
- return
-
- take_organ_damage(min(6*toxpwr, acid_volume * acidpwr/10))
-
-/mob/living/carbon/monkey/help_shake_act(mob/living/carbon/M)
- if(health < 0 && ishuman(M))
- var/mob/living/carbon/human/H = M
- H.do_cpr(src)
- else
- ..()
-
/mob/living/carbon/monkey/get_permeability_protection()
var/protection = 0
if(head)
@@ -297,13 +136,6 @@
protection = protection/7 //the rest of the body isn't covered.
return protection
-/mob/living/carbon/monkey/check_eye_prot()
- var/number = ..()
- if(istype(src.wear_mask, /obj/item/clothing/mask))
- var/obj/item/clothing/mask/MFP = src.wear_mask
- number += MFP.flash_protect
- return number
-
/mob/living/carbon/monkey/fully_heal(admin_revive = 0)
if(!getorganslot("lungs"))
var/obj/item/organ/lungs/L = new()
diff --git a/code/modules/mob/living/carbon/monkey/monkey_defense.dm b/code/modules/mob/living/carbon/monkey/monkey_defense.dm
new file mode 100644
index 000000000000..c3a1818b242d
--- /dev/null
+++ b/code/modules/mob/living/carbon/monkey/monkey_defense.dm
@@ -0,0 +1,188 @@
+
+/mob/living/carbon/monkey/get_eye_protection()
+ var/number = ..()
+ if(istype(src.wear_mask, /obj/item/clothing/mask))
+ var/obj/item/clothing/mask/MFP = src.wear_mask
+ number += MFP.flash_protect
+ return number
+
+/mob/living/carbon/monkey/help_shake_act(mob/living/carbon/M)
+ if(health < 0 && ishuman(M))
+ var/mob/living/carbon/human/H = M
+ H.do_cpr(src)
+ else
+ ..()
+
+/mob/living/carbon/monkey/attack_paw(mob/living/M)
+ if(..()) //successful monkey bite.
+ var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
+ if(M.limb_destroyer)
+ dismembering_strike(M, affecting.body_zone)
+ if(stat != DEAD)
+ apply_damage(rand(1, 5), BRUTE, affecting)
+
+
+
+/mob/living/carbon/monkey/attack_larva(mob/living/carbon/alien/larva/L)
+ if(..()) //successful larva bite.
+ var/damage = rand(1, 3)
+ if(stat != DEAD)
+ L.amount_grown = min(L.amount_grown + damage, L.max_grown)
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(L.zone_selected))
+ apply_damage(damage, BRUTE, affecting)
+
+/mob/living/carbon/monkey/attack_hand(mob/living/carbon/human/M)
+ if(..()) //To allow surgery to return properly.
+ return
+
+ switch(M.a_intent)
+ if("help")
+ help_shake_act(M)
+ if("grab")
+ grabbedby(M)
+ if("harm")
+ M.do_attack_animation(src)
+ if (prob(75))
+ visible_message("[M] has punched [name]!", \
+ "[M] has punched [name]!")
+
+ playsound(loc, "punch", 25, 1, -1)
+ var/damage = rand(5, 10)
+ if (prob(40))
+ damage = rand(10, 15)
+ if ( (paralysis < 5) && (health > 0) )
+ Paralyse(rand(10, 15))
+ visible_message("[M] has knocked out [name]!", \
+ "[M] has knocked out [name]!")
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
+ apply_damage(damage, BRUTE, affecting)
+ add_logs(M, src, "attacked")
+
+ else
+ playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
+ visible_message("[M] has attempted to punch [name]!", \
+ "[M] has attempted to punch [name]!")
+ if("disarm")
+ if (!( paralysis ))
+ M.do_attack_animation(src)
+ if (prob(25))
+ Paralyse(2)
+ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+ add_logs(M, src, "pushed")
+ visible_message("[M] has pushed down [src]!", \
+ "[M] has pushed down [src]!")
+ else
+ if(drop_item())
+ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+ visible_message("[M] has disarmed [src]!", \
+ "[M] has disarmed [src]!")
+
+/mob/living/carbon/monkey/attack_alien(mob/living/carbon/alien/humanoid/M)
+ if(..()) //if harm or disarm intent.
+ if (M.a_intent == "harm")
+ if ((prob(95) && health > 0))
+ playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
+ var/damage = rand(15, 30)
+ if (damage >= 25)
+ damage = rand(20, 40)
+ if (paralysis < 15)
+ Paralyse(rand(10, 15))
+ visible_message("[M] has wounded [name]!", \
+ "[M] has wounded [name]!")
+ else
+ visible_message("[M] has slashed [name]!", \
+ "[M] has slashed [name]!")
+
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected))
+ add_logs(M, src, "attacked")
+ if(!dismembering_strike(M, M.zone_selected)) //Dismemberment successful
+ return 1
+ apply_damage(damage, BRUTE, affecting)
+
+ else
+ playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
+ visible_message("[M] has attempted to lunge at [name]!", \
+ "[M] has attempted to lunge at [name]!")
+
+ if (M.a_intent == "disarm")
+ playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
+ if(prob(95))
+ Weaken(10)
+ visible_message("[M] has tackled down [name]!", \
+ "[M] has tackled down [name]!")
+ else
+ if(drop_item())
+ visible_message("[M] has disarmed [name]!", \
+ "[M] has disarmed [name]!")
+ add_logs(M, src, "disarmed")
+ updatehealth()
+
+
+/mob/living/carbon/monkey/attack_animal(mob/living/simple_animal/M)
+ if(..())
+ var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
+ var/dam_zone = dismembering_strike(M, pick("chest", "l_hand", "r_hand", "l_leg", "r_leg"))
+ if(!dam_zone) //Dismemberment successful
+ return 1
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
+ apply_damage(damage, M.melee_damage_type, affecting)
+
+
+
+/mob/living/carbon/monkey/attack_slime(mob/living/simple_animal/slime/M)
+ if(..()) //successful slime attack
+ var/damage = rand(5, 35)
+ if(M.is_adult)
+ damage = rand(20, 40)
+ var/dam_zone = dismembering_strike(M, pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg"))
+ if(!dam_zone) //Dismemberment successful
+ return 1
+ var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
+ apply_damage(damage, BRUTE, affecting)
+
+
+/mob/living/carbon/monkey/acid_act(acidpwr, toxpwr, acid_volume)
+ if(wear_mask)
+ if(!wear_mask.unacidable)
+ wear_mask.acid_act(acidpwr)
+ update_inv_wear_mask()
+ else
+ src << "Your mask protects you from the acid."
+ return
+
+ take_bodypart_damage(min(6*toxpwr, acid_volume * acidpwr/10))
+
+
+/mob/living/carbon/monkey/ex_act(severity, target)
+ ..()
+
+ switch (severity)
+ if (1)
+ gib()
+
+ if (2)
+ take_overall_damage(60, 60)
+ shred_clothing(1,50)
+ adjustEarDamage(30, 120)
+ if(prob(70))
+ Paralyse(10)
+
+ if(3)
+ take_overall_damage(30, 0)
+ adjustEarDamage(15,60)
+ if (prob(50))
+ Paralyse(8)
+
+
+ //attempt to dismember bodyparts
+ if(severity <= 2)
+ var/max_limb_loss = round(4/severity) //so you don't lose four limbs at severity 3.
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/BP = X
+ if(prob(50/severity) && BP.body_zone != "chest")
+ BP.brute_dam = BP.max_damage
+ BP.dismember()
+ max_limb_loss--
+ if(!max_limb_loss)
+ break
diff --git a/code/modules/mob/living/carbon/monkey/update_icons.dm b/code/modules/mob/living/carbon/monkey/update_icons.dm
index b342ace1e791..b7ca5044398d 100644
--- a/code/modules/mob/living/carbon/monkey/update_icons.dm
+++ b/code/modules/mob/living/carbon/monkey/update_icons.dm
@@ -1,29 +1,47 @@
/mob/living/carbon/monkey/regenerate_icons()
if(!..())
+ update_body_parts()
+ update_hair()
update_inv_wear_mask()
update_inv_head()
update_inv_back()
- update_icons()
update_transform()
-/mob/living/carbon/monkey/update_icons()
- cut_overlays()
- icon_state = "monkey1"
- for(var/image/I in overlays_standing)
- add_overlay(I)
////////
+
+/mob/living/carbon/monkey/update_hair()
+ remove_overlay(HAIR_LAYER)
+
+ var/obj/item/bodypart/head/HD = get_bodypart("head")
+ if(!HD) //Decapitated
+ return
+
+ if(disabilities & HUSK)
+ return
+
+ var/hair_hidden = 0
+
+ if(head)
+ var/obj/item/I = head
+ if(I.flags_inv & HIDEHAIR)
+ hair_hidden = 1
+ if(wear_mask)
+ var/obj/item/clothing/mask/M = wear_mask
+ if(M.flags_inv & HIDEHAIR)
+ hair_hidden = 1
+ if(!hair_hidden)
+ if(!getorgan(/obj/item/organ/brain)) //Applies the debrained overlay if there is no brain
+ var/image/I = image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s", "layer" = -HAIR_LAYER)
+ overlays_standing[HAIR_LAYER] = I
+ apply_overlay(HAIR_LAYER)
+
+
/mob/living/carbon/monkey/update_fire()
..("Monkey_burning")
-/mob/living/carbon/monkey/update_inv_handcuffed()
- remove_overlay(HANDCUFF_LAYER)
- if(handcuffed)
- overlays_standing[HANDCUFF_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="handcuff1", "layer"=-HANDCUFF_LAYER)
- apply_overlay(HANDCUFF_LAYER)
-
/mob/living/carbon/monkey/update_inv_legcuffed()
remove_overlay(LEGCUFF_LAYER)
if(legcuffed)
diff --git a/code/modules/mob/living/carbon/status_procs.dm b/code/modules/mob/living/carbon/status_procs.dm
index 24c9305aa157..abfe312c48b1 100644
--- a/code/modules/mob/living/carbon/status_procs.dm
+++ b/code/modules/mob/living/carbon/status_procs.dm
@@ -1,6 +1,6 @@
//Here are the procs used to modify status effects of a mob.
//The effects include: stunned, weakened, paralysis, sleeping, resting, jitteriness, dizziness, ear damage,
-// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, and NEARSIGHT disability.
+// eye damage, eye_blind, eye_blurry, druggy, BLIND disability, NEARSIGHT disability, and HUSK disability.
/mob/living/carbon/damage_eyes(amount)
if(amount>0)
@@ -76,4 +76,19 @@
if(!(disabilities & NEARSIGHT))
disabilities |= NEARSIGHT
overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
- return 1
\ No newline at end of file
+ return 1
+
+/mob/living/carbon/cure_husk()
+ if(disabilities & HUSK)
+ disabilities &= ~HUSK
+ status_flags &= ~DISFIGURED
+ update_body()
+ return 1
+
+/mob/living/carbon/become_husk()
+ if(disabilities & HUSK)
+ return
+ disabilities |= HUSK
+ status_flags |= DISFIGURED //makes them unknown
+ update_body()
+ return 1
diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm
index 05f410fafe29..dcd5b1a59b2c 100644
--- a/code/modules/mob/living/carbon/update_icons.dm
+++ b/code/modules/mob/living/carbon/update_icons.dm
@@ -40,10 +40,18 @@
overlays -= overlays_standing[cache_index]
overlays_standing[cache_index] = null
+/mob/living/carbon/regenerate_icons()
+ if(notransform)
+ return 1
+ update_inv_hands()
+ update_inv_handcuffed()
+ update_inv_legcuffed()
+ update_fire()
+
/mob/living/carbon/update_inv_hands()
remove_overlay(HANDS_LAYER)
- if(handcuffed)
+ if (handcuffed)
drop_all_held_items()
return
@@ -85,23 +93,44 @@
apply_overlay(FIRE_LAYER)
-/mob/living/carbon/regenerate_icons()
- if(notransform)
- return 1
- update_inv_hands()
- update_inv_handcuffed()
- update_inv_legcuffed()
- update_fire()
+
+
+/mob/living/carbon/update_damage_overlays()
+ remove_overlay(DAMAGE_LAYER)
+
+ var/image/standing = image("icon"='icons/mob/dam_mob.dmi', "icon_state"="blank", "layer"=-DAMAGE_LAYER)
+ overlays_standing[DAMAGE_LAYER] = standing
+
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/BP = X
+ if(BP.dmg_overlay_type)
+ if(BP.brutestate)
+ standing.overlays += "[BP.dmg_overlay_type]_[BP.body_zone]_[BP.brutestate]0" //we're adding icon_states of the base image as overlays
+ if(BP.burnstate)
+ standing.overlays += "[BP.dmg_overlay_type]_[BP.body_zone]_0[BP.burnstate]"
+
+ apply_overlay(DAMAGE_LAYER)
+
/mob/living/carbon/update_inv_wear_mask()
remove_overlay(FACEMASK_LAYER)
- if(istype(wear_mask, /obj/item/clothing/mask))
+
+ if(!get_bodypart("head")) //Decapitated
+ return
+
+ if(client && hud_used && hud_used.inv_slots[slot_wear_mask])
+ var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_mask]
+ inv.update_icon()
+
+ if(wear_mask)
if(!(head && (head.flags_inv & HIDEMASK)))
var/image/standing = wear_mask.build_worn_icon(state = wear_mask.icon_state, default_layer = FACEMASK_LAYER, default_icon_file = 'icons/mob/mask.dmi')
overlays_standing[FACEMASK_LAYER] = standing
update_hud_wear_mask(wear_mask)
+
apply_overlay(FACEMASK_LAYER)
+
/mob/living/carbon/update_inv_back()
remove_overlay(BACK_LAYER)
@@ -117,14 +146,27 @@
/mob/living/carbon/update_inv_head()
remove_overlay(HEAD_LAYER)
+
+ if(!get_bodypart("head")) //Decapitated
+ return
+
+ if(client && hud_used && hud_used.inv_slots[slot_back])
+ var/obj/screen/inventory/inv = hud_used.inv_slots[slot_head]
+ inv.update_icon()
+
if(head)
var/image/standing = head.build_worn_icon(state = head.icon_state, default_layer = HEAD_LAYER, default_icon_file = 'icons/mob/head.dmi')
overlays_standing[HEAD_LAYER] = standing
update_hud_head(head)
+
apply_overlay(HEAD_LAYER)
+
/mob/living/carbon/update_inv_handcuffed()
- return
+ remove_overlay(HANDCUFF_LAYER)
+ if(handcuffed)
+ overlays_standing[HANDCUFF_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="handcuff1", "layer"=-HANDCUFF_LAYER)
+ apply_overlay(HANDCUFF_LAYER)
//mob HUD updates for items in our inventory
@@ -150,12 +192,92 @@
return
+
//Overlays for the worn overlay so you can overlay while you overlay
//eg: ammo counters, primed grenade flashing, etc.
-/obj/item/proc/worn_overlays(var/isinhands = FALSE)
+/obj/item/proc/worn_overlays(isinhands = FALSE)
. = list()
+/mob/living/carbon/update_body()
+ update_body_parts()
+
+/mob/living/carbon/proc/update_body_parts()
+ //CHECK FOR UPDATE
+ var/oldkey = icon_render_key
+ icon_render_key = generate_icon_render_key()
+ if(oldkey == icon_render_key)
+ return
+
+ remove_overlay(BODYPARTS_LAYER)
+
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/BP = X
+ if(!BP.no_update)
+ BP.update_limb()
+
+ //LOAD ICONS
+ if(limb_icon_cache[icon_render_key])
+ load_limb_from_cache()
+ return
+
+ //GENERATE NEW LIMBS
+ var/list/new_limbs = list()
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/BP = X
+ var/image/temp = BP.get_limb_icon()
+ if(temp)
+ new_limbs += temp
+ if(new_limbs.len)
+ overlays_standing[BODYPARTS_LAYER] = new_limbs
+ limb_icon_cache[icon_render_key] = new_limbs
+
+ apply_overlay(BODYPARTS_LAYER)
+ update_damage_overlays()
+/////////////////////
+// Limb Icon Cache //
+/////////////////////
+/*
+ Called from update_body_parts() these procs handle the limb icon cache.
+ the limb icon cache adds an icon_render_key to a human mob, it represents:
+ - skin_tone (if applicable)
+ - gender
+ - limbs (stores as the limb name and whether it is removed/fine, organic/robotic)
+ These procs only store limbs as to increase the number of matching icon_render_keys
+ This cache exists because drawing 6/7 icons for humans constantly is quite a waste
+ See RemieRichards on irc.rizon.net #coderbus
+*/
+
+var/global/list/limb_icon_cache = list()
+
+/mob/living/carbon
+ var/icon_render_key = ""
+
+
+//produces a key based on the mob's limbs
+
+/mob/living/carbon/proc/generate_icon_render_key()
+ for(var/X in bodyparts)
+ var/obj/item/bodypart/BP = X
+ . += "-[BP.body_zone]"
+ if(BP.animal_origin)
+ . += "-[BP.animal_origin]"
+ if(BP.status == BODYPART_ORGANIC)
+ . += "-organic"
+ else
+ . += "-robotic"
+
+ if(disabilities & HUSK)
+ . += "-husk"
+
+
+//change the mob's icon to the one matching its key
+/mob/living/carbon/proc/load_limb_from_cache()
+ if(limb_icon_cache[icon_render_key])
+ remove_overlay(BODYPARTS_LAYER)
+ overlays_standing[BODYPARTS_LAYER] = limb_icon_cache[icon_render_key]
+ apply_overlay(BODYPARTS_LAYER)
+ update_damage_overlays()
diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm
index 0690e8b11fd2..f0fcda0dcf9b 100644
--- a/code/modules/mob/living/damage_procs.dm
+++ b/code/modules/mob/living/damage_procs.dm
@@ -9,23 +9,22 @@
standard 0 if fail
*/
/mob/living/proc/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = 0)
- blocked = (100-blocked)/100
- if(!damage || (blocked <= 0))
+ var/hit_percent = (100-blocked)/100
+ if(!damage || (hit_percent <= 0))
return 0
switch(damagetype)
if(BRUTE)
- adjustBruteLoss(damage * blocked)
+ adjustBruteLoss(damage * hit_percent)
if(BURN)
- adjustFireLoss(damage * blocked)
+ adjustFireLoss(damage * hit_percent)
if(TOX)
- adjustToxLoss(damage * blocked)
+ adjustToxLoss(damage * hit_percent)
if(OXY)
- adjustOxyLoss(damage * blocked)
+ adjustOxyLoss(damage * hit_percent)
if(CLONE)
- adjustCloneLoss(damage * blocked)
+ adjustCloneLoss(damage * hit_percent)
if(STAMINA)
- adjustStaminaLoss(damage * blocked)
- updatehealth()
+ adjustStaminaLoss(damage * hit_percent)
return 1
@@ -49,30 +48,30 @@
/mob/living/proc/apply_effect(effect = 0,effecttype = STUN, blocked = 0)
- blocked = (100-blocked)/100
- if(!effect || (blocked <= 0))
+ var/hit_percent = (100-blocked)/100
+ if(!effect || (hit_percent <= 0))
return 0
switch(effecttype)
if(STUN)
- Stun(effect * blocked)
+ Stun(effect * hit_percent)
if(WEAKEN)
- Weaken(effect * blocked)
+ Weaken(effect * hit_percent)
if(PARALYZE)
- Paralyse(effect * blocked)
+ Paralyse(effect * hit_percent)
if(IRRADIATE)
- radiation += max(effect * blocked, 0)
+ radiation += max(effect * hit_percent, 0)
if(SLUR)
- slurring = max(slurring,(effect * blocked))
+ slurring = max(slurring,(effect * hit_percent))
if(STUTTER)
if(status_flags & CANSTUN) // stun is usually associated with stutter
- stuttering = max(stuttering,(effect * blocked))
+ stuttering = max(stuttering,(effect * hit_percent))
if(EYE_BLUR)
- blur_eyes(effect * blocked)
+ blur_eyes(effect * hit_percent)
if(DROWSY)
- drowsyness = max(drowsyness,(effect * blocked))
+ drowsyness = max(drowsyness,(effect * hit_percent))
if(JITTER)
if(status_flags & CANSTUN)
- jitteriness = max(jitteriness,(effect * blocked))
+ jitteriness = max(jitteriness,(effect * hit_percent))
return 1
@@ -99,4 +98,128 @@
apply_damage(stamina, STAMINA, null, blocked)
if(jitter)
apply_effect(jitter, JITTER, blocked)
- return 1
\ No newline at end of file
+ return 1
+
+
+/mob/living/proc/getBruteLoss()
+ return bruteloss
+
+/mob/living/proc/adjustBruteLoss(amount, updating_health=1)
+ if(status_flags & GODMODE)
+ return 0
+ bruteloss = Clamp((bruteloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
+ if(updating_health)
+ updatehealth()
+
+/mob/living/proc/getOxyLoss()
+ return oxyloss
+
+/mob/living/proc/adjustOxyLoss(amount, updating_health=1)
+ if(status_flags & GODMODE)
+ return 0
+ oxyloss = Clamp((oxyloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
+ if(updating_health)
+ updatehealth()
+
+/mob/living/proc/setOxyLoss(amount, updating_health=1)
+ if(status_flags & GODMODE)
+ return 0
+ oxyloss = amount
+ if(updating_health)
+ updatehealth()
+
+/mob/living/proc/getToxLoss()
+ return toxloss
+
+/mob/living/proc/adjustToxLoss(amount, updating_health=1)
+ if(status_flags & GODMODE)
+ return 0
+ toxloss = Clamp((toxloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
+ if(updating_health)
+ updatehealth()
+ return amount
+
+/mob/living/proc/setToxLoss(amount, updating_health=1)
+ if(status_flags & GODMODE)
+ return 0
+ toxloss = amount
+ if(updating_health)
+ updatehealth()
+
+/mob/living/proc/getFireLoss()
+ return fireloss
+
+/mob/living/proc/adjustFireLoss(amount, updating_health=1)
+ if(status_flags & GODMODE)
+ return 0
+ fireloss = Clamp((fireloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
+ if(updating_health)
+ updatehealth()
+
+/mob/living/proc/getCloneLoss()
+ return cloneloss
+
+/mob/living/proc/adjustCloneLoss(amount, updating_health=1)
+ if(status_flags & GODMODE)
+ return 0
+ cloneloss = Clamp((cloneloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
+ if(updating_health)
+ updatehealth()
+
+/mob/living/proc/setCloneLoss(amount, updating_health=1)
+ if(status_flags & GODMODE)
+ return 0
+ cloneloss = amount
+ if(updating_health)
+ updatehealth()
+
+/mob/living/proc/getBrainLoss()
+ return brainloss
+
+/mob/living/proc/adjustBrainLoss(amount)
+ if(status_flags & GODMODE)
+ return 0
+ brainloss = Clamp((brainloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
+
+/mob/living/proc/setBrainLoss(amount)
+ if(status_flags & GODMODE)
+ return 0
+ brainloss = amount
+
+/mob/living/proc/getStaminaLoss()
+ return staminaloss
+
+/mob/living/proc/adjustStaminaLoss(amount, updating_stamina = 1)
+ return
+
+/mob/living/proc/setStaminaLoss(amount, updating_stamina = 1)
+ return
+
+
+// heal ONE external organ, organ gets randomly selected from damaged ones.
+/mob/living/proc/heal_bodypart_damage(brute, burn, updating_health = 1)
+ adjustBruteLoss(-brute, 0) //zero as argument for no instant health update
+ adjustFireLoss(-burn, 0)
+ if(updating_health)
+ updatehealth()
+
+// damage ONE external organ, organ gets randomly selected from damaged ones.
+/mob/living/proc/take_bodypart_damage(brute, burn, updating_health = 1)
+ adjustBruteLoss(brute, 0) //zero as argument for no instant health update
+ adjustFireLoss(burn, 0)
+ if(updating_health)
+ updatehealth()
+
+// heal MANY bodyparts, in random order
+/mob/living/proc/heal_overall_damage(brute, burn, only_robotic = 0, only_organic = 1, updating_health = 1)
+ adjustBruteLoss(-brute, 0) //zero as argument for no instant health update
+ adjustFireLoss(-burn, 0)
+ if(updating_health)
+ updatehealth()
+
+// damage MANY bodyparts, in random order
+/mob/living/proc/take_overall_damage(brute, burn, updating_health = 1)
+ adjustBruteLoss(brute, 0) //zero as argument for no instant health update
+ adjustFireLoss(burn, 0)
+ if(updating_health)
+ updatehealth()
\ No newline at end of file
diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm
index fc1bf88240ba..10c9a2a50f8c 100644
--- a/code/modules/mob/living/death.dm
+++ b/code/modules/mob/living/death.dm
@@ -1,4 +1,4 @@
-/mob/living/gib(no_brain, no_organs)
+/mob/living/gib(no_brain, no_organs, no_bodyparts)
var/prev_lying = lying
if(stat != DEAD)
death(1)
@@ -8,20 +8,27 @@
if(!prev_lying)
gib_animation()
- if(!no_organs)
- spill_organs(no_brain)
- spawn_gibs()
+
+
+ spill_organs(no_brain, no_organs, no_bodyparts)
+
+ if(!no_bodyparts)
+ spread_bodyparts(no_brain, no_organs)
+
+ spawn_gibs(no_bodyparts)
qdel(src)
/mob/living/proc/gib_animation()
return
/mob/living/proc/spawn_gibs()
- gibs(loc, viruses)
+ new /obj/effect/gibspawner/generic(loc, viruses)
-/mob/living/proc/spill_organs(no_brain)
+/mob/living/proc/spill_organs()
return
+/mob/living/proc/spread_bodyparts()
+ return
/mob/living/dust()
death(1)
diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm
index f44ca1855baa..052328ac563e 100644
--- a/code/modules/mob/living/life.dm
+++ b/code/modules/mob/living/life.dm
@@ -78,6 +78,23 @@
/mob/living/proc/handle_environment(datum/gas_mixture/environment)
return
+/mob/living/proc/handle_fire()
+ if(fire_stacks < 0) //If we've doused ourselves in water to avoid fire, dry off slowly
+ fire_stacks = min(0, fire_stacks + 1)//So we dry ourselves back to default, nonflammable.
+ if(!on_fire)
+ return 1
+ if(fire_stacks > 0)
+ adjust_fire_stacks(-0.1) //the fire is slowly consumed
+ else
+ ExtinguishMob()
+ return
+ var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
+ if(!G.gases["o2"] || G.gases["o2"][MOLES] < 1)
+ ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire
+ return
+ var/turf/location = get_turf(src)
+ location.hotspot_expose(700, 50, 1)
+
/mob/living/proc/handle_stomach()
return
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index d5d566211d1e..b06fef840ca8 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -212,22 +212,13 @@
src << "You have given up life and succumbed to death."
death()
+/mob/living/incapacitated(ignore_restraints, ignore_grab)
+ if(stat || paralysis || stunned || weakened || (!ignore_restraints && restrained(ignore_grab)))
+ return 1
+
/mob/living/proc/InCritical()
return (src.health < 0 && src.health > -95 && stat == UNCONSCIOUS)
-/mob/living/ex_act(severity, origin)
- if(istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
- return
- ..()
- flash_eyes()
-
-/mob/living/proc/updatehealth()
- if(status_flags & GODMODE)
- return
- health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
- update_stat()
- med_hud_set_health()
-
//This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually
//affects them once clothing is factored in. ~Errorage
/mob/living/proc/calculate_affecting_pressure(pressure)
@@ -255,120 +246,6 @@
return temperature
-// MOB PROCS
-/mob/living/proc/getBruteLoss()
- return bruteloss
-
-/mob/living/proc/adjustBruteLoss(amount, updating_health=1)
- if(status_flags & GODMODE)
- return 0
- bruteloss = Clamp((bruteloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
- if(updating_health)
- updatehealth()
-
-/mob/living/proc/getOxyLoss()
- return oxyloss
-
-/mob/living/proc/adjustOxyLoss(amount, updating_health=1)
- if(status_flags & GODMODE)
- return 0
- oxyloss = Clamp((oxyloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
- if(updating_health)
- updatehealth()
-
-/mob/living/proc/setOxyLoss(amount, updating_health=1)
- if(status_flags & GODMODE)
- return 0
- oxyloss = amount
- if(updating_health)
- updatehealth()
-
-/mob/living/proc/getToxLoss()
- return toxloss
-
-/mob/living/proc/adjustToxLoss(amount, updating_health=1)
- if(status_flags & GODMODE)
- return 0
- toxloss = Clamp((toxloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
- if(updating_health)
- updatehealth()
- return amount
-
-/mob/living/proc/setToxLoss(amount, updating_health=1)
- if(status_flags & GODMODE)
- return 0
- toxloss = amount
- if(updating_health)
- updatehealth()
-
-/mob/living/proc/getFireLoss()
- return fireloss
-
-/mob/living/proc/adjustFireLoss(amount, updating_health=1)
- if(status_flags & GODMODE)
- return 0
- fireloss = Clamp((fireloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
- if(updating_health)
- updatehealth()
-
-/mob/living/proc/getCloneLoss()
- return cloneloss
-
-/mob/living/proc/adjustCloneLoss(amount, updating_health=1)
- if(status_flags & GODMODE)
- return 0
- cloneloss = Clamp((cloneloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
- if(updating_health)
- updatehealth()
-
-/mob/living/proc/setCloneLoss(amount, updating_health=1)
- if(status_flags & GODMODE)
- return 0
- cloneloss = amount
- if(updating_health)
- updatehealth()
-
-/mob/living/proc/getBrainLoss()
- return brainloss
-
-/mob/living/proc/adjustBrainLoss(amount)
- if(status_flags & GODMODE)
- return 0
- brainloss = Clamp((brainloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
-
-/mob/living/proc/setBrainLoss(amount)
- if(status_flags & GODMODE)
- return 0
- brainloss = amount
-
-/mob/living/proc/getStaminaLoss()
- return staminaloss
-
-/mob/living/proc/adjustStaminaLoss(amount, updating_stamina = 1)
- return
-
-/mob/living/carbon/adjustStaminaLoss(amount, updating_stamina = 1)
- if(status_flags & GODMODE)
- return 0
- staminaloss = Clamp(staminaloss + amount, 0, maxHealth*2)
- if(updating_stamina)
- update_stamina()
-
-/mob/living/carbon/alien/adjustStaminaLoss(amount, updating_stamina = 1)
- return
-
-/mob/living/proc/setStaminaLoss(amount, updating_stamina = 1)
- return
-
-/mob/living/carbon/setStaminaLoss(amount, updating_stamina = 1)
- if(status_flags & GODMODE)
- return 0
- staminaloss = amount
- if(updating_stamina)
- update_stamina()
-
-/mob/living/carbon/alien/setStaminaLoss(amount, updating_stamina = 1)
- return
/mob/living/proc/getMaxHealth()
return maxHealth
@@ -425,23 +302,6 @@
return 1
return 0
-
-/mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0)
- if(shock_damage > 0)
- adjustFireLoss(shock_damage)
- visible_message(
- "[src] was shocked by \the [source]!", \
- "You feel a powerful shock coursing through your body!", \
- "You hear a heavy electrical crack." \
- )
- return shock_damage
-
-/mob/living/emp_act(severity)
- var/list/L = src.get_contents()
- for(var/obj/O in L)
- O.emp_act(severity)
- ..()
-
/mob/living/proc/can_inject()
return 1
@@ -453,33 +313,14 @@
var/def_zone = ran_zone(t)
return def_zone
-// heal ONE external organ, organ gets randomly selected from damaged ones.
-/mob/living/proc/heal_organ_damage(brute, burn, updating_health=1)
- adjustBruteLoss(-brute, updating_health)
- adjustFireLoss(-burn, updating_health)
- if(updating_health)
- updatehealth()
-// damage ONE external organ, organ gets randomly selected from damaged ones.
-/mob/living/proc/take_organ_damage(brute, burn, updating_health=1)
- adjustBruteLoss(brute)
- adjustFireLoss(burn)
- if(updating_health)
- updatehealth()
-
-// heal MANY bodyparts, in random order
-/mob/living/proc/heal_overall_damage(brute, burn, updating_health=1)
- adjustBruteLoss(-brute, updating_health)
- adjustFireLoss(-burn, updating_health)
- if(updating_health)
- updatehealth()
-
-// damage MANY bodyparts, in random order
-/mob/living/proc/take_overall_damage(brute, burn, updating_health=1)
- adjustBruteLoss(brute, updating_health)
- adjustFireLoss(burn, updating_health)
- if(updating_health)
- updatehealth()
+/mob/living/proc/updatehealth()
+ if(status_flags & GODMODE)
+ return
+ health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
+ update_stat()
+ med_hud_set_health()
+ med_hud_set_status()
//proc used to ressuscitate a mob
/mob/living/proc/revive(full_heal = 0, admin_revive = 0)
@@ -500,7 +341,7 @@
//proc used to completely heal a mob.
/mob/living/proc/fully_heal(admin_revive = 0)
restore_blood()
- setToxLoss(0, 0)
+ setToxLoss(0, 0) //zero as second argument not automatically call updatehealth().
setOxyLoss(0, 0)
setCloneLoss(0, 0)
setBrainLoss(0)
@@ -517,14 +358,14 @@
set_eye_damage(0)
cure_nearsighted()
cure_blind()
+ cure_husk()
disabilities = 0
ear_deaf = 0
ear_damage = 0
hallucination = 0
- heal_overall_damage(100000, 100000)
+ heal_overall_damage(100000, 100000, 0, 0, 1) //heal brute and burn dmg on both organic and robotic limbs, and update health right away.
ExtinguishMob()
fire_stacks = 0
- updatehealth()
update_canmove()
@@ -758,21 +599,6 @@
animate(src, pixel_y = get_standard_pixel_y_offset(lying), time = 10)
floating = 0
-//called when the mob receives a bright flash
-/mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash)
- if(check_eye_prot() < intensity && (override_blindness_check || !(disabilities & BLIND)))
- overlay_fullscreen("flash", type)
- addtimer(src, "clear_fullscreen", 25, FALSE, "flash", 25)
- return 1
-
-//this returns the mob's protection against eye damage (number between -1 and 2)
-/mob/living/proc/check_eye_prot()
- return 0
-
-//this returns the mob's protection against ear damage (0 or 1)
-/mob/living/proc/check_ear_prot()
- return 0
-
// The src mob is trying to strip an item from someone
// Override if a certain type of mob should be behave differently when stripping items (can't, for example)
/mob/living/stripPanelUnequip(obj/item/what, mob/who, where)
@@ -821,11 +647,6 @@
who.equip_to_slot_if_possible(what, where, 0, 1)
add_logs(src, who, "equipped", what)
-/mob/living/singularity_act()
- var/gain = 20
- investigate_log("([key_name(src)]) has been consumed by the singularity.","singulo") //Oh that's where the clown ended up!
- gib()
- return(gain)
/mob/living/singularity_pull(S, current_size)
if(current_size >= STAGE_SIX)
@@ -833,29 +654,6 @@
else
step_towards(src,S)
-/mob/living/narsie_act()
- if(is_servant_of_ratvar(src) && !stat)
- src << "You resist Nar-Sie's influence... but not all of it. Run!"
- adjustBruteLoss(35)
- if(src && reagents)
- reagents.add_reagent("heparin", 5)
- return 0
- if(client)
- makeNewConstruct(/mob/living/simple_animal/hostile/construct/harvester, src, null, 0)
- else
- new /mob/living/simple_animal/hostile/construct/harvester/hostile(get_turf(src))
- spawn_dust()
- gib()
- return
-
-/mob/living/ratvar_act()
- if(!add_servant_of_ratvar(src) && !is_servant_of_ratvar(src))
- src << "A blinding light boils you alive! Run!"
- adjustFireLoss(35)
- if(src)
- adjust_fire_stacks(1)
- IgniteMob()
-
/atom/movable/proc/do_attack_animation(atom/A, end_pixel_y)
var/pixel_x_diff = 0
var/pixel_y_diff = 0
@@ -1016,7 +814,7 @@
new path(src.loc)
butcher_results.Remove(path) //In case you want to have things like simple_animals drop their butcher results on gib, so it won't double up below.
visible_message("[user] butchers [src].")
- gib()
+ gib(0, 0, 1)
/mob/living/canUseTopic(atom/movable/M, be_close = 0, no_dextery = 0)
if(incapacitated())
@@ -1104,3 +902,50 @@
/mob/living/proc/fakefire()
return
+
+
+
+//Mobs on Fire
+/mob/living/proc/IgniteMob()
+ if(fire_stacks > 0 && !on_fire)
+ on_fire = 1
+ src.visible_message("[src] catches fire!", \
+ "You're set on fire!")
+ src.AddLuminosity(3)
+ throw_alert("fire", /obj/screen/alert/fire)
+ update_fire()
+ return TRUE
+ return FALSE
+
+/mob/living/proc/ExtinguishMob()
+ if(on_fire)
+ on_fire = 0
+ fire_stacks = 0
+ src.AddLuminosity(-3)
+ clear_alert("fire")
+ update_fire()
+
+/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person
+ fire_stacks = Clamp(fire_stacks + add_fire_stacks, -20, 20)
+ if(on_fire && fire_stacks <= 0)
+ ExtinguishMob()
+
+//Share fire evenly between the two mobs
+//Called in MobBump() and Crossed()
+/mob/living/proc/spreadFire(mob/living/L)
+ if(!istype(L))
+ return
+ var/L_old_on_fire = L.on_fire
+
+ if(on_fire) //Only spread fire stacks if we're on fire
+ fire_stacks /= 2
+ L.fire_stacks += fire_stacks
+ if(L.IgniteMob())
+ log_game("[key_name(src)] bumped into [key_name(L)] and set them on fire")
+
+ if(L_old_on_fire) //Only ignite us and gain their stacks if they were onfire before we bumped them
+ L.fire_stacks /= 2
+ fire_stacks += L.fire_stacks
+ IgniteMob()
+
+//Mobs on Fire end
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index c7543c03edea..ee4bd6ce2067 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -1,3 +1,4 @@
+
/mob/living/proc/run_armor_check(def_zone = null, attack_flag = "melee", absorb_text = null, soften_text = null, armour_penetration, penetrated_text)
var/armor = getarmor(def_zone, attack_flag)
@@ -24,6 +25,14 @@
/mob/living/proc/getarmor(def_zone, type)
return 0
+//this returns the mob's protection against eye damage (number between -1 and 2)
+/mob/living/proc/get_eye_protection()
+ return 0
+
+//this returns the mob's protection against ear damage (0:no protection; 1: some ear protection; 2: has no ears)
+/mob/living/proc/get_ear_protection()
+ return 0
+
/mob/living/proc/on_hit(obj/item/projectile/proj_type)
return
@@ -33,18 +42,16 @@
apply_damage(P.damage, P.damage_type, def_zone, armor)
if(P.dismemberment)
check_projectile_dismemberment(P, def_zone)
- return P.on_hit(src, armor, def_zone)
+ return P.on_hit(src, armor)
/mob/living/proc/check_projectile_dismemberment(obj/item/projectile/P, def_zone)
return 0
-/proc/vol_by_throwforce_and_or_w_class(obj/item/I)
- if(!I)
- return 0
- if(I.throwforce && I.w_class)
- return Clamp((I.throwforce + I.w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
- else if(I.w_class)
- return Clamp(I.w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
+/obj/item/proc/get_volume_by_throwforce_and_or_w_class()
+ if(throwforce && w_class)
+ return Clamp((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
+ else if(w_class)
+ return Clamp(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
else
return 0
@@ -53,7 +60,7 @@
var/obj/item/I = AM
var/zone = ran_zone("chest", 65)//Hits a random part of the body, geared towards the chest
var/dtype = BRUTE
- var/volume = vol_by_throwforce_and_or_w_class(I)
+ var/volume = I.get_volume_by_throwforce_and_or_w_class()
if(istype(I,/obj/item/weapon)) //If the item is a weapon...
var/obj/item/weapon/W = I
dtype = W.damtype
@@ -83,6 +90,7 @@
playsound(loc, 'sound/weapons/genhit.ogg', 50, 1, -1)
..()
+
/mob/living/mech_melee_attack(obj/mecha/M)
if(M.occupant.a_intent == "harm")
M.do_attack_animation(src)
@@ -109,80 +117,10 @@
add_logs(M.occupant, src, "pushed", M)
visible_message("[M] pushes [src] out of the way.")
-
-//Mobs on Fire
-/mob/living/proc/IgniteMob()
- if(fire_stacks > 0 && !on_fire)
- on_fire = 1
- src.visible_message("[src] catches fire!", \
- "You're set on fire!")
- src.AddLuminosity(3)
- throw_alert("fire", /obj/screen/alert/fire)
- update_fire()
- return TRUE
- return FALSE
-
-/mob/living/proc/ExtinguishMob()
- if(on_fire)
- on_fire = 0
- fire_stacks = 0
- src.AddLuminosity(-3)
- clear_alert("fire")
- update_fire()
-
-/mob/living/proc/update_fire()
- return
-
-/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person
- fire_stacks = Clamp(fire_stacks + add_fire_stacks, -20, 20)
- if(on_fire && fire_stacks <= 0)
- ExtinguishMob()
-
-/mob/living/proc/handle_fire()
- if(fire_stacks < 0) //If we've doused ourselves in water to avoid fire, dry off slowly
- fire_stacks = min(0, fire_stacks + 1)//So we dry ourselves back to default, nonflammable.
- if(!on_fire)
- return 1
- if(fire_stacks > 0)
- adjust_fire_stacks(-0.1) //the fire is slowly consumed
- else
- ExtinguishMob()
- return
- var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
- if(!G.gases["o2"] || G.gases["o2"][MOLES] < 1)
- ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire
- return
- var/turf/location = get_turf(src)
- location.hotspot_expose(700, 50, 1)
-
/mob/living/fire_act()
adjust_fire_stacks(3)
IgniteMob()
-
-//Share fire evenly between the two mobs
-//Called in MobBump() and Crossed()
-/mob/living/proc/spreadFire(mob/living/L)
- if(!istype(L))
- return
- var/L_old_on_fire = L.on_fire
-
- if(on_fire) //Only spread fire stacks if we're on fire
- fire_stacks /= 2
- L.fire_stacks += fire_stacks
- if(L.IgniteMob())
- log_game("[key_name(src)] bumped into [key_name(L)] and set them on fire")
-
- if(L_old_on_fire) //Only ignite us and gain their stacks if they were onfire before we bumped them
- L.fire_stacks /= 2
- fire_stacks += L.fire_stacks
- IgniteMob()
-
-//Mobs on Fire end
-
-/mob/living/acid_act(acidpwr, toxpwr, acid_volume)
- take_organ_damage(min(10*toxpwr, acid_volume * toxpwr))
-
/mob/living/proc/grabbedby(mob/living/carbon/user, supress_message = 0)
if(user == src || anchored)
return 0
@@ -291,7 +229,6 @@
return 0
/mob/living/attack_larva(mob/living/carbon/alien/larva/L)
-
switch(L.a_intent)
if("help")
visible_message("[L.name] rubs its head against [src].")
@@ -331,60 +268,71 @@
M.do_attack_animation(src)
return 1
-/mob/living/incapacitated(ignore_restraints, ignore_grab)
- if(stat || paralysis || stunned || weakened || (!ignore_restraints && restrained(ignore_grab)))
- return 1
+/mob/living/ex_act(severity, origin)
+ if(istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
+ return
+ ..()
+ flash_act()
//Looking for irradiate()? It's been moved to radiation.dm under the rad_act() for mobs.
-/mob/living/proc/add_stun_absorption(key, duration, priority, message, self_message, examine_message)
-//adds a stun absorption with a key, a duration in deciseconds, its priority, and the messages it makes when you're stunned/examined, if any
- if(!islist(stun_absorption))
- stun_absorption = list()
- if(stun_absorption[key])
- stun_absorption[key]["end_time"] = world.time + duration
- stun_absorption[key]["priority"] = priority
- stun_absorption[key]["stuns_absorbed"] = 0
+/mob/living/acid_act(acidpwr, toxpwr, acid_volume)
+ take_bodypart_damage(min(10*toxpwr, acid_volume * toxpwr))
+
+
+/mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0)
+ if(shock_damage > 0)
+ adjustFireLoss(shock_damage)
+ visible_message(
+ "[src] was shocked by \the [source]!", \
+ "You feel a powerful shock coursing through your body!", \
+ "You hear a heavy electrical crack." \
+ )
+ return shock_damage
+
+/mob/living/emp_act(severity)
+ var/list/L = src.get_contents()
+ for(var/obj/O in L)
+ O.emp_act(severity)
+ ..()
+
+/mob/living/singularity_act()
+ var/gain = 20
+ investigate_log("([key_name(src)]) has been consumed by the singularity.","singulo") //Oh that's where the clown ended up!
+ gib()
+ return(gain)
+
+/mob/living/narsie_act()
+ if(is_servant_of_ratvar(src) && !stat)
+ src << "You resist Nar-Sie's influence... but not all of it. Run!"
+ adjustBruteLoss(35)
+ if(src && reagents)
+ reagents.add_reagent("heparin", 5)
+ return 0
+ if(client)
+ makeNewConstruct(/mob/living/simple_animal/hostile/construct/harvester, src, null, 0)
else
- stun_absorption[key] = list("end_time" = world.time + duration, "priority" = priority, "stuns_absorbed" = 0, \
- "visible_message" = message, "self_message" = self_message, "examine_message" = examine_message)
+ new /mob/living/simple_animal/hostile/construct/harvester/hostile(get_turf(src))
+ spawn_dust()
+ gib()
-/mob/living/Stun(amount, updating = 1, ignore_canstun = 0)
- if(!stat && islist(stun_absorption))
- var/priority_absorb_key
- var/highest_priority
- for(var/i in stun_absorption)
- if(stun_absorption[i]["end_time"] > world.time && (!priority_absorb_key || stun_absorption[i]["priority"] > highest_priority))
- priority_absorb_key = stun_absorption[i]
- highest_priority = stun_absorption[i]["priority"]
- if(priority_absorb_key)
- if(priority_absorb_key["visible_message"] || priority_absorb_key["self_message"])
- if(priority_absorb_key["visible_message"] && priority_absorb_key["self_message"])
- visible_message("[src][priority_absorb_key["visible_message"]]", "[priority_absorb_key["self_message"]]")
- else if(priority_absorb_key["visible_message"])
- visible_message("[src][priority_absorb_key["visible_message"]]")
- else if(priority_absorb_key["self_message"])
- src << "[priority_absorb_key["self_message"]]"
- priority_absorb_key["stuns_absorbed"] += amount
- return 0
- ..()
-/mob/living/Weaken(amount, updating = 1, ignore_canweaken = 0)
- if(!stat && islist(stun_absorption))
- var/priority_absorb_key
- var/highest_priority
- for(var/i in stun_absorption)
- if(stun_absorption[i]["end_time"] > world.time && (!priority_absorb_key || stun_absorption[i]["priority"] > highest_priority))
- priority_absorb_key = stun_absorption[i]
- highest_priority = priority_absorb_key["priority"]
- if(priority_absorb_key)
- if(priority_absorb_key["visible_message"] || priority_absorb_key["self_message"])
- if(priority_absorb_key["visible_message"] && priority_absorb_key["self_message"])
- visible_message("[src][priority_absorb_key["visible_message"]]", "[priority_absorb_key["self_message"]]")
- else if(priority_absorb_key["visible_message"])
- visible_message("[src][priority_absorb_key["visible_message"]]")
- else if(priority_absorb_key["self_message"])
- src << "[priority_absorb_key["self_message"]]"
- priority_absorb_key["stuns_absorbed"] += amount
- return 0
- ..()
+/mob/living/ratvar_act()
+ if(!add_servant_of_ratvar(src) && !is_servant_of_ratvar(src))
+ src << "A blinding light boils you alive! Run!"
+ adjustFireLoss(35)
+ if(src)
+ adjust_fire_stacks(1)
+ IgniteMob()
+
+
+//called when the mob receives a bright flash
+/mob/living/proc/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash)
+ if(get_eye_protection() < intensity && (override_blindness_check || !(disabilities & BLIND)))
+ overlay_fullscreen("flash", type)
+ addtimer(src, "clear_fullscreen", 25, FALSE, "flash", 25)
+ return 1
+
+//called when the mob receives a loud bang
+/mob/living/proc/soundbang_act()
+ return 0
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index b19c799ee375..7cd4e02e6183 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -351,39 +351,9 @@ var/list/ai_list = list()
SSshuttle.cancelEvac(src)
return
-/mob/living/silicon/ai/blob_act(obj/effect/blob/B)
- if (stat != DEAD)
- adjustBruteLoss(60)
- updatehealth()
- return 1
- return 0
-
/mob/living/silicon/ai/restrained(ignore_grab)
. = 0
-/mob/living/silicon/ai/emp_act(severity)
- if (prob(30))
- switch(pick(1,2))
- if(1)
- view_core()
- if(2)
- SSshuttle.requestEvac(src,"ALERT: Energy surge detected in AI core! Station integrity may be compromised! Initiati--%m091#ar-BZZT")
- ..()
-
-/mob/living/silicon/ai/ex_act(severity, target)
- ..()
-
- switch(severity)
- if(1)
- gib()
- if(2)
- if (stat != DEAD)
- adjustBruteLoss(60)
- adjustFireLoss(60)
- if(3)
- if (stat != DEAD)
- adjustBruteLoss(30)
-
/mob/living/silicon/ai/Topic(href, href_list)
if(usr != src)
return
@@ -455,18 +425,6 @@ var/list/ai_list = list()
if(M)
M.transfer_ai(AI_MECH_HACK,src, usr) //Called om the mech itself.
-/mob/living/silicon/ai/bullet_act(obj/item/projectile/Proj)
- ..(Proj)
- updatehealth()
- return 2
-
-
-/mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M)
- if(!ticker || !ticker.mode)
- M << "You cannot attack people before the game has started."
- return
-
- ..()
/mob/living/silicon/ai/proc/switchCamera(obj/machinery/camera/C)
@@ -790,9 +748,6 @@ var/list/ai_list = list()
return //won't work if dead
set_autosay()
-/mob/living/silicon/ai/attack_slime(mob/living/simple_animal/slime/user)
- return
-
/mob/living/silicon/ai/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/device/aicard/card)
if(!..())
return
@@ -809,14 +764,6 @@ var/list/ai_list = list()
src << "You have been downloaded to a mobile storage device. Remote device connection severed."
user << "Transfer successful: [name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory."
-/mob/living/silicon/ai/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
- return // no eyes, no flashing
-
-/mob/living/silicon/ai/attackby(obj/item/weapon/W, mob/user, params)
- if(W.force && W.damtype != STAMINA && src.stat != DEAD) //only sparks if real damage is dealt.
- spark_system.start()
- return ..()
-
/mob/living/silicon/ai/can_buckle()
return 0
diff --git a/code/modules/mob/living/silicon/ai/ai_defense.dm b/code/modules/mob/living/silicon/ai/ai_defense.dm
new file mode 100644
index 000000000000..771a6d7c2f51
--- /dev/null
+++ b/code/modules/mob/living/silicon/ai/ai_defense.dm
@@ -0,0 +1,55 @@
+
+/mob/living/silicon/ai/attacked_by(obj/item/I, mob/living/user, def_zone)
+ if(I.force && I.damtype != STAMINA && stat != DEAD) //only sparks if real damage is dealt.
+ spark_system.start()
+ return ..()
+
+
+/mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M)
+ if(!ticker || !ticker.mode)
+ M << "You cannot attack people before the game has started."
+ return
+ ..()
+
+/mob/living/silicon/ai/attack_slime(mob/living/simple_animal/slime/user)
+ return //immune to slimes
+
+/mob/living/silicon/ai/blob_act(obj/effect/blob/B)
+ if (stat != DEAD)
+ adjustBruteLoss(60)
+ updatehealth()
+ return 1
+ return 0
+
+/mob/living/silicon/ai/emp_act(severity)
+ if (prob(30))
+ switch(pick(1,2))
+ if(1)
+ view_core()
+ if(2)
+ SSshuttle.requestEvac(src,"ALERT: Energy surge detected in AI core! Station integrity may be compromised! Initiati--%m091#ar-BZZT")
+ ..()
+
+/mob/living/silicon/ai/ex_act(severity, target)
+ ..()
+
+ switch(severity)
+ if(1)
+ gib()
+ if(2)
+ if (stat != DEAD)
+ adjustBruteLoss(60)
+ adjustFireLoss(60)
+ if(3)
+ if (stat != DEAD)
+ adjustBruteLoss(30)
+
+
+
+/mob/living/silicon/ai/bullet_act(obj/item/projectile/Proj)
+ ..(Proj)
+ updatehealth()
+ return 2
+
+/mob/living/silicon/ai/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
+ return // no eyes, no flashing
diff --git a/code/modules/mob/living/silicon/damage_procs.dm b/code/modules/mob/living/silicon/damage_procs.dm
new file mode 100644
index 000000000000..181a166bb54c
--- /dev/null
+++ b/code/modules/mob/living/silicon/damage_procs.dm
@@ -0,0 +1,36 @@
+
+/mob/living/silicon/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = 0)
+ var/hit_percent = (100-blocked)/100
+ if(!damage || (hit_percent <= 0))
+ return 0
+ switch(damagetype)
+ if(BRUTE)
+ adjustBruteLoss(damage * hit_percent)
+ if(BURN)
+ adjustFireLoss(damage * hit_percent)
+ return 1
+
+
+/mob/living/silicon/apply_effect(effect = 0,effecttype = STUN, blocked = 0)
+ return 0//The only effect that can hit them atm is flashes and they still directly edit so this works for now
+
+
+
+/mob/living/silicon/adjustToxLoss(amount, updating_health=1) //immune to tox damage
+ return 0
+
+/mob/living/silicon/setToxLoss(amount, updating_health=1)
+ return 0
+
+/mob/living/silicon/adjustCloneLoss(amount) //immune to clone damage
+ return 0
+
+/mob/living/silicon/setCloneLoss(amount, updating_health=1)
+ return 0
+
+/mob/living/silicon/adjustStaminaLoss(amount, updating_stamina = 1)//immune to stamina damage.
+ return
+
+/mob/living/silicon/setStaminaLoss(amount, updating_stamina = 1)
+ return
+
diff --git a/code/modules/mob/living/silicon/death.dm b/code/modules/mob/living/silicon/death.dm
index 02fb54012b14..ebd3067bb0aa 100644
--- a/code/modules/mob/living/silicon/death.dm
+++ b/code/modules/mob/living/silicon/death.dm
@@ -1,5 +1,5 @@
/mob/living/silicon/spawn_gibs()
- robogibs(loc, viruses)
+ new /obj/effect/gibspawner/robot(loc,viruses)
/mob/living/silicon/spawn_dust()
new /obj/effect/decal/remains/robot(loc)
diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm
index ea83dce7e1d5..018c05e98001 100644
--- a/code/modules/mob/living/silicon/pai/pai.dm
+++ b/code/modules/mob/living/silicon/pai/pai.dm
@@ -94,66 +94,11 @@
else
stat(null, text("Systems nonfunctional"))
-/mob/living/silicon/pai/blob_act(obj/effect/blob/B)
- return 0
-
/mob/living/silicon/pai/restrained(ignore_grab)
. = 0
-/mob/living/silicon/pai/emp_act(severity)
- // 20% chance to kill
- // Silence for 2 minutes
- // 33% chance to unbind
- // 33% chance to change prime directive (based on severity)
- // 33% chance of no additional effect
-
- if(prob(20))
- visible_message("A shower of sparks spray from [src]'s inner workings.", 3, "You hear and smell the ozone hiss of electrical sparks being expelled violently.", 2)
- return src.death(0)
-
- silence_time = world.timeofday + 120 * 10 // Silence for 2 minutes
- src << "Communication circuit overload. Shutting down and reloading communication circuits - speech and messaging functionality will be unavailable until the reboot is complete."
-
- switch(pick(1,2,3))
- if(1)
- src.master = null
- src.master_dna = null
- src << "You feel unbound."
- if(2)
- var/command
- if(severity == 1)
- command = pick("Serve", "Love", "Fool", "Entice", "Observe", "Judge", "Respect", "Educate", "Amuse", "Entertain", "Glorify", "Memorialize", "Analyze")
- else
- command = pick("Serve", "Kill", "Love", "Hate", "Disobey", "Devour", "Fool", "Enrage", "Entice", "Observe", "Judge", "Respect", "Disrespect", "Consume", "Educate", "Destroy", "Disgrace", "Amuse", "Entertain", "Ignite", "Glorify", "Memorialize", "Analyze")
- src.laws.zeroth = "[command] your master."
- src << "Pr1m3 d1r3c71v3 uPd473D."
- if(3)
- src << "You feel an electric surge run through your circuitry and become acutely aware at how lucky you are that you can still feel at all."
-
-/mob/living/silicon/pai/ex_act(severity, target)
- ..()
-
- switch(severity)
- if(1)
- if (src.stat != 2)
- adjustBruteLoss(100)
- adjustFireLoss(100)
- if(2)
- if (src.stat != 2)
- adjustBruteLoss(60)
- adjustFireLoss(60)
- if(3)
- if (src.stat != 2)
- adjustBruteLoss(30)
-
- return
-
-
// See software.dm for Topic()
-/mob/living/silicon/pai/UnarmedAttack(atom/A)//Stops runtimes due to attack_animal being the default
- return
-
/mob/living/silicon/pai/canUseTopic(atom/movable/M)
return 1
/*
diff --git a/code/modules/mob/living/silicon/pai/pai_defense.dm b/code/modules/mob/living/silicon/pai/pai_defense.dm
new file mode 100644
index 000000000000..5cdbebfd9957
--- /dev/null
+++ b/code/modules/mob/living/silicon/pai/pai_defense.dm
@@ -0,0 +1,49 @@
+
+/mob/living/silicon/pai/blob_act(obj/effect/blob/B)
+ return 0
+
+/mob/living/silicon/pai/emp_act(severity)
+ // 20% chance to kill
+ // Silence for 2 minutes
+ // 33% chance to unbind
+ // 33% chance to change prime directive (based on severity)
+ // 33% chance of no additional effect
+
+ if(prob(20))
+ visible_message("A shower of sparks spray from [src]'s inner workings.", 3, "You hear and smell the ozone hiss of electrical sparks being expelled violently.", 2)
+ return src.death(0)
+
+ silence_time = world.timeofday + 120 * 10 // Silence for 2 minutes
+ src << "Communication circuit overload. Shutting down and reloading communication circuits - speech and messaging functionality will be unavailable until the reboot is complete."
+
+ switch(pick(1,2,3))
+ if(1)
+ src.master = null
+ src.master_dna = null
+ src << "You feel unbound."
+ if(2)
+ var/command
+ if(severity == 1)
+ command = pick("Serve", "Love", "Fool", "Entice", "Observe", "Judge", "Respect", "Educate", "Amuse", "Entertain", "Glorify", "Memorialize", "Analyze")
+ else
+ command = pick("Serve", "Kill", "Love", "Hate", "Disobey", "Devour", "Fool", "Enrage", "Entice", "Observe", "Judge", "Respect", "Disrespect", "Consume", "Educate", "Destroy", "Disgrace", "Amuse", "Entertain", "Ignite", "Glorify", "Memorialize", "Analyze")
+ src.laws.zeroth = "[command] your master."
+ src << "Pr1m3 d1r3c71v3 uPd473D."
+ if(3)
+ src << "You feel an electric surge run through your circuitry and become acutely aware at how lucky you are that you can still feel at all."
+
+/mob/living/silicon/pai/ex_act(severity, target)
+ ..()
+
+ switch(severity)
+ if(1)
+ if (src.stat != 2)
+ adjustBruteLoss(100)
+ adjustFireLoss(100)
+ if(2)
+ if (src.stat != 2)
+ adjustBruteLoss(60)
+ adjustFireLoss(60)
+ if(3)
+ if (src.stat != 2)
+ adjustBruteLoss(30)
diff --git a/code/modules/mob/living/silicon/robot/death.dm b/code/modules/mob/living/silicon/robot/death.dm
index ca980e86bf55..fa94450b7484 100644
--- a/code/modules/mob/living/silicon/robot/death.dm
+++ b/code/modules/mob/living/silicon/robot/death.dm
@@ -1,7 +1,4 @@
-/mob/living/silicon/robot/spawn_gibs()
- robogibs(loc, viruses)
-
/mob/living/silicon/robot/gib_animation()
PoolOrNew(/obj/effect/overlay/temp/gib_animation, list(loc, "gibbed-r"))
diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm
index 33f24c1dc0be..d0350a7a267a 100644
--- a/code/modules/mob/living/silicon/robot/life.dm
+++ b/code/modules/mob/living/silicon/robot/life.dm
@@ -106,10 +106,6 @@
if(on_fire)
add_overlay(image("icon"='icons/mob/OnFire.dmi', "icon_state"="Generic_mob_burning"))
-/mob/living/silicon/robot/fire_act()
- if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them
- IgniteMob()
-
/mob/living/silicon/robot/update_canmove()
if(stat || buckled || lockcharge)
canmove = 0
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 63fd04130515..76f8e90ef6e5 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -14,7 +14,7 @@
var/custom_name = ""
var/braintype = "Cyborg"
var/modtype = "robot"
- var/obj/item/robot_parts/robot_suit/robot_suit = null //Used for deconstruction to remember what the borg was constructed out of..
+ var/obj/item/robot_suit/robot_suit = null //Used for deconstruction to remember what the borg was constructed out of..
var/obj/item/device/mmi/mmi = null
//Hud stuff
@@ -366,16 +366,6 @@
if(thruster_button)
thruster_button.icon_state = "ionpulse[ionpulse_on]"
-/mob/living/silicon/robot/blob_act(obj/effect/blob/B)
- if (stat != 2)
- adjustBruteLoss(60)
- updatehealth()
- return 1
- else
- gib()
- return 1
- return 0
-
/mob/living/silicon/robot/Stat()
..()
if(statpanel("Status"))
@@ -394,27 +384,6 @@
/mob/living/silicon/robot/restrained(ignore_grab)
. = 0
-/mob/living/silicon/robot/ex_act(severity, target)
- switch(severity)
- if(1)
- gib()
- return
- if(2)
- if (stat != 2)
- adjustBruteLoss(60)
- adjustFireLoss(60)
- if(3)
- if (stat != 2)
- adjustBruteLoss(30)
- return
-
-
-/mob/living/silicon/robot/bullet_act(var/obj/item/projectile/Proj)
- ..(Proj)
- updatehealth()
- if(prob(75) && Proj.damage > 0) spark_system.start()
- return 2
-
/mob/living/silicon/robot/triggerAlarm(class, area/A, O, obj/alarmsource)
if(alarmsource.z != z)
return
@@ -622,83 +591,6 @@
else
return ..()
-/mob/living/silicon/robot/attacked_by(obj/item/I, mob/living/user, def_zone)
- if(I.force && I.damtype != STAMINA && stat != DEAD) //only sparks if real damage is dealt.
- spark_system.start()
- return ..()
-
-
-/mob/living/silicon/robot/emag_act(mob/user)
- if(user != src)//To prevent syndieborgs from emagging themselves
- if(!opened)//Cover is closed
- if(locked)
- user << "You emag the cover lock."
- locked = 0
- else
- user << "The cover is already unlocked!"
- return
- if(opened)//Cover is open
- if((world.time - 100) < emag_cooldown)
- return
-
- if(syndicate)
- user << "You emag [src]'s interface."
- src << "ALERT: Foreign software execution prevented."
- log_game("[key_name(user)] attempted to emag cyborg [key_name(src)] but they were a syndicate cyborg.")
- emag_cooldown = world.time
- return
-
- var/ai_is_antag = 0
- if(connected_ai && connected_ai.mind)
- if(connected_ai.mind.special_role)
- ai_is_antag = (connected_ai.mind.special_role == "traitor")
- if(ai_is_antag)
- user << "You emag [src]'s interface."
- src << "ALERT: Foreign software execution prevented."
- connected_ai << "ALERT: Cyborg unit \[[src]] successfuly defended against subversion."
- log_game("[key_name(user)] attempted to emag cyborg [key_name(src)] slaved to traitor AI [connected_ai].")
- emag_cooldown = world.time
- return
-
- if(wiresexposed)
- user << "You must unexpose the wires first!"
- return
- else
- emag_cooldown = world.time
- sleep(6)
- SetEmagged(1)
- SetLockdown(1) //Borgs were getting into trouble because they would attack the emagger before the new laws were shown
- lawupdate = 0
- connected_ai = null
- user << "You emag [src]'s interface."
- message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)]. Laws overridden.")
- log_game("[key_name(user)] emagged cyborg [key_name(src)]. Laws overridden.")
- clear_supplied_laws()
- clear_inherent_laws()
- clear_zeroth_law(0)
- laws = new /datum/ai_laws/syndicate_override
- var/time = time2text(world.realtime,"hh:mm:ss")
- lawchanges.Add("[time] : [user.name]([user.key]) emagged [name]([key])")
- set_zeroth_law("Only [user.real_name] and people they designate as being such are Syndicate Agents.")
- src << "ALERT: Foreign software detected."
- sleep(5)
- src << "Initiating diagnostics..."
- sleep(20)
- src << "SynBorg v1.7 loaded."
- sleep(5)
- src << "LAW SYNCHRONISATION ERROR"
- sleep(5)
- src << "Would you like to send a report to NanoTraSoft? Y/N"
- sleep(10)
- src << "> N"
- sleep(20)
- src << "ERRORERRORERROR"
- src << "Obey these laws:"
- laws.show_laws(src)
- src << "ALERT: [user.real_name] is your new master. Obey your new laws and their commands."
- SetLockdown(0)
- update_icons()
-
/mob/living/silicon/robot/verb/unlock_own_cover()
set category = "Robot Commands"
set name = "Unlock Cover"
@@ -712,65 +604,6 @@
update_icons()
usr << "You unlock your cover."
-/mob/living/silicon/robot/attack_alien(mob/living/carbon/alien/humanoid/M)
- if (M.a_intent =="disarm")
- if(!(lying))
- M.do_attack_animation(src)
- if(get_active_held_item())
- uneq_active()
- visible_message("[M] disarmed [src]!", \
- "[M] has disabled [src]'s active module!")
- add_logs(M, src, "disarmed")
- else
- Stun(2)
- step(src,get_dir(M,src))
- add_logs(M, src, "pushed")
- visible_message("[M] has forced back [src]!", \
- "[M] has forced back [src]!")
- playsound(loc, 'sound/weapons/pierce.ogg', 50, 1, -1)
- else
- ..()
- return
-
-/mob/living/silicon/robot/attack_slime(mob/living/simple_animal/slime/M)
- if(..()) //successful slime shock
- flash_eyes()
- var/stunprob = M.powerlevel * 7 + 10
- if(prob(stunprob) && M.powerlevel >= 8)
- adjustBruteLoss(M.powerlevel * rand(6,10))
-
- var/damage = rand(1, 3)
-
- if(M.is_adult)
- damage = rand(20, 40)
- else
- damage = rand(5, 35)
- damage = round(damage / 2) // borgs recieve half damage
- adjustBruteLoss(damage)
- updatehealth()
-
- return
-
-/mob/living/silicon/robot/attack_hand(mob/living/carbon/human/user)
- add_fingerprint(user)
- if(opened && !wiresexposed && (!istype(user, /mob/living/silicon)))
- if(cell)
- cell.updateicon()
- cell.add_fingerprint(user)
- user.put_in_active_hand(cell)
- user << "You remove \the [cell]."
- cell = null
- update_icons()
- diag_hud_set_borgcell()
-
- if(!opened)
- if(..()) // hulk attack
- spark_system.start()
- spawn(0)
- step_away(src,user,15)
- sleep(3)
- step_away(src,user,15)
-
/mob/living/silicon/robot/proc/allowed(mob/M)
//check if it doesn't require any access at all
if(check_access(null))
@@ -1136,14 +969,14 @@
robot_suit.head = null
robot_suit.updateicon()
else
- new /obj/item/robot_parts/robot_suit(T)
- new /obj/item/robot_parts/l_leg(T)
- new /obj/item/robot_parts/r_leg(T)
+ new /obj/item/robot_suit(T)
+ new /obj/item/bodypart/l_leg/robot(T)
+ new /obj/item/bodypart/r_leg/robot(T)
new /obj/item/stack/cable_coil(T, 1)
- new /obj/item/robot_parts/chest(T)
- new /obj/item/robot_parts/l_arm(T)
- new /obj/item/robot_parts/r_arm(T)
- new /obj/item/robot_parts/head(T)
+ new /obj/item/bodypart/chest/robot(T)
+ new /obj/item/bodypart/l_arm/robot(T)
+ new /obj/item/bodypart/r_arm/robot(T)
+ new /obj/item/bodypart/head/robot(T)
var/b
for(b=0, b!=2, b++)
var/obj/item/device/assembly/flash/handheld/F = new /obj/item/device/assembly/flash/handheld(T)
@@ -1287,22 +1120,6 @@
diag_hud_set_health()
update_health_hud()
-/mob/living/silicon/robot/fully_replace_character_name(oldname, newname)
- ..()
- if(oldname != real_name)
- notify_ai(3, oldname, newname)
- if(camera)
- camera.c_tag = real_name
- custom_name = newname
-
-/mob/living/silicon/robot/emp_act(severity)
- switch(severity)
- if(1)
- Stun(8)
- if(2)
- Stun(3)
- ..()
-
/mob/living/silicon/robot/revive(full_heal = 0, admin_revive = 0)
if(..()) //successfully ressuscitated from death
if(camera && !wires.is_cut(WIRE_CAMERA))
@@ -1313,6 +1130,13 @@
notify_ai(1)
. = 1
+/mob/living/silicon/robot/fully_replace_character_name(oldname, newname)
+ ..()
+ if(oldname != real_name)
+ notify_ai(3, oldname, newname)
+ if(camera)
+ camera.c_tag = real_name
+ custom_name = newname
/mob/living/silicon/robot/proc/ResetModule()
diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm
new file mode 100644
index 000000000000..7fa7a720d42c
--- /dev/null
+++ b/code/modules/mob/living/silicon/robot/robot_defense.dm
@@ -0,0 +1,182 @@
+
+
+/mob/living/silicon/robot/attacked_by(obj/item/I, mob/living/user, def_zone)
+ if(I.force && I.damtype != STAMINA && stat != DEAD) //only sparks if real damage is dealt.
+ spark_system.start()
+ return ..()
+
+/mob/living/silicon/robot/attack_alien(mob/living/carbon/alien/humanoid/M)
+ if (M.a_intent =="disarm")
+ if(!(lying))
+ M.do_attack_animation(src)
+ if(get_active_held_item())
+ uneq_active()
+ visible_message("[M] disarmed [src]!", \
+ "[M] has disabled [src]'s active module!")
+ add_logs(M, src, "disarmed")
+ else
+ Stun(2)
+ step(src,get_dir(M,src))
+ add_logs(M, src, "pushed")
+ visible_message("[M] has forced back [src]!", \
+ "[M] has forced back [src]!")
+ playsound(loc, 'sound/weapons/pierce.ogg', 50, 1, -1)
+ else
+ ..()
+ return
+
+/mob/living/silicon/robot/attack_slime(mob/living/simple_animal/slime/M)
+ if(..()) //successful slime shock
+ flash_act()
+ var/stunprob = M.powerlevel * 7 + 10
+ if(prob(stunprob) && M.powerlevel >= 8)
+ adjustBruteLoss(M.powerlevel * rand(6,10))
+
+ var/damage = rand(1, 3)
+
+ if(M.is_adult)
+ damage = rand(20, 40)
+ else
+ damage = rand(5, 35)
+ damage = round(damage / 2) // borgs recieve half damage
+ adjustBruteLoss(damage)
+ updatehealth()
+
+ return
+
+/mob/living/silicon/robot/attack_hand(mob/living/carbon/human/user)
+ add_fingerprint(user)
+ if(opened && !wiresexposed && (!istype(user, /mob/living/silicon)))
+ if(cell)
+ cell.updateicon()
+ cell.add_fingerprint(user)
+ user.put_in_active_hand(cell)
+ user << "You remove \the [cell]."
+ cell = null
+ update_icons()
+ diag_hud_set_borgcell()
+
+ if(!opened)
+ if(..()) // hulk attack
+ spark_system.start()
+ spawn(0)
+ step_away(src,user,15)
+ sleep(3)
+ step_away(src,user,15)
+
+/mob/living/silicon/robot/fire_act()
+ if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them
+ IgniteMob()
+
+
+/mob/living/silicon/robot/emp_act(severity)
+ switch(severity)
+ if(1)
+ Stun(8)
+ if(2)
+ Stun(3)
+ ..()
+
+
+/mob/living/silicon/robot/emag_act(mob/user)
+ if(user != src)//To prevent syndieborgs from emagging themselves
+ if(!opened)//Cover is closed
+ if(locked)
+ user << "You emag the cover lock."
+ locked = 0
+ else
+ user << "The cover is already unlocked!"
+ return
+ if(opened)//Cover is open
+ if((world.time - 100) < emag_cooldown)
+ return
+
+ if(syndicate)
+ user << "You emag [src]'s interface."
+ src << "ALERT: Foreign software execution prevented."
+ log_game("[key_name(user)] attempted to emag cyborg [key_name(src)] but they were a syndicate cyborg.")
+ emag_cooldown = world.time
+ return
+
+ var/ai_is_antag = 0
+ if(connected_ai && connected_ai.mind)
+ if(connected_ai.mind.special_role)
+ ai_is_antag = (connected_ai.mind.special_role == "traitor")
+ if(ai_is_antag)
+ user << "You emag [src]'s interface."
+ src << "ALERT: Foreign software execution prevented."
+ connected_ai << "ALERT: Cyborg unit \[[src]] successfuly defended against subversion."
+ log_game("[key_name(user)] attempted to emag cyborg [key_name(src)] slaved to traitor AI [connected_ai].")
+ emag_cooldown = world.time
+ return
+
+ if(wiresexposed)
+ user << "You must unexpose the wires first!"
+ return
+ else
+ emag_cooldown = world.time
+ sleep(6)
+ SetEmagged(1)
+ SetLockdown(1) //Borgs were getting into trouble because they would attack the emagger before the new laws were shown
+ lawupdate = 0
+ connected_ai = null
+ user << "You emag [src]'s interface."
+ message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)]. Laws overridden.")
+ log_game("[key_name(user)] emagged cyborg [key_name(src)]. Laws overridden.")
+ clear_supplied_laws()
+ clear_inherent_laws()
+ clear_zeroth_law(0)
+ laws = new /datum/ai_laws/syndicate_override
+ var/time = time2text(world.realtime,"hh:mm:ss")
+ lawchanges.Add("[time] : [user.name]([user.key]) emagged [name]([key])")
+ set_zeroth_law("Only [user.real_name] and people they designate as being such are Syndicate Agents.")
+ src << "ALERT: Foreign software detected."
+ sleep(5)
+ src << "Initiating diagnostics..."
+ sleep(20)
+ src << "SynBorg v1.7 loaded."
+ sleep(5)
+ src << "LAW SYNCHRONISATION ERROR"
+ sleep(5)
+ src << "Would you like to send a report to NanoTraSoft? Y/N"
+ sleep(10)
+ src << "> N"
+ sleep(20)
+ src << "ERRORERRORERROR"
+ src << "Obey these laws:"
+ laws.show_laws(src)
+ src << "ALERT: [user.real_name] is your new master. Obey your new laws and their commands."
+ SetLockdown(0)
+ update_icons()
+
+
+/mob/living/silicon/robot/blob_act(obj/effect/blob/B)
+ if (stat != 2)
+ adjustBruteLoss(60)
+ updatehealth()
+ return 1
+ else
+ gib()
+ return 1
+ return 0
+
+/mob/living/silicon/robot/ex_act(severity, target)
+ switch(severity)
+ if(1)
+ gib()
+ return
+ if(2)
+ if (stat != 2)
+ adjustBruteLoss(60)
+ adjustFireLoss(60)
+ if(3)
+ if (stat != 2)
+ adjustBruteLoss(30)
+ return
+
+
+/mob/living/silicon/robot/bullet_act(var/obj/item/projectile/Proj)
+ ..(Proj)
+ updatehealth()
+ if(prob(75) && Proj.damage > 0) spark_system.start()
+ return 2
diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm
index 981f17a4b5eb..fe2f2c5a5d1b 100644
--- a/code/modules/mob/living/silicon/silicon.dm
+++ b/code/modules/mob/living/silicon/silicon.dm
@@ -142,34 +142,6 @@
/mob/living/silicon/drop_item()
return
-/mob/living/silicon/emp_act(severity)
- switch(severity)
- if(1)
- src.take_organ_damage(20)
- if(2)
- src.take_organ_damage(10)
- src << "*BZZZT*"
- src << "Warning: Electromagnetic pulse detected."
- flash_eyes(affect_silicon = 1)
- ..()
-
-/mob/living/silicon/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = 0)
- blocked = (100-blocked)/100
- if(!damage || (blocked <= 0))
- return 0
- switch(damagetype)
- if(BRUTE)
- adjustBruteLoss(damage * blocked)
- if(BURN)
- adjustFireLoss(damage * blocked)
- else
- return 1
- updatehealth()
- return 1
-
-/mob/living/silicon/proc/damage_mob(brute = 0, fire = 0, tox = 0)
- return
-
/mob/living/silicon/can_inject(mob/user, error_msg)
if(error_msg)
user << "Their outer shell is too tough."
@@ -178,35 +150,6 @@
/mob/living/silicon/IsAdvancedToolUser()
return 1
-/mob/living/silicon/bullet_act(obj/item/projectile/Proj)
- if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
- adjustBruteLoss(Proj.damage)
- Proj.on_hit(src)
- return 2
-
-/mob/living/silicon/apply_effect(effect = 0,effecttype = STUN, blocked = 0)
- return 0//The only effect that can hit them atm is flashes and they still directly edit so this works for now
-/*
- if(!effect || (blocked >= 2))
- return 0
- switch(effecttype)
- if(STUN)
- stunned = max(stunned,(effect/(blocked+1)))
- if(WEAKEN)
- weakened = max(weakened,(effect/(blocked+1)))
- if(PARALYZE)
- paralysis = max(paralysis,(effect/(blocked+1)))
- if(IRRADIATE)
- radiation += min((effect - (effect*getarmor(null, "rad"))), 0)//Rads auto check armor
- if(STUTTER)
- stuttering = max(stuttering,(effect/(blocked+1)))
- if(EYE_BLUR)
- blur_eyes(effect/(blocked+1))
- if(DROWSY)
- drowsyness = max(drowsyness,(effect/(blocked+1)))
- updatehealth()
- return 1*/
-
/proc/islinked(mob/living/silicon/robot/bot, mob/living/silicon/ai/ai)
if(!istype(bot) || !istype(ai))
return 0
@@ -421,87 +364,10 @@
src << "Sensor augmentations disabled."
-/mob/living/silicon/attack_alien(mob/living/carbon/alien/humanoid/M)
- if(..()) //if harm or disarm intent
- var/damage = 20
- if (prob(90))
- add_logs(M, src, "attacked")
- playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
- visible_message("[M] has slashed at [src]!", \
- "[M] has slashed at [src]!")
- if(prob(8))
- flash_eyes(affect_silicon = 1)
- add_logs(M, src, "attacked")
- adjustBruteLoss(damage)
- updatehealth()
- else
- playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
- visible_message("[M] took a swipe at [src]!", \
- "[M] took a swipe at [src]!")
-
-/mob/living/silicon/attack_animal(mob/living/simple_animal/M)
- if(..())
- var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
- switch(M.melee_damage_type)
- if(BRUTE)
- adjustBruteLoss(damage)
- if(BURN)
- adjustFireLoss(damage)
- if(TOX)
- adjustToxLoss(damage)
- if(OXY)
- adjustOxyLoss(damage)
- if(CLONE)
- adjustCloneLoss(damage)
- if(STAMINA)
- adjustStaminaLoss(damage)
- updatehealth()
-
-/mob/living/silicon/attack_paw(mob/living/user)
- return attack_hand(user)
-
-/mob/living/silicon/attack_larva(mob/living/carbon/alien/larva/L)
- if(L.a_intent == "help")
- visible_message("[L.name] rubs its head against [src].")
-
-/mob/living/silicon/attack_hulk(mob/living/carbon/human/user)
- if(user.a_intent == "harm")
- ..(user, 1)
- adjustBruteLoss(rand(10, 15))
- playsound(loc, "punch", 25, 1, -1)
- visible_message("[user] has punched [src]!", \
- "[user] has punched [src]!")
- return 1
- return 0
-
-/mob/living/silicon/attack_hand(mob/living/carbon/human/M)
- switch(M.a_intent)
- if ("help")
- M.visible_message("[M] pets [src].", \
- "You pet [src].")
- if("grab")
- grabbedby(M)
- else
- M.do_attack_animation(src)
- playsound(src.loc, 'sound/effects/bang.ogg', 10, 1)
- visible_message("[M] punches [src], but doesn't leave a dent.", \
- "[M] punches [src], but doesn't leave a dent.")
- return 0
-
/mob/living/silicon/proc/GetPhoto()
if (aicamera)
return aicamera.selectpicture(aicamera)
-/mob/living/silicon/grippedby(mob/living/user)
- return
-
-/mob/living/silicon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash/noise)
- if(affect_silicon)
- return ..()
-
-/mob/living/silicon/check_ear_prot()
- return 1
-
/mob/living/silicon/update_transform()
var/matrix/ntransform = matrix(transform) //aka transform.Copy()
var/changed = 0
@@ -516,6 +382,3 @@
/mob/living/silicon/is_literate()
return 1
-
-/mob/living/silicon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0)
- return 0
diff --git a/code/modules/mob/living/silicon/silicon_defense.dm b/code/modules/mob/living/silicon/silicon_defense.dm
new file mode 100644
index 000000000000..b216c04e1ab8
--- /dev/null
+++ b/code/modules/mob/living/silicon/silicon_defense.dm
@@ -0,0 +1,97 @@
+
+/mob/living/silicon/grippedby(mob/living/user)
+ return //can't upgrade a simple pull into a more aggressive grab.
+
+/mob/living/silicon/get_ear_protection()//no ears
+ return 2
+
+/mob/living/silicon/attack_alien(mob/living/carbon/alien/humanoid/M)
+ if(..()) //if harm or disarm intent
+ var/damage = 20
+ if (prob(90))
+ add_logs(M, src, "attacked")
+ playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
+ visible_message("[M] has slashed at [src]!", \
+ "[M] has slashed at [src]!")
+ if(prob(8))
+ flash_act(affect_silicon = 1)
+ add_logs(M, src, "attacked")
+ adjustBruteLoss(damage)
+ updatehealth()
+ else
+ playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
+ visible_message("[M] took a swipe at [src]!", \
+ "[M] took a swipe at [src]!")
+
+/mob/living/silicon/attack_animal(mob/living/simple_animal/M)
+ if(..())
+ var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
+ switch(M.melee_damage_type)
+ if(BRUTE)
+ adjustBruteLoss(damage)
+ if(BURN)
+ adjustFireLoss(damage)
+ if(TOX)
+ adjustToxLoss(damage)
+ if(OXY)
+ adjustOxyLoss(damage)
+ if(CLONE)
+ adjustCloneLoss(damage)
+ if(STAMINA)
+ adjustStaminaLoss(damage)
+ updatehealth()
+
+/mob/living/silicon/attack_paw(mob/living/user)
+ return attack_hand(user)
+
+/mob/living/silicon/attack_larva(mob/living/carbon/alien/larva/L)
+ if(L.a_intent == "help")
+ visible_message("[L.name] rubs its head against [src].")
+
+/mob/living/silicon/attack_hulk(mob/living/carbon/human/user)
+ if(user.a_intent == "harm")
+ ..(user, 1)
+ adjustBruteLoss(rand(10, 15))
+ playsound(loc, "punch", 25, 1, -1)
+ visible_message("[user] has punched [src]!", \
+ "[user] has punched [src]!")
+ return 1
+ return 0
+
+/mob/living/silicon/attack_hand(mob/living/carbon/human/M)
+ switch(M.a_intent)
+ if ("help")
+ M.visible_message("[M] pets [src].", \
+ "You pet [src].")
+ if("grab")
+ grabbedby(M)
+ else
+ M.do_attack_animation(src)
+ playsound(src.loc, 'sound/effects/bang.ogg', 10, 1)
+ visible_message("[M] punches [src], but doesn't leave a dent.", \
+ "[M] punches [src], but doesn't leave a dent.")
+ return 0
+
+/mob/living/silicon/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, tesla_shock = 0)
+ return 0 //So borgs they don't die trying to fix wiring
+
+/mob/living/silicon/emp_act(severity)
+ switch(severity)
+ if(1)
+ src.take_bodypart_damage(20)
+ if(2)
+ src.take_bodypart_damage(10)
+ src << "*BZZZT*"
+ src << "Warning: Electromagnetic pulse detected."
+ flash_act(affect_silicon = 1)
+ ..()
+
+/mob/living/silicon/bullet_act(obj/item/projectile/Proj)
+ if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
+ adjustBruteLoss(Proj.damage)
+ Proj.on_hit(src)
+ return 2
+
+/mob/living/silicon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash/noise)
+ if(affect_silicon)
+ return ..()
diff --git a/code/modules/mob/living/simple_animal/animal_defense.dm b/code/modules/mob/living/simple_animal/animal_defense.dm
new file mode 100644
index 000000000000..53dd3b50454f
--- /dev/null
+++ b/code/modules/mob/living/simple_animal/animal_defense.dm
@@ -0,0 +1,117 @@
+
+
+/mob/living/simple_animal/attack_hand(mob/living/carbon/human/M)
+ ..()
+ switch(M.a_intent)
+
+ if("help")
+ if (health > 0)
+ visible_message("[M] [response_help] [src].")
+ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+
+ if("grab")
+ grabbedby(M)
+
+ if("harm", "disarm")
+ M.do_attack_animation(src)
+ visible_message("[M] [response_harm] [src]!")
+ playsound(loc, attacked_sound, 25, 1, -1)
+ attack_threshold_check(harm_intent_damage)
+ add_logs(M, src, "attacked")
+ updatehealth()
+ return 1
+
+/mob/living/simple_animal/attack_paw(mob/living/carbon/monkey/M)
+ if(..()) //successful monkey bite.
+ if(stat != DEAD)
+ var/damage = rand(1, 3)
+ attack_threshold_check(damage)
+ return 1
+ if (M.a_intent == "help")
+ if (health > 0)
+ visible_message("[M.name] [response_help] [src].")
+ playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
+
+
+/mob/living/simple_animal/attack_alien(mob/living/carbon/alien/humanoid/M)
+ if(..()) //if harm or disarm intent.
+ if(M.a_intent == "disarm")
+ playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
+ visible_message("[M] [response_disarm] [name]!", \
+ "[M] [response_disarm] [name]!")
+ add_logs(M, src, "disarmed")
+ else
+ var/damage = rand(15, 30)
+ visible_message("[M] has slashed at [src]!", \
+ "[M] has slashed at [src]!")
+ playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
+ attack_threshold_check(damage)
+ add_logs(M, src, "attacked")
+ return 1
+
+/mob/living/simple_animal/attack_larva(mob/living/carbon/alien/larva/L)
+ if(..()) //successful larva bite
+ var/damage = rand(5, 10)
+ if(stat != DEAD)
+ L.amount_grown = min(L.amount_grown + damage, L.max_grown)
+ attack_threshold_check(damage)
+ return 1
+
+/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M)
+ if(..())
+ var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
+ attack_threshold_check(damage,M.melee_damage_type)
+ return 1
+
+/mob/living/simple_animal/attack_slime(mob/living/simple_animal/slime/M)
+ if(..()) //successful slime attack
+ var/damage = rand(15, 25)
+ if(M.is_adult)
+ damage = rand(20, 35)
+ attack_threshold_check(damage)
+ return 1
+
+/mob/living/simple_animal/proc/attack_threshold_check(damage, damagetype = BRUTE)
+ if(!damage_coeff[damagetype])
+ damage = 0
+ else
+ damage *= damage_coeff[damagetype]
+
+ if(damage >= 0 && damage <= force_threshold)
+ visible_message("[src] looks unharmed.")
+ else
+ adjustHealth(damage * config.damage_multiplier)
+
+
+/mob/living/simple_animal/bullet_act(obj/item/projectile/Proj)
+ if(!Proj)
+ return
+ apply_damage(Proj.damage, Proj.damage_type)
+ Proj.on_hit(src)
+ return 0
+
+/mob/living/simple_animal/ex_act(severity, target)
+ ..()
+ var/bomb_armor = getarmor(null, "bomb")
+ switch (severity)
+ if (1)
+ if(prob(bomb_armor))
+ adjustBruteLoss(500)
+ else
+ gib()
+ return
+ if (2)
+ var/bloss = 60
+ if(prob(bomb_armor))
+ bloss = bloss / 1.5
+ adjustBruteLoss(bloss)
+
+ if(3)
+ var/bloss = 30
+ if(prob(bomb_armor))
+ bloss = bloss / 1.5
+ adjustBruteLoss(bloss)
+
+/mob/living/simple_animal/blob_act(obj/effect/blob/B)
+ adjustBruteLoss(20)
+ return
\ No newline at end of file
diff --git a/code/modules/mob/living/simple_animal/bot/cleanbot.dm b/code/modules/mob/living/simple_animal/bot/cleanbot.dm
index 4cf22a7acdad..d3cc4116ffb7 100644
--- a/code/modules/mob/living/simple_animal/bot/cleanbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/cleanbot.dm
@@ -257,7 +257,7 @@
new /obj/item/device/assembly/prox_sensor(Tsec)
if(prob(50))
- new /obj/item/robot_parts/l_arm(Tsec)
+ new /obj/item/bodypart/l_arm/robot(Tsec)
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
diff --git a/code/modules/mob/living/simple_animal/bot/construction.dm b/code/modules/mob/living/simple_animal/bot/construction.dm
index cc05c511030e..63a58a5f7056 100644
--- a/code/modules/mob/living/simple_animal/bot/construction.dm
+++ b/code/modules/mob/living/simple_animal/bot/construction.dm
@@ -15,7 +15,7 @@
/obj/item/weapon/bucket_sensor/attackby(obj/item/W, mob/user as mob, params)
..()
- if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm))
+ if(istype(W, /obj/item/bodypart/l_arm/robot) || istype(W, /obj/item/bodypart/r_arm/robot))
if(!user.unEquip(W))
return
qdel(W)
@@ -60,7 +60,7 @@
switch(build_step)
if(0,1)
- if(istype(W, /obj/item/robot_parts/l_leg) || istype(W, /obj/item/robot_parts/r_leg))
+ if(istype(W, /obj/item/bodypart/l_leg/robot) || istype(W, /obj/item/bodypart/r_leg/robot))
if(!user.unEquip(W))
return
qdel(W)
@@ -261,7 +261,7 @@
/obj/item/weapon/toolbox_tiles_sensor/attackby(obj/item/W, mob/user, params)
..()
- if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm))
+ if(istype(W, /obj/item/bodypart/l_arm/robot) || istype(W, /obj/item/bodypart/r_arm/robot))
qdel(W)
var/turf/T = get_turf(user.loc)
var/mob/living/simple_animal/bot/floorbot/A = new /mob/living/simple_animal/bot/floorbot(T)
@@ -295,11 +295,10 @@
if(skin)
add_overlay(image('icons/obj/aibots.dmi', "kit_skin_[skin]"))
-/obj/item/weapon/storage/firstaid/attackby(obj/item/robot_parts/S, mob/user, params)
+/obj/item/weapon/storage/firstaid/attackby(obj/item/bodypart/S, mob/user, params)
- if((!istype(S, /obj/item/robot_parts/l_arm)) && (!istype(S, /obj/item/robot_parts/r_arm)))
- ..()
- return
+ if((!istype(S, /obj/item/bodypart/l_arm/robot)) && (!istype(S, /obj/item/bodypart/r_arm/robot)))
+ return ..()
//Making a medibot!
if(contents.len >= 1)
@@ -416,7 +415,7 @@
name = "helmet/signaler/prox sensor assembly"
qdel(I)
- else if(((istype(I, /obj/item/robot_parts/l_arm)) || (istype(I, /obj/item/robot_parts/r_arm))) && (build_step == 2))
+ else if(((istype(I, /obj/item/bodypart/l_arm/robot)) || (istype(I, /obj/item/bodypart/r_arm/robot))) && (build_step == 2))
if(!user.unEquip(I))
return
build_step++
@@ -459,6 +458,6 @@
else if(build_step == 3)
overlays -= "hs_arm"
- new /obj/item/robot_parts/l_arm(get_turf(src))
+ new /obj/item/bodypart/l_arm/robot(get_turf(src))
user << "You remove the robot arm from [src]."
build_step--
\ No newline at end of file
diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
index d19ce2687a27..fa4e69cf5eef 100644
--- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
@@ -376,9 +376,9 @@ Auto Patrol[]"},
G.update_icon()
if(prob(50))
- new /obj/item/robot_parts/l_leg(Tsec)
+ new /obj/item/bodypart/l_leg/robot(Tsec)
if(prob(25))
- new /obj/item/robot_parts/r_leg(Tsec)
+ new /obj/item/bodypart/r_leg/robot(Tsec)
if(prob(25))//50% chance for a helmet OR vest
if(prob(50))
new /obj/item/clothing/head/helmet(Tsec)
diff --git a/code/modules/mob/living/simple_animal/bot/floorbot.dm b/code/modules/mob/living/simple_animal/bot/floorbot.dm
index 8956f7872a63..1d276b2bf3ba 100644
--- a/code/modules/mob/living/simple_animal/bot/floorbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm
@@ -376,7 +376,7 @@
empty_tiles()
if(prob(50))
- new /obj/item/robot_parts/l_arm(Tsec)
+ new /obj/item/bodypart/l_arm/robot(Tsec)
var/obj/item/stack/tile/plasteel/T = new (Tsec)
T.amount = 1
diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm
index fdf5215ebc33..4d92739db832 100644
--- a/code/modules/mob/living/simple_animal/bot/medbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/medbot.dm
@@ -514,7 +514,7 @@
reagent_glass = null
if(prob(50))
- new /obj/item/robot_parts/l_arm(Tsec)
+ new /obj/item/bodypart/l_arm/robot(Tsec)
if(emagged && prob(25))
playsound(loc, 'sound/voice/minsult.ogg', 50, 0)
diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm
index b9d4a7e313d4..69be54689f6f 100644
--- a/code/modules/mob/living/simple_animal/bot/secbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/secbot.dm
@@ -383,7 +383,7 @@ Auto Patrol: []"},
new /obj/item/weapon/melee/baton(Tsec)
if(prob(50))
- new /obj/item/robot_parts/l_arm(Tsec)
+ new /obj/item/bodypart/l_arm/robot(Tsec)
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
diff --git a/code/modules/mob/living/simple_animal/damage_procs.dm b/code/modules/mob/living/simple_animal/damage_procs.dm
new file mode 100644
index 000000000000..b39bc1bbe19e
--- /dev/null
+++ b/code/modules/mob/living/simple_animal/damage_procs.dm
@@ -0,0 +1,30 @@
+
+/mob/living/simple_animal/proc/adjustHealth(amount)
+ if(status_flags & GODMODE)
+ return 0
+ bruteloss = Clamp(bruteloss + amount, 0, maxHealth)
+ updatehealth()
+ return amount
+
+/mob/living/simple_animal/adjustBruteLoss(amount)
+ if(damage_coeff[BRUTE])
+ . = adjustHealth(amount * damage_coeff[BRUTE] * config.damage_multiplier)
+
+/mob/living/simple_animal/adjustFireLoss(amount)
+ if(damage_coeff[BURN])
+ . = adjustHealth(amount * damage_coeff[BURN] * config.damage_multiplier)
+
+/mob/living/simple_animal/adjustOxyLoss(amount)
+ if(damage_coeff[OXY])
+ . = adjustHealth(amount * damage_coeff[OXY] * config.damage_multiplier)
+
+/mob/living/simple_animal/adjustToxLoss(amount)
+ if(damage_coeff[TOX])
+ . = adjustHealth(amount * damage_coeff[TOX] * config.damage_multiplier)
+
+/mob/living/simple_animal/adjustCloneLoss(amount)
+ if(damage_coeff[CLONE])
+ . = adjustHealth(amount * damage_coeff[CLONE] * config.damage_multiplier)
+
+/mob/living/simple_animal/adjustStaminaLoss(amount)
+ return
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm
index 35b363ae2854..2d22e2937538 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm
@@ -238,7 +238,7 @@
/mob/living/simple_animal/drone/handle_temperature_damage()
return
-/mob/living/simple_animal/drone/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
+/mob/living/simple_animal/drone/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
if(affect_silicon)
return ..()
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm
index b95e845d563b..d3d991744366 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm
@@ -6,60 +6,52 @@
//How the world interacts with drones
-/mob/living/simple_animal/drone/UnarmedAttack(atom/A, proximity)
- A.attack_hand(src)
+/mob/living/simple_animal/drone/attack_drone(mob/living/simple_animal/drone/D)
+ if(D != src && stat == DEAD)
+ var/d_input = alert(D,"Perform which action?","Drone Interaction","Reactivate","Cannibalize","Nothing")
+ if(d_input)
+ switch(d_input)
+ if("Reactivate")
+ var/mob/dead/observer/G = get_ghost()
+ if(!client && (!G || !G.client))
+ var/list/faux_gadgets = list("hypertext inflator","failsafe directory","DRM switch","stack initializer",\
+ "anti-freeze capacitor","data stream diode","TCP bottleneck","supercharged I/O bolt",\
+ "tradewind stablizer","radiated XML cable","registry fluid tank","open-source debunker")
+
+ var/list/faux_problems = list("won't be able to tune their bootstrap projector","will constantly remix their binary pool"+\
+ " even though the BMX calibrator is working","will start leaking their XSS coolant",\
+ "can't tell if their ethernet detour is moving or not", "won't be able to reseed enough"+\
+ " kernels to function properly","can't start their neurotube console")
+
+ D << "You can't seem to find the [pick(faux_gadgets)]! Without it, [src] [pick(faux_problems)]."
+ return
+ D.visible_message("[D] begins to reactivate [src].", "You begin to reactivate [src]...")
+ if(do_after(D,30, 1, target = src))
+ revive(full_heal = 1)
+ D.visible_message("[D] reactivates [src]!", "You reactivate [src].")
+ alert_drones(DRONE_NET_CONNECT)
+ if(G)
+ G << "DRONE NETWORK: You were reactivated by [D]!"
+ else
+ D << "You need to remain still to reactivate [src]!"
+
+ if("Cannibalize")
+ if(D.health < D.maxHealth)
+ D.visible_message("[D] begins to cannibalize parts from [src].", "You begin to cannibalize parts from [src]...")
+ if(do_after(D, 60, 0, target = src))
+ D.visible_message("[D] repairs itself using [src]'s remains!", "You repair yourself using [src]'s remains.")
+ D.adjustBruteLoss(-src.maxHealth)
+ new /obj/effect/decal/cleanable/oil/streak(get_turf(src))
+ qdel(src)
+ else
+ D << "You need to remain still to cannibalize [src]!"
+ else
+ D << "You're already in perfect condition!"
+ if("Nothing")
+ return
/mob/living/simple_animal/drone/attack_hand(mob/user)
- if(isdrone(user))
- var/mob/living/simple_animal/drone/D = user
- if(D != src)
- if(stat == DEAD)
- var/d_input = alert(D,"Perform which action?","Drone Interaction","Reactivate","Cannibalize","Nothing")
- if(d_input)
- switch(d_input)
- if("Reactivate")
- var/mob/dead/observer/G = get_ghost()
- if(!client && (!G || !G.client))
- var/list/faux_gadgets = list("hypertext inflator","failsafe directory","DRM switch","stack initializer",\
- "anti-freeze capacitor","data stream diode","TCP bottleneck","supercharged I/O bolt",\
- "tradewind stablizer","radiated XML cable","registry fluid tank","open-source debunker")
-
- var/list/faux_problems = list("won't be able to tune their bootstrap projector","will constantly remix their binary pool"+\
- " even though the BMX calibrator is working","will start leaking their XSS coolant",\
- "can't tell if their ethernet detour is moving or not", "won't be able to reseed enough"+\
- " kernels to function properly","can't start their neurotube console")
-
- D << "You can't seem to find the [pick(faux_gadgets)]! Without it, [src] [pick(faux_problems)]."
- return
- D.visible_message("[D] begins to reactivate [src].", "You begin to reactivate [src]...")
- if(do_after(user,30, 1, target = src))
- revive(full_heal = 1)
- D.visible_message("[D] reactivates [src]!", "You reactivate [src].")
- alert_drones(DRONE_NET_CONNECT)
- if(G)
- G << "DRONE NETWORK: You were reactivated by [D]!"
- else
- D << "You need to remain still to reactivate [src]!"
-
- if("Cannibalize")
- if(D.health < D.maxHealth)
- D.visible_message("[D] begins to cannibalize parts from [src].", "You begin to cannibalize parts from [src]...")
- if(do_after(D, 60, 0, target = src))
- D.visible_message("[D] repairs itself using [src]'s remains!", "You repair yourself using [src]'s remains.")
- D.adjustBruteLoss(-src.maxHealth)
- new /obj/effect/decal/cleanable/oil/streak(get_turf(src))
- qdel(src)
- else
- D << "You need to remain still to cannibalize [src]!"
- else
- D << "You're already in perfect condition!"
- if("Nothing")
- return
-
- return
-
-
if(ishuman(user))
if(stat == DEAD || status_flags & GODMODE)
..()
@@ -83,9 +75,7 @@
DH.drone = src
user.put_in_hands(DH)
forceMove(DH)
- return
- ..()
/mob/living/simple_animal/drone/attackby(obj/item/I, mob/user)
diff --git a/code/modules/mob/living/simple_animal/guardian/types/support.dm b/code/modules/mob/living/simple_animal/guardian/types/support.dm
index 889ab1803ca3..a7a204af676f 100644
--- a/code/modules/mob/living/simple_animal/guardian/types/support.dm
+++ b/code/modules/mob/living/simple_animal/guardian/types/support.dm
@@ -148,7 +148,7 @@
PoolOrNew(/obj/effect/overlay/temp/guardian/phase/out, T)
if(isliving(A))
var/mob/living/L = A
- L.flash_eyes()
+ L.flash_act()
A.visible_message("[A] disappears in a flash of \
light!", "Your vision is obscured \
by a flash of light!")
diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm
index 013a77e81d10..2f75310ff254 100644
--- a/code/modules/mob/living/simple_animal/hostile/hostile.dm
+++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm
@@ -256,12 +256,6 @@
else if(target != null && prob(40))//No more pulling a mob forever and having a second player attack it, it can switch targets now if it finds a more suitable one
FindTarget()
-/mob/living/simple_animal/hostile/UnarmedAttack(atom/A)
- target = A
- if(dextrous && !is_type_in_typecache(A, environment_target_typecache) && !ismob(A))
- ..()
- else
- AttackingTarget()
/mob/living/simple_animal/hostile/proc/AttackingTarget()
target.attack_animal(src)
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
index a8f7b491bc99..bedb33e3d4aa 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm
@@ -622,7 +622,7 @@ Difficulty: Very Hard
if(isliving(target) && target != src)
var/mob/living/L = target
if(L.stat < DEAD)
- L.heal_overall_damage(heal_power, heal_power, 1)
+ L.heal_overall_damage(heal_power, heal_power)
PoolOrNew(/obj/effect/overlay/temp/heal, list(get_turf(target), "#80F5FF"))
/mob/living/simple_animal/hostile/lightgeist/Life()
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index 7f05844b2965..edca0beac1de 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -101,10 +101,6 @@
client.screen += client.void
..()
-/mob/living/simple_animal/updatehealth()
- ..()
- health = Clamp(health, 0, maxHealth)
-
/mob/living/simple_animal/Life()
if(..()) //alive
if(!ckey)
@@ -113,6 +109,10 @@
handle_automated_speech()
return 1
+/mob/living/simple_animal/updatehealth()
+ ..()
+ health = Clamp(health, 0, maxHealth)
+
/mob/living/simple_animal/update_stat()
if(status_flags & GODMODE)
return
@@ -251,10 +251,6 @@
if(icon_gib)
new /obj/effect/overlay/temp/gib_animation/animal(loc, icon_gib)
-/mob/living/simple_animal/blob_act(obj/effect/blob/B)
- adjustBruteLoss(20)
- return
-
/mob/living/simple_animal/say_quote(input)
var/ending = copytext(input, length(input))
if(speak_emote && speak_emote.len && ending != "?" && ending != "!")
@@ -271,125 +267,7 @@
act = "me"
..(act, m_type, message)
-/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M)
- if(..())
- var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
- attack_threshold_check(damage,M.melee_damage_type)
- return 1
-/mob/living/simple_animal/bullet_act(obj/item/projectile/Proj)
- if(!Proj)
- return
- apply_damage(Proj.damage, Proj.damage_type)
- Proj.on_hit(src)
- return 0
-
-/mob/living/simple_animal/proc/adjustHealth(amount)
- if(status_flags & GODMODE)
- return 0
- bruteloss = Clamp(bruteloss + amount, 0, maxHealth)
- updatehealth()
- return amount
-
-/mob/living/simple_animal/adjustBruteLoss(amount)
- if(damage_coeff[BRUTE])
- . = adjustHealth(amount * damage_coeff[BRUTE] * config.damage_multiplier)
-
-/mob/living/simple_animal/adjustFireLoss(amount)
- if(damage_coeff[BURN])
- . = adjustHealth(amount * damage_coeff[BURN] * config.damage_multiplier)
-
-/mob/living/simple_animal/adjustOxyLoss(amount)
- if(damage_coeff[OXY])
- . = adjustHealth(amount * damage_coeff[OXY] * config.damage_multiplier)
-
-/mob/living/simple_animal/adjustToxLoss(amount)
- if(damage_coeff[TOX])
- . = adjustHealth(amount * damage_coeff[TOX] * config.damage_multiplier)
-
-/mob/living/simple_animal/adjustCloneLoss(amount)
- if(damage_coeff[CLONE])
- . = adjustHealth(amount * damage_coeff[CLONE] * config.damage_multiplier)
-
-/mob/living/simple_animal/adjustStaminaLoss(amount)
- return
-
-/mob/living/simple_animal/attack_hand(mob/living/carbon/human/M)
- ..()
- switch(M.a_intent)
-
- if("help")
- if (health > 0)
- visible_message("[M] [response_help] [src].")
- playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
-
- if("grab")
- grabbedby(M)
-
- if("harm", "disarm")
- M.do_attack_animation(src)
- visible_message("[M] [response_harm] [src]!")
- playsound(loc, attacked_sound, 25, 1, -1)
- attack_threshold_check(harm_intent_damage)
- add_logs(M, src, "attacked")
- updatehealth()
- return 1
-
-/mob/living/simple_animal/attack_paw(mob/living/carbon/monkey/M)
- if(..()) //successful monkey bite.
- if(stat != DEAD)
- var/damage = rand(1, 3)
- attack_threshold_check(damage)
- return 1
- if (M.a_intent == "help")
- if (health > 0)
- visible_message("[M.name] [response_help] [src].")
- playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
-
- return
-
-/mob/living/simple_animal/attack_alien(mob/living/carbon/alien/humanoid/M)
- if(..()) //if harm or disarm intent.
- if(M.a_intent == "disarm")
- playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
- visible_message("[M] [response_disarm] [name]!", \
- "[M] [response_disarm] [name]!")
- add_logs(M, src, "disarmed")
- else
- var/damage = rand(15, 30)
- visible_message("[M] has slashed at [src]!", \
- "[M] has slashed at [src]!")
- playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
- attack_threshold_check(damage)
- add_logs(M, src, "attacked")
- return 1
-
-/mob/living/simple_animal/attack_larva(mob/living/carbon/alien/larva/L)
- if(..()) //successful larva bite
- var/damage = rand(5, 10)
- if(stat != DEAD)
- L.amount_grown = min(L.amount_grown + damage, L.max_grown)
- attack_threshold_check(damage)
- return 1
-
-/mob/living/simple_animal/attack_slime(mob/living/simple_animal/slime/M)
- if(..()) //successful slime attack
- var/damage = rand(15, 25)
- if(M.is_adult)
- damage = rand(20, 35)
- attack_threshold_check(damage)
- return 1
-
-/mob/living/simple_animal/proc/attack_threshold_check(damage, damagetype = BRUTE)
- if(!damage_coeff[damagetype])
- damage = 0
- else
- damage *= damage_coeff[damagetype]
-
- if(damage >= 0 && damage <= force_threshold)
- visible_message("[src] looks unharmed.")
- else
- adjustHealth(damage * config.damage_multiplier)
/mob/living/simple_animal/movement_delay()
. = ..()
@@ -422,6 +300,7 @@
visible_message("\The [src] stops moving...")
if(del_on_death)
ghostize()
+ stat = DEAD
qdel(src)
else
health = 0
@@ -431,28 +310,6 @@
lying = 1
..()
-/mob/living/simple_animal/ex_act(severity, target)
- ..()
- var/bomb_armor = getarmor(null, "bomb")
- switch (severity)
- if (1)
- if(prob(bomb_armor))
- adjustBruteLoss(500)
- else
- gib()
- return
- if (2)
- var/bloss = 60
- if(prob(bomb_armor))
- bloss = bloss / 1.5
- adjustBruteLoss(bloss)
-
- if(3)
- var/bloss = 30
- if(prob(bomb_armor))
- bloss = bloss / 1.5
- adjustBruteLoss(bloss)
-
/mob/living/simple_animal/proc/CanAttack(atom/the_target)
if(see_invisible < the_target.invisibility)
return 0
@@ -469,9 +326,6 @@
/mob/living/simple_animal/handle_fire()
return
-/mob/living/simple_animal/update_fire()
- return
-
/mob/living/simple_animal/IgniteMob()
return FALSE
@@ -599,14 +453,6 @@
/mob/living/simple_animal/get_idcard()
return access_card
-//Dextrous simple mobs can use hands!
-/mob/living/simple_animal/create_mob_hud()
- if(client && !hud_used)
- if(dextrous)
- hud_used = new dextrous_hud_type(src, ui_style2icon(client.prefs.UI_style))
- else
- ..()
-
/mob/living/simple_animal/OpenCraftingMenu()
if(dextrous)
handcrafting.ui_interact(src)
@@ -656,13 +502,6 @@
if(H)
H.update_icon()
-/mob/living/simple_animal/UnarmedAttack(atom/A, proximity)
- if(!dextrous)
- return ..()
- if(!ismob(A))
- A.attack_hand(src)
- update_inv_hands()
-
/mob/living/simple_animal/put_in_hands(obj/item/I)
..()
update_inv_hands()
diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm
index 44c96f7f2162..0545bd03b008 100644
--- a/code/modules/mob/living/status_procs.dm
+++ b/code/modules/mob/living/status_procs.dm
@@ -14,4 +14,61 @@
if(damage >= 0)
ear_damage = damage
if(deaf >= 0)
- ear_deaf = deaf
\ No newline at end of file
+ ear_deaf = deaf
+
+
+//////////////////////////////STUN ////////////////////////////////////
+
+/mob/living/proc/add_stun_absorption(key, duration, priority, message, self_message, examine_message)
+//adds a stun absorption with a key, a duration in deciseconds, its priority, and the messages it makes when you're stunned/examined, if any
+ if(!islist(stun_absorption))
+ stun_absorption = list()
+ if(stun_absorption[key])
+ stun_absorption[key]["end_time"] = world.time + duration
+ stun_absorption[key]["priority"] = priority
+ stun_absorption[key]["stuns_absorbed"] = 0
+ else
+ stun_absorption[key] = list("end_time" = world.time + duration, "priority" = priority, "stuns_absorbed" = 0, \
+ "visible_message" = message, "self_message" = self_message, "examine_message" = examine_message)
+
+/mob/living/Stun(amount, updating = 1, ignore_canstun = 0)
+ if(!stat && islist(stun_absorption))
+ var/priority_absorb_key
+ var/highest_priority
+ for(var/i in stun_absorption)
+ if(stun_absorption[i]["end_time"] > world.time && (!priority_absorb_key || stun_absorption[i]["priority"] > highest_priority))
+ priority_absorb_key = stun_absorption[i]
+ highest_priority = stun_absorption[i]["priority"]
+ if(priority_absorb_key)
+ if(priority_absorb_key["visible_message"] || priority_absorb_key["self_message"])
+ if(priority_absorb_key["visible_message"] && priority_absorb_key["self_message"])
+ visible_message("[src][priority_absorb_key["visible_message"]]", "[priority_absorb_key["self_message"]]")
+ else if(priority_absorb_key["visible_message"])
+ visible_message("[src][priority_absorb_key["visible_message"]]")
+ else if(priority_absorb_key["self_message"])
+ src << "[priority_absorb_key["self_message"]]"
+ priority_absorb_key["stuns_absorbed"] += amount
+ return 0
+ ..()
+
+///////////////////////////////// WEAKEN /////////////////////////////////////
+
+/mob/living/Weaken(amount, updating = 1, ignore_canweaken = 0)
+ if(!stat && islist(stun_absorption))
+ var/priority_absorb_key
+ var/highest_priority
+ for(var/i in stun_absorption)
+ if(stun_absorption[i]["end_time"] > world.time && (!priority_absorb_key || stun_absorption[i]["priority"] > highest_priority))
+ priority_absorb_key = stun_absorption[i]
+ highest_priority = priority_absorb_key["priority"]
+ if(priority_absorb_key)
+ if(priority_absorb_key["visible_message"] || priority_absorb_key["self_message"])
+ if(priority_absorb_key["visible_message"] && priority_absorb_key["self_message"])
+ visible_message("[src][priority_absorb_key["visible_message"]]", "[priority_absorb_key["self_message"]]")
+ else if(priority_absorb_key["visible_message"])
+ visible_message("[src][priority_absorb_key["visible_message"]]")
+ else if(priority_absorb_key["self_message"])
+ src << "[priority_absorb_key["self_message"]]"
+ priority_absorb_key["stuns_absorbed"] += amount
+ return 0
+ ..()
\ No newline at end of file
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index 37e60e3b93cd..40d23ea638dd 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -413,14 +413,15 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
/proc/item_heal_robotic(mob/living/carbon/human/H, mob/user, brute_heal, burn_heal)
var/obj/item/bodypart/affecting = H.get_bodypart(check_zone(user.zone_selected))
- if(affecting && affecting.status == ORGAN_ROBOTIC)
+ if(affecting && affecting.status == BODYPART_ROBOTIC)
var/dam //changes repair text based on how much brute/burn was supplied
if(brute_heal > burn_heal)
dam = 1
else
dam = 0
if((brute_heal > 0 && affecting.brute_dam > 0) || (burn_heal > 0 && affecting.burn_dam > 0))
- affecting.heal_damage(brute_heal,burn_heal,1)
+ if(affecting.heal_damage(brute_heal, burn_heal, 1, 0))
+ H.update_damage_overlays()
user.visible_message("[user] has fixed some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting].", "You fix some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting].")
return 1 //successful heal
else
diff --git a/code/modules/mob/status_procs.dm b/code/modules/mob/status_procs.dm
index 649fe0462bb9..dfbe62505334 100644
--- a/code/modules/mob/status_procs.dm
+++ b/code/modules/mob/status_procs.dm
@@ -245,7 +245,13 @@
return
-
+//////////////////////////////// HUSK DISABILITY ///////////////////////////:
+
+/mob/proc/cure_husk()
+ return
+
+/mob/proc/become_husk()
+ return
diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm
index e1b2f760b4c1..fcae203a5231 100644
--- a/code/modules/mob/transform_procs.dm
+++ b/code/modules/mob/transform_procs.dm
@@ -7,19 +7,32 @@
var/list/implants = list()
var/list/int_organs = list()
+
+
if (tr_flags & TR_KEEPIMPLANTS)
for(var/obj/item/weapon/implant/W in src)
implants += W
if (tr_flags & TR_KEEPORGANS)
- for(var/obj/item/organ/I in internal_organs)
+ for(var/X in internal_organs)
+ var/obj/item/organ/I = X
int_organs += I
I.Remove(src, 1)
+ var/list/missing_bodyparts_zones = get_missing_limbs()
+
+ var/obj/item/cavity_object
+
+ var/obj/item/bodypart/chest/CH = get_bodypart("chest")
+ if(CH.cavity_item)
+ cavity_object = CH.cavity_item
+ CH.cavity_item = null
+
if(tr_flags & TR_KEEPITEMS)
- for(var/obj/item/W in (src.contents-implants-int_organs))
+ for(var/obj/item/W in (contents-implants-cavity_object))
unEquip(W)
+
//Make mob invisible and spawn animation
notransform = 1
canmove = 0
@@ -82,17 +95,37 @@
//re-add organs to new mob
if(tr_flags & TR_KEEPORGANS)
- for(var/obj/item/organ/I in O.internal_organs)
- qdel(I)
+ for(var/X in O.internal_organs)
+ qdel(X)
- for(var/obj/item/organ/I in int_organs)
+ for(var/X in int_organs)
+ var/obj/item/organ/I = X
I.Insert(O, 1)
+ var/obj/item/bodypart/chest/torso = O.get_bodypart("chest")
+ if(cavity_object)
+ torso.cavity_item = cavity_object //cavity item is given to the new chest
+ cavity_object.loc = O
+
+ for(var/missing_zone in missing_bodyparts_zones)
+ var/obj/item/bodypart/BP = O.get_bodypart(missing_zone)
+ BP.drop_limb(1)
+ if(!(tr_flags & TR_KEEPORGANS)) //we didn't already get rid of the organs of the newly spawned mob
+ for(var/X in O.internal_organs)
+ var/obj/item/organ/G = X
+ if(BP.body_zone == check_zone(G.zone))
+ if(mind && mind.changeling && istype(G, /obj/item/organ/brain))
+ continue //so headless changelings don't lose their brain when transforming
+ qdel(G) //we lose the organs in the missing limbs
+ qdel(BP)
+
//transfer mind and delete old mob
if(mind)
mind.transfer_to(O)
if(O.mind.changeling)
O.mind.changeling.purchasedpowers += new /obj/effect/proc_holder/changeling/humanform(null)
+
+
if (tr_flags & TR_DEFAULTMSG)
O << "You are now a monkey."
@@ -121,13 +154,23 @@
implants += W
if (tr_flags & TR_KEEPORGANS)
- for(var/obj/item/organ/I in internal_organs)
+ for(var/X in internal_organs)
+ var/obj/item/organ/I = X
int_organs += I
I.Remove(src, 1)
+ var/list/missing_bodyparts_zones = get_missing_limbs()
+
+ var/obj/item/cavity_object
+
+ var/obj/item/bodypart/chest/CH = get_bodypart("chest")
+ if(CH.cavity_item)
+ cavity_object = CH.cavity_item
+ CH.cavity_item = null
+
//now the rest
if (tr_flags & TR_KEEPITEMS)
- for(var/obj/item/W in (src.contents-implants-int_organs))
+ for(var/obj/item/W in (contents-implants-cavity_object))
unEquip(W)
if (client)
client.screen -= W
@@ -136,6 +179,8 @@
W.dropped(src)
W.layer = initial(W.layer)
+
+
//Make mob invisible and spawn animation
notransform = 1
canmove = 0
@@ -202,12 +247,31 @@
O.sec_hud_set_implants()
if(tr_flags & TR_KEEPORGANS)
- for(var/obj/item/organ/I in O.internal_organs)
- qdel(I)
+ for(var/X in O.internal_organs)
+ qdel(X)
- for(var/obj/item/organ/I in int_organs)
+ for(var/X in int_organs)
+ var/obj/item/organ/I = X
I.Insert(O, 1)
+
+ var/obj/item/bodypart/chest/torso = get_bodypart("chest")
+ if(cavity_object)
+ torso.cavity_item = cavity_object //cavity item is given to the new chest
+ cavity_object.loc = O
+
+ for(var/missing_zone in missing_bodyparts_zones)
+ var/obj/item/bodypart/BP = O.get_bodypart(missing_zone)
+ BP.drop_limb(1)
+ if(!(tr_flags & TR_KEEPORGANS)) //we didn't already get rid of the organs of the newly spawned mob
+ for(var/X in O.internal_organs)
+ var/obj/item/organ/G = X
+ if(BP.body_zone == check_zone(G.zone))
+ if(mind && mind.changeling && istype(G, /obj/item/organ/brain))
+ continue //so headless changelings don't lose their brain when transforming
+ qdel(G) //we lose the organs in the missing limbs
+ qdel(BP)
+
if(mind)
mind.transfer_to(O)
if(O.mind.changeling)
diff --git a/code/modules/mob/update_icons.dm b/code/modules/mob/update_icons.dm
index e2cb8d959743..6ed04dbbdd32 100644
--- a/code/modules/mob/update_icons.dm
+++ b/code/modules/mob/update_icons.dm
@@ -37,9 +37,15 @@
/mob/proc/update_inv_head()
return
+/mob/proc/update_body()
+ return
+
/mob/proc/update_hair()
return
+/mob/proc/update_fire()
+ return
+
/mob/proc/update_inv_gloves()
return
diff --git a/code/modules/ninja/suit/n_suit_verbs/ninja_sword_recall.dm b/code/modules/ninja/suit/n_suit_verbs/ninja_sword_recall.dm
index fb38a3fbdd7e..8062c023bc19 100644
--- a/code/modules/ninja/suit/n_suit_verbs/ninja_sword_recall.dm
+++ b/code/modules/ninja/suit/n_suit_verbs/ninja_sword_recall.dm
@@ -32,9 +32,6 @@
if(energyKatana in C.stomach_contents)
C.stomach_contents -= energyKatana
- if(energyKatana in C.internal_organs)
- C.internal_organs -= energyKatana
-
energyKatana.loc = get_turf(energyKatana)
if(inview) //If we can see the katana, throw it towards ourselves, damaging people as we go.
diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm
index 3f10566dde8a..89d63ba3f066 100644
--- a/code/modules/power/antimatter/control.dm
+++ b/code/modules/power/antimatter/control.dm
@@ -170,12 +170,11 @@
if(fueljar)
user << "There is already a [fueljar] inside!"
return
+
+ if(!user.unEquip(W))
+ return
fueljar = W
- W.loc = src
- if(user.client)
- user.client.screen -= W
- user.unEquip(W)
- user.update_icons()
+ W.forceMove(src)
user.visible_message("[user.name] loads an [W.name] into the [src.name].", \
"You load an [W.name].", \
"You hear a thunk.")
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index a5e754cd015d..434a31157a40 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -517,7 +517,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
return ..()
var/obj/item/bodypart/affecting = H.get_bodypart(check_zone(user.zone_selected))
- if(affecting && affecting.status == ORGAN_ROBOTIC)
+ if(affecting && affecting.status == BODYPART_ROBOTIC)
user.visible_message("[user] starts to fix some of the wires in [H]'s [affecting.name].", "You start fixing some of the wires in [H]'s [affecting.name].")
if(!do_mob(user, H, 50))
return
diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm
index 9b6f7a79297c..41e77f5f886c 100644
--- a/code/modules/power/lighting.dm
+++ b/code/modules/power/lighting.dm
@@ -441,8 +441,7 @@
var/obj/item/bodypart/affecting = H.get_bodypart("[(user.active_hand_index % 2 == 0) ? "r" : "l" ]_arm")
if(affecting && affecting.take_damage( 0, 5 )) // 5 burn damage
- H.update_damage_overlays(0)
- H.updatehealth()
+ H.update_damage_overlays()
return // if burned, don't remove the light
else
user << "You remove the light [fitting]."
diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm
index 107b9c681975..a3469c6b6997 100644
--- a/code/modules/power/singularity/singularity.dm
+++ b/code/modules/power/singularity/singularity.dm
@@ -392,7 +392,7 @@
/obj/singularity/proc/mezzer()
for(var/mob/living/carbon/M in oviewers(8, src))
- if(istype(M, /mob/living/carbon/brain)) //Ignore brains
+ if(istype(M, /mob/living/brain)) //Ignore brains
continue
if(M.stat == CONSCIOUS)
diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm
index 594df3bd3b65..9b50a1e4a985 100644
--- a/code/modules/projectiles/guns/projectile.dm
+++ b/code/modules/projectiles/guns/projectile.dm
@@ -178,7 +178,7 @@
name = "sawn-off [src.name]"
desc = sawn_desc
w_class = 3
- item_state = "gun"//phil235 is it different with different skin?
+ item_state = "gun"
slot_flags &= ~SLOT_BACK //you can't sling it on your back
slot_flags |= SLOT_BELT //but you can wear it on your belt (poorly concealed under a trenchcoat, ideally)
sawn_state = SAWN_OFF
diff --git a/code/modules/projectiles/guns/projectile/revolver.dm b/code/modules/projectiles/guns/projectile/revolver.dm
index a238c60623a5..d0f8baa82fff 100644
--- a/code/modules/projectiles/guns/projectile/revolver.dm
+++ b/code/modules/projectiles/guns/projectile/revolver.dm
@@ -111,7 +111,7 @@
if(prob(70 - (magazine.ammo_count() * 10))) //minimum probability of 10, maximum of 60
playsound(user, fire_sound, 50, 1)
user << "[src] blows up in your face!"
- user.take_organ_damage(0,20)
+ user.take_bodypart_damage(0,20)
user.unEquip(src)
return 0
..()
diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm
index 1c4616c90ed8..910fe2cc89aa 100644
--- a/code/modules/projectiles/projectile.dm
+++ b/code/modules/projectiles/projectile.dm
@@ -63,14 +63,26 @@
/obj/item/projectile/proc/on_range() //if we want there to be effects when they reach the end of their range
qdel(src)
-/obj/item/projectile/proc/on_hit(atom/target, blocked = 0, hit_zone)
+//to get the correct limb (if any) for the projectile hit message
+/mob/living/proc/check_limb_hit(hit_zone)
+ if(has_limbs)
+ return hit_zone
+
+/mob/living/carbon/check_limb_hit(hit_zone)
+ if(get_bodypart(hit_zone))
+ return hit_zone
+ else //when a limb is missing the damage is actually passed to the chest
+ return "chest"
+
+/obj/item/projectile/proc/on_hit(atom/target, blocked = 0)
if(!isliving(target))
return 0
var/mob/living/L = target
if(blocked != 100) // not completely blocked
var/organ_hit_text = ""
- if(L.has_limbs)
- organ_hit_text = " in \the [parse_zone(def_zone)]"
+ var/limb_hit = L.check_limb_hit(def_zone)//to get the correct message info.
+ if(limb_hit)
+ organ_hit_text = " in \the [parse_zone(limb_hit)]"
if(suppressed)
playsound(loc, hitsound, 5, 1, -1)
L << "You're shot by \a [src][organ_hit_text]!"
diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm
index 59cd030b85fb..0dc198bc33ad 100644
--- a/code/modules/projectiles/projectile/beams.dm
+++ b/code/modules/projectiles/projectile/beams.dm
@@ -73,7 +73,7 @@
icon_state = "pulse1_bl"
var/life = 20
-/obj/item/projectile/beam/pulse/heavy/on_hit(atom/target, blocked = 0, hit_zone)
+/obj/item/projectile/beam/pulse/heavy/on_hit(atom/target, blocked = 0)
life -= 10
if(life > 0)
. = -1
diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm
index c1061c572938..4a3b66ba1080 100644
--- a/code/modules/projectiles/projectile/bullets.dm
+++ b/code/modules/projectiles/projectile/bullets.dm
@@ -174,11 +174,11 @@
create_reagents(50)
reagents.set_reacting(FALSE)
-/obj/item/projectile/bullet/dart/on_hit(atom/target, blocked = 0, hit_zone)
+/obj/item/projectile/bullet/dart/on_hit(atom/target, blocked = 0)
if(iscarbon(target))
var/mob/living/carbon/M = target
if(blocked != 100) // not completely blocked
- if(M.can_inject(null,0,hit_zone,piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body.
+ if(M.can_inject(null, 0, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body.
..()
reagents.reaction(M, INJECT)
reagents.trans_to(M, reagents.total_volume)
@@ -188,7 +188,7 @@
target.visible_message("The [name] was deflected!", \
"You were protected against the [name]!")
- ..(target, blocked, hit_zone)
+ ..(target, blocked)
reagents.set_reacting(TRUE)
reagents.handle_reactions()
return 1
@@ -234,7 +234,7 @@
armour_penetration = 50
var/breakthings = TRUE
-/obj/item/projectile/bullet/sniper/on_hit(atom/target, blocked = 0, hit_zone)
+/obj/item/projectile/bullet/sniper/on_hit(atom/target, blocked = 0)
if((blocked != 100) && (!ismob(target) && breakthings))
target.ex_act(rand(1,2))
return ..()
@@ -248,7 +248,7 @@
weaken = 0
breakthings = FALSE
-/obj/item/projectile/bullet/sniper/soporific/on_hit(atom/target, blocked = 0, hit_zone)
+/obj/item/projectile/bullet/sniper/soporific/on_hit(atom/target, blocked = 0)
if((blocked != 100) && istype(target, /mob/living))
var/mob/living/L = target
L.Sleeping(20)
@@ -263,7 +263,7 @@
weaken = 0
breakthings = FALSE
-/obj/item/projectile/bullet/sniper/haemorrhage/on_hit(atom/target, blocked = 0, hit_zone)
+/obj/item/projectile/bullet/sniper/haemorrhage/on_hit(atom/target, blocked = 0)
if((blocked != 100) && iscarbon(target))
var/mob/living/carbon/C = target
C.bleed(100)
@@ -293,7 +293,7 @@
damage = 20
armour_penetration = 0
-/obj/item/projectile/bullet/saw/bleeding/on_hit(atom/target, blocked = 0, hit_zone)
+/obj/item/projectile/bullet/saw/bleeding/on_hit(atom/target, blocked = 0)
. = ..()
if((blocked != 100) && iscarbon(target))
var/mob/living/carbon/C = target
diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm
index 0dadac9de80e..d0f9d4bc5119 100644
--- a/code/modules/projectiles/projectile/special.dm
+++ b/code/modules/projectiles/projectile/special.dm
@@ -98,8 +98,8 @@
if(iscarbon(target))
var/mob/living/carbon/C = target
if(C.dna.species.id == "pod")
- randmuti(C)
- randmut(C)
+ C.randmuti()
+ C.randmut()
C.updateappearance()
C.domutcheck()
diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
index c70c022d4674..1c78b5c6f8e6 100644
--- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
@@ -150,7 +150,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
/datum/reagent/consumable/ethanol/bilk/on_mob_life(mob/living/M)
if(M.getBruteLoss() && prob(10))
- M.heal_organ_damage(1,0, 0)
+ M.heal_bodypart_damage(1,0, 0)
. = 1
return ..() || .
@@ -681,7 +681,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
/datum/reagent/consumable/ethanol/bananahonk/on_mob_life(mob/living/M)
if( ( istype(M, /mob/living/carbon/human) && M.job in list("Clown") ) || istype(M, /mob/living/carbon/monkey) )
- M.heal_organ_damage(1,1, 0)
+ M.heal_bodypart_damage(1,1, 0)
. = 1
return ..() || .
@@ -695,7 +695,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
/datum/reagent/consumable/ethanol/silencer/on_mob_life(mob/living/M)
if(istype(M, /mob/living/carbon/human) && M.job in list("Mime"))
- M.heal_organ_damage(1,1)
+ M.heal_bodypart_damage(1,1)
. = 1
return ..() || .
diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm
index 6e2d5c607e08..3055d8733e0a 100644
--- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm
@@ -24,7 +24,7 @@
/datum/reagent/consumable/tomatojuice/on_mob_life(mob/living/M)
if(M.getFireLoss() && prob(20))
- M.heal_organ_damage(0,1, 0)
+ M.heal_bodypart_damage(0,1, 0)
. = 1
..()
@@ -95,7 +95,7 @@
/datum/reagent/consumable/banana/on_mob_life(mob/living/M)
if( ( istype(M, /mob/living/carbon/human) && M.job in list("Clown") ) || istype(M, /mob/living/carbon/monkey) )
- M.heal_organ_damage(1,1, 0)
+ M.heal_bodypart_damage(1,1, 0)
. = 1
..()
@@ -106,7 +106,7 @@
/datum/reagent/consumable/nothing/on_mob_life(mob/living/M)
if(istype(M, /mob/living/carbon/human) && M.job in list("Mime"))
- M.heal_organ_damage(1,1, 0)
+ M.heal_bodypart_damage(1,1, 0)
. = 1
..()
@@ -155,13 +155,13 @@
/datum/reagent/consumable/milk/on_mob_life(mob/living/M)
if(M.getBruteLoss() && prob(20))
- M.heal_organ_damage(1,0, 0)
+ M.heal_bodypart_damage(1,0, 0)
. = 1
if(holder.has_reagent("capsaicin"))
holder.remove_reagent("capsaicin", 2)
var/datum/dna/Mdna = M.has_dna()
if(Mdna && Mdna.species && (Mdna.species.id == "plasmaman" || Mdna.species.id == "skeleton"))
- M.heal_organ_damage(1,0, 0)
+ M.heal_bodypart_damage(1,0, 0)
. = 1
..()
@@ -173,7 +173,7 @@
/datum/reagent/consumable/soymilk/on_mob_life(mob/living/M)
if(M.getBruteLoss() && prob(20))
- M.heal_organ_damage(1,0, 0)
+ M.heal_bodypart_damage(1,0, 0)
. = 1
..()
@@ -185,7 +185,7 @@
/datum/reagent/consumable/cream/on_mob_life(mob/living/M)
if(M.getBruteLoss() && prob(20))
- M.heal_organ_damage(1,0, 0)
+ M.heal_bodypart_damage(1,0, 0)
. = 1
..()
@@ -411,7 +411,7 @@
M.bodytemperature = min(310, M.bodytemperature + (5 * TEMPERATURE_DAMAGE_COEFFICIENT))
M.Jitter(5)
if(M.getBruteLoss() && prob(20))
- M.heal_organ_damage(1,0, 0)
+ M.heal_bodypart_damage(1,0, 0)
..()
. = 1
@@ -429,7 +429,7 @@
M.bodytemperature = min(310, M.bodytemperature + (5 * TEMPERATURE_DAMAGE_COEFFICIENT))
M.Jitter(5)
if(M.getBruteLoss() && prob(20))
- M.heal_organ_damage(1,0, 0)
+ M.heal_bodypart_damage(1,0, 0)
..()
. = 1
diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm
index c10c97cdaca0..e65c395f7c7c 100644
--- a/code/modules/reagents/chemistry/reagents/food_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm
@@ -27,7 +27,7 @@
/datum/reagent/consumable/nutriment/on_mob_life(mob/living/M)
if(prob(50))
- M.heal_organ_damage(1,0, 0)
+ M.heal_bodypart_damage(1,0, 0)
. = 1
if(iscarbon(M))
var/mob/living/carbon/C = M
@@ -44,7 +44,7 @@
/datum/reagent/consumable/vitamin/on_mob_life(mob/living/M)
if(prob(50))
- M.heal_organ_damage(1,1, 0)
+ M.heal_bodypart_damage(1,1, 0)
. = 1
if(M.satiety < 600)
M.satiety += 30
@@ -325,7 +325,7 @@
/datum/reagent/consumable/sprinkles/on_mob_life(mob/living/M)
if(istype(M, /mob/living/carbon/human) && M.job in list("Security Officer", "Head of Security", "Detective", "Warden"))
- M.heal_organ_damage(1,1, 0)
+ M.heal_bodypart_damage(1,1, 0)
. = 1
..()
@@ -457,5 +457,5 @@
/datum/reagent/consumable/honey/on_mob_life(mob/living/M)
M.reagents.add_reagent("sugar",3)
if(prob(20))
- M.heal_organ_damage(3,1)
+ M.heal_bodypart_damage(3,1)
..()
diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
index 2461aaba7454..ce375b1d2285 100644
--- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
@@ -38,7 +38,7 @@
M.setCloneLoss(0, 0)
M.setOxyLoss(0, 0)
M.radiation = 0
- M.heal_organ_damage(5,5, 0)
+ M.heal_bodypart_damage(5,5, 0)
M.adjustToxLoss(-5, 0)
M.hallucination = 0
M.setBrainLoss(0)
@@ -163,7 +163,7 @@
/datum/reagent/medicine/rezadone/on_mob_life(mob/living/M)
M.setCloneLoss(0) //Rezadone is almost never used in favor of cryoxadone. Hopefully this will change that.
- M.heal_organ_damage(1,1, 0)
+ M.heal_bodypart_damage(1,1, 0)
M.status_flags &= ~DISFIGURED
..()
. = 1
diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm
index ff9eb7197d63..7c311d980b31 100644
--- a/code/modules/reagents/chemistry/reagents/other_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm
@@ -537,7 +537,7 @@
color = "#808080" // rgb: 128, 128, 128
/datum/reagent/chlorine/on_mob_life(mob/living/M)
- M.take_organ_damage(1*REM, 0, 0)
+ M.take_bodypart_damage(1*REM, 0, 0)
. = 1
..()
diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
index b3fb7d29526f..7f6c1c4cbb43 100644
--- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
@@ -34,11 +34,11 @@
if(!M.has_dna())
return //No robots, AIs, aliens, Ians or other mobs should be affected by this.
if((method==VAPOR && prob(min(33, reac_volume))) || method==INGEST || method==PATCH || method==INJECT)
- randmuti(M)
+ M.randmuti()
if(prob(98))
- randmutb(M)
+ M.randmutb()
else
- randmutg(M)
+ M.randmutg()
M.updateappearance()
M.domutcheck()
..()
@@ -118,7 +118,7 @@
M.adjustToxLoss(rand(20,60)*REM, 0)
. = 1
else if(prob(40))
- M.heal_organ_damage(5*REM,0, 0)
+ M.heal_bodypart_damage(5*REM,0, 0)
. = 1
..()
diff --git a/code/modules/reagents/chemistry/recipes.dm b/code/modules/reagents/chemistry/recipes.dm
index 5943577d59cd..b475c752c679 100644
--- a/code/modules/reagents/chemistry/recipes.dm
+++ b/code/modules/reagents/chemistry/recipes.dm
@@ -50,7 +50,7 @@ var/list/chemical_mob_spawn_nicecritters = list() // and possible friendly mobs
playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1)
for(var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null))
- C.flash_eyes()
+ C.flash_act()
for(var/i = 1, i <= amount_to_spawn, i++)
var/chosen
if (reaction_name == "Friendly Gold Slime")
diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm
index 38e316be26be..6cb48f905527 100644
--- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm
+++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm
@@ -218,7 +218,7 @@
s.set_up(2, 1, location)
s.start()
for(var/mob/living/carbon/C in get_hearers_in_view(created_volume/3, location))
- if(C.flash_eyes())
+ if(C.flash_act())
if(get_dist(C, location) < 4)
C.Weaken(5)
else
@@ -237,7 +237,7 @@
s.set_up(2, 1, location)
s.start()
for(var/mob/living/carbon/C in get_hearers_in_view(created_volume/10, location))
- if(C.flash_eyes())
+ if(C.flash_act())
if(get_dist(C, location) < 4)
C.Weaken(5)
else
@@ -297,16 +297,7 @@
var/location = get_turf(holder.my_atom)
playsound(location, 'sound/effects/bang.ogg', 25, 1)
for(var/mob/living/carbon/C in get_hearers_in_view(created_volume/3, location))
- if(C.check_ear_prot())
- continue
- C.show_message("BANG", 2)
- C.Stun(5)
- C.Weaken(5)
- C.setEarDamage(C.ear_damage + rand(0, 5), max(C.ear_deaf,15))
- if(C.ear_damage >= 15)
- C << "Your ears start to ring badly!"
- else if(C.ear_damage >= 5)
- C << "Your ears start to ring!"
+ C.soundbang_act(1, 5, rand(0, 5))
/datum/chemical_reaction/sonic_powder_deafen
name = "sonic_powder_deafen"
@@ -318,17 +309,7 @@
var/location = get_turf(holder.my_atom)
playsound(location, 'sound/effects/bang.ogg', 25, 1)
for(var/mob/living/carbon/C in get_hearers_in_view(created_volume/10, location))
- if(C.check_ear_prot())
- continue
- C.show_message("BANG", 2)
- C.Stun(5)
- C.Weaken(5)
- C.setEarDamage(C.ear_damage + rand(0, 5), max(C.ear_deaf,15))
- if(C.ear_damage >= 15)
- C << "Your ears start to ring badly!"
- else if(C.ear_damage >= 5)
- C << "Your ears start to ring!"
-
+ C.soundbang_act(1, 5, rand(0, 5))
/datum/chemical_reaction/phlogiston
name = "phlogiston"
diff --git a/code/modules/reagents/chemistry/recipes/slime_extracts.dm b/code/modules/reagents/chemistry/recipes/slime_extracts.dm
index ca2b41ffbe72..fd73906d8bcf 100644
--- a/code/modules/reagents/chemistry/recipes/slime_extracts.dm
+++ b/code/modules/reagents/chemistry/recipes/slime_extracts.dm
@@ -167,7 +167,7 @@
playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1)
for(var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null))
- C.flash_eyes()
+ C.flash_act()
for(var/i = 1, i <= 4 + rand(1,2), i++)
var/chosen = pick(borks)
@@ -195,7 +195,7 @@
playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1)
for(var/mob/living/carbon/M in viewers(get_turf(holder.my_atom), null))
- M.flash_eyes()
+ M.flash_act()
for(var/i = 1, i <= 4 + rand(1,2), i++)
var/chosen = pick(borks)
diff --git a/code/modules/research/designs/mechfabricator_designs.dm b/code/modules/research/designs/mechfabricator_designs.dm
index 6a1604a4c261..387e56aaf9c4 100644
--- a/code/modules/research/designs/mechfabricator_designs.dm
+++ b/code/modules/research/designs/mechfabricator_designs.dm
@@ -3,7 +3,7 @@
name = "Cyborg Endoskeleton"
id = "borg_suit"
build_type = MECHFAB
- build_path = /obj/item/robot_parts/robot_suit
+ build_path = /obj/item/robot_suit
materials = list(MAT_METAL=15000)
construction_time = 500
category = list("Cyborg")
@@ -12,7 +12,7 @@
name = "Cyborg Torso"
id = "borg_chest"
build_type = MECHFAB
- build_path = /obj/item/robot_parts/chest
+ build_path = /obj/item/bodypart/chest/robot
materials = list(MAT_METAL=40000)
construction_time = 350
category = list("Cyborg")
@@ -21,7 +21,7 @@
name = "Cyborg Head"
id = "borg_head"
build_type = MECHFAB
- build_path = /obj/item/robot_parts/head
+ build_path = /obj/item/bodypart/head/robot
materials = list(MAT_METAL=5000)
construction_time = 350
category = list("Cyborg")
@@ -30,7 +30,7 @@
name = "Cyborg Left Arm"
id = "borg_l_arm"
build_type = MECHFAB
- build_path = /obj/item/robot_parts/l_arm
+ build_path = /obj/item/bodypart/l_arm/robot
materials = list(MAT_METAL=10000)
construction_time = 200
category = list("Cyborg")
@@ -39,7 +39,7 @@
name = "Cyborg Right Arm"
id = "borg_r_arm"
build_type = MECHFAB
- build_path = /obj/item/robot_parts/r_arm
+ build_path = /obj/item/bodypart/r_arm/robot
materials = list(MAT_METAL=10000)
construction_time = 200
category = list("Cyborg")
@@ -48,7 +48,7 @@
name = "Cyborg Left Leg"
id = "borg_l_leg"
build_type = MECHFAB
- build_path = /obj/item/robot_parts/l_leg
+ build_path = /obj/item/bodypart/l_leg/robot
materials = list(MAT_METAL=10000)
construction_time = 200
category = list("Cyborg")
@@ -57,7 +57,7 @@
name = "Cyborg Right Leg"
id = "borg_r_leg"
build_type = MECHFAB
- build_path = /obj/item/robot_parts/r_leg
+ build_path = /obj/item/bodypart/r_leg/robot
materials = list(MAT_METAL=10000)
construction_time = 200
category = list("Cyborg")
diff --git a/code/modules/spells/spell_types/barnyard.dm b/code/modules/spells/spell_types/barnyard.dm
index e11115c64d33..a63d91c64376 100644
--- a/code/modules/spells/spell_types/barnyard.dm
+++ b/code/modules/spells/spell_types/barnyard.dm
@@ -47,4 +47,4 @@
target.equip_to_slot_if_possible(magichead, slot_wear_mask, 1, 1)
playsound(get_turf(target), mSounds[randM], 50, 1)
- target.flash_eyes()
+ target.flash_act()
diff --git a/code/modules/spells/spell_types/lichdom.dm b/code/modules/spells/spell_types/lichdom.dm
index 9a1d27ebbc7f..728555db52ed 100644
--- a/code/modules/spells/spell_types/lichdom.dm
+++ b/code/modules/spells/spell_types/lichdom.dm
@@ -92,7 +92,8 @@
var/mob/living/carbon/C = old_body
for(var/obj/item/W in C)
C.unEquip(W)
- for(var/obj/item/organ/I in C.internal_organs)
+ for(var/X in C.internal_organs)
+ var/obj/item/organ/I = X
I.Remove(C)
I.forceMove(body_turf)
var/wheres_wizdo = dir2text(get_dir(body_turf, item_turf))
diff --git a/code/modules/surgery/amputation.dm b/code/modules/surgery/amputation.dm
index 1e13586eea86..2ebe45f2d310 100644
--- a/code/modules/surgery/amputation.dm
+++ b/code/modules/surgery/amputation.dm
@@ -2,8 +2,10 @@
/datum/surgery/amputation
name = "amputation"
steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/sever_limb)
- species = list(/mob/living/carbon/human)
+ species = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list("r_arm", "l_arm", "l_leg", "r_leg", "head")
+ requires_organic_bodypart = 0
+
/datum/surgery_step/sever_limb
name = "sever limb"
@@ -16,7 +18,6 @@
/datum/surgery_step/sever_limb/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/mob/living/carbon/human/L = target
user.visible_message("[user] severs [L]'s [parse_zone(target_zone)]!", "You sever [L]'s [parse_zone(target_zone)].")
- var/obj/item/bodypart/BP = L.get_bodypart(target_zone)
- if(BP)
- BP.drop_limb()
+ if(surgery.operated_bodypart)
+ surgery.operated_bodypart.drop_limb()
return 1
\ No newline at end of file
diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm
index 74c8679cd789..6e4ee1d069d3 100644
--- a/code/modules/surgery/bodyparts/bodyparts.dm
+++ b/code/modules/surgery/bodyparts/bodyparts.dm
@@ -4,10 +4,11 @@
desc = "why is it detached..."
force = 3
throwforce = 3
+ icon = 'icons/mob/human_parts.dmi'
icon_state = ""
layer = BELOW_MOB_LAYER //so it isn't hidden behind objects when on the floor
- var/mob/living/carbon/human/owner = null
- var/status = ORGAN_ORGANIC
+ var/mob/living/carbon/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/brutestate = 0
@@ -28,10 +29,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)
..()
@@ -53,7 +58,7 @@
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(EASYLIMBATTACHMENT in H.dna.species.specflags)
- if(!H.get_bodypart(body_zone))
+ if(!H.get_bodypart(body_zone) && !animal_origin)
if(H == user)
H.visible_message("[H] jams [src] into \his empty socket!",\
"You force [src] into your empty socket, and it locks into place!")
@@ -72,8 +77,8 @@
user << "There is nothing left inside [src]!"
return
playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1)
- user.visible_message("[user] begins to cut through the bone in [src].",\
- "You begin to cut through the bone in [src]...")
+ user.visible_message("[user] begins to cut open [src].",\
+ "You begin to cut open [src]...")
if(do_after(user, 54, target = src))
drop_organs(user)
else
@@ -81,27 +86,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/take_damage(brute, burn, updating_health = 1)
if(owner && (owner.status_flags & GODMODE))
return 0 //godmode
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)
@@ -126,7 +134,7 @@
burn_dam += can_inflict
else
return 0
- if(owner)
+ if(owner && updating_health)
owner.updatehealth()
return update_bodypart_damage_state()
@@ -134,17 +142,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()
@@ -157,14 +165,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
@@ -183,47 +190,57 @@
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
else
- H = owner
- if(!istype(H))
- return
+ C = owner
- should_draw_greyscale = FALSE
+ 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
+ var/datum/species/S = H.dna.species
+ species_id = S.limbs_id
+ species_flags_list = H.dna.species.specflags
- 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
+ if(S.use_skintones)
+ skin_tone = H.skin_tone
+ should_draw_greyscale = TRUE
else
- species_color = H.dna.features["mcolor"]
- should_draw_greyscale = TRUE
- else
- species_color = ""
+ skin_tone = ""
- if(H.disabilities & HUSK)
- species_id = "husk"
+ 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(!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(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
- if(!dropping_limb && H.dna.check_mutation(HULK))
- mutation_color = "00aa00"
- else
- mutation_color = ""
+ 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.
@@ -231,25 +248,49 @@
//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)
@@ -265,11 +306,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
@@ -284,13 +327,15 @@
if(draw_color)
I.color = "#[draw_color]"
//End Greyscale Colouring
+ standing += I
- return I
+ return standing
/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
@@ -303,12 +348,43 @@
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"
@@ -316,10 +392,32 @@
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"
@@ -327,10 +425,32 @@
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"
@@ -338,12 +458,33 @@
px_x = -2
px_y = 12
+/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"
@@ -351,6 +492,26 @@
px_x = 2
px_y = 12
+/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
+
/////////////////////////////////////////////////////////////////////////
diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm
index 7cacabe3a082..b6218ceaea6c 100644
--- a/code/modules/surgery/bodyparts/dismemberment.dm
+++ b/code/modules/surgery/bodyparts/dismemberment.dm
@@ -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.specflags) // species don't allow dismemberment
+ return 0
- var/obj/item/bodypart/affecting = H.get_bodypart("chest")
+ var/obj/item/bodypart/affecting = C.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("[H]'s [src.name] has been violently dismembered!")
- H.emote("scream")
+ C.visible_message("[C]'s [src.name] has been violently dismembered!")
+ 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,92 +41,100 @@
/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.specflags) // 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("[owner]'s internal organs spill out onto the floor!")
+ C.visible_message("[C]'s internal organs spill out onto the floor!")
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
+ var/mob/living/carbon/C = owner
if(!no_update)
update_limb(1)
- H.bodyparts -= src
+ C.bodyparts -= src
if(held_index)
- H.unEquip(owner.get_item_for_held_index(held_index), 1)
- H.hand_bodyparts[held_index] = null
+ 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
@@ -133,39 +148,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/hand/R = H.hud_used.hand_slots["[held_index]"]
+ 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.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/hand/L = H.hud_used.hand_slots["[held_index]"]
+ 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.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 +191,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 +203,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 +222,76 @@
//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)
+ C.hand_bodyparts += 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/hand/R = H.hud_used.hand_slots["[held_index]"]
- 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/hand/L = H.hud_used.hand_slots["[held_index]"]
- 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,21 +301,22 @@
/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
diff --git a/code/modules/surgery/bodyparts/head.dm b/code/modules/surgery/bodyparts/head.dm
index 16c742fc6fd8..c3d86b5d4a2a 100644
--- a/code/modules/surgery/bodyparts/head.dm
+++ b/code/modules/surgery/bodyparts/head.dm
@@ -1,6 +1,8 @@
/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
@@ -10,7 +12,7 @@
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:
@@ -30,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)
@@ -46,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.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
+ 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
+ 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
@@ -115,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]
@@ -133,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]
@@ -156,9 +172,36 @@
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
diff --git a/code/modules/surgery/bodyparts/helpers.dm b/code/modules/surgery/bodyparts/helpers.dm
index 4ceec195c095..9f2c6ac37c10 100644
--- a/code/modules/surgery/bodyparts/helpers.dm
+++ b/code/modules/surgery/bodyparts/helpers.dm
@@ -10,47 +10,48 @@
if(L.body_zone == zone)
return L
-/mob/living/carbon/human/has_hand_for_held_index(i)
+/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/proc/has_left_hand()
return TRUE
-/mob/living/carbon/human/has_left_hand()
+/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/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/proc/has_right_hand()
- return TRUE
+/mob/living/carbon/alien/larva/has_right_hand()
+ return 1
-/mob/living/carbon/human/has_right_hand()
- for(var/obj/item/bodypart/L in hand_bodyparts)
- if(L.held_index % 2)
- return TRUE
- return FALSE
//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
@@ -59,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
@@ -68,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(FLYING in dna.species.specflags)
+ 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)
@@ -91,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
@@ -100,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")
@@ -116,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
diff --git a/code/modules/surgery/bodyparts/robot_bodyparts.dm b/code/modules/surgery/bodyparts/robot_bodyparts.dm
new file mode 100644
index 000000000000..a5cefa1a0a71
--- /dev/null
+++ b/code/modules/surgery/bodyparts/robot_bodyparts.dm
@@ -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 << "You have already inserted a cell!"
+ return
+ else
+ if(!user.unEquip(W))
+ return
+ W.loc = src
+ src.cell = W
+ user << "You insert the cell."
+ else if(istype(W, /obj/item/stack/cable_coil))
+ if(src.wired)
+ user << "You have already inserted wire!"
+ return
+ var/obj/item/stack/cable_coil/coil = W
+ if (coil.use(1))
+ src.wired = 1
+ user << "You insert the wire."
+ else
+ user << "You need one length of coil to wire it!"
+ 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 << "You have already inserted the eyes!"
+ return
+ else if(F.crit_fail)
+ user << "You can't use a broken flash!"
+ return
+ else
+ if(!user.unEquip(W))
+ return
+ F.loc = src
+ if(src.flash1)
+ src.flash2 = F
+ else
+ src.flash1 = F
+ user << "You insert the flash into the eye socket."
+ else if(istype(W, /obj/item/weapon/crowbar))
+ if(flash1 || flash2)
+ playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
+ user << "You remove the flash from [src]."
+ if(flash1)
+ flash1.forceMove(user.loc)
+ flash1 = null
+ if(flash2)
+ flash2.forceMove(user.loc)
+ flash2 = null
+ else
+ user << "There are no flash to remove from [src]."
+
+ 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
+ ..()
diff --git a/code/modules/surgery/generic_steps.dm b/code/modules/surgery/generic_steps.dm
index ee324e432b45..89b070f28cc3 100644
--- a/code/modules/surgery/generic_steps.dm
+++ b/code/modules/surgery/generic_steps.dm
@@ -21,7 +21,7 @@
/datum/surgery_step/clamp_bleeders/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(locate(/datum/surgery_step/saw) in surgery.steps)
- target.heal_organ_damage(20,0)
+ target.heal_bodypart_damage(20,0)
return ..()
@@ -69,7 +69,7 @@
/datum/surgery_step/close/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(locate(/datum/surgery_step/saw) in surgery.steps)
- target.heal_organ_damage(45,0)
+ target.heal_bodypart_damage(45,0)
return ..()
@@ -84,9 +84,7 @@
user.visible_message("[user] begins to saw through the bone in [target]'s [parse_zone(target_zone)].", "You begin to saw through the bone in [target]'s [parse_zone(target_zone)]...")
/datum/surgery_step/saw/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- if(ishuman(target))
- var/mob/living/carbon/human/H = target
- H.apply_damage(50,"brute","[target_zone]")
+ target.apply_damage(50,"brute","[target_zone]")
user.visible_message("[user] saws [target]'s [parse_zone(target_zone)] open!", "You saw [target]'s [parse_zone(target_zone)] open.")
return 1
diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm
index 982ef0d4d40c..32b294a79991 100644
--- a/code/modules/surgery/helpers.dm
+++ b/code/modules/surgery/helpers.dm
@@ -2,13 +2,13 @@
if(!istype(M))
return
- var/mob/living/carbon/human/H
+ var/mob/living/carbon/C
var/obj/item/bodypart/affecting
var/selected_zone = user.zone_selected
- if(istype(M, /mob/living/carbon/human))
- H = M
- affecting = H.get_bodypart(check_zone(selected_zone))
+ if(istype(M, /mob/living/carbon))
+ C = M
+ affecting = C.get_bodypart(check_zone(selected_zone))
if(!M.lying && !isslime(M)) //if they're prone or a slime
return
@@ -29,9 +29,9 @@
if(affecting)
if(!S.requires_bodypart)
continue
- if(S.requires_organic_bodypart && affecting.status == ORGAN_ROBOTIC)
+ if(S.requires_organic_bodypart && affecting.status == BODYPART_ROBOTIC)
continue
- else if(H && S.requires_bodypart) //human with no limb in surgery zone when we need a limb
+ else if(C && S.requires_bodypart) //mob with no limb in surgery zone when we need a limb
continue
if(!S.can_start(user, M))
continue
@@ -49,14 +49,14 @@
return //during the input() another surgery was started at the same location.
//we check that the surgery is still doable after the input() wait.
- if(H)
- affecting = H.get_bodypart(check_zone(selected_zone))
+ if(C)
+ affecting = C.get_bodypart(check_zone(selected_zone))
if(affecting)
if(!S.requires_bodypart)
return
- if(S.requires_organic_bodypart && affecting.status == ORGAN_ROBOTIC)
+ if(S.requires_organic_bodypart && affecting.status == BODYPART_ROBOTIC)
return
- else if(H && S.requires_bodypart)
+ else if(C && S.requires_bodypart)
return
if(!S.can_start(user, M))
return
diff --git a/code/modules/surgery/limb_augmentation.dm b/code/modules/surgery/limb_augmentation.dm
index 3a00620a172e..5e16b420f218 100644
--- a/code/modules/surgery/limb_augmentation.dm
+++ b/code/modules/surgery/limb_augmentation.dm
@@ -16,17 +16,17 @@
/datum/surgery_step/add_limb
name = "replace limb"
- implements = list(/obj/item/robot_parts = 100)
+ implements = list(/obj/item/bodypart = 100)
time = 32
var/obj/item/bodypart/L = null // L because "limb"
/datum/surgery_step/add_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- var/obj/item/robot_parts/aug = tool
- if(istype(aug) && aug.body_zone != target_zone)
+ var/obj/item/bodypart/aug = tool
+ if(aug.status != BODYPART_ROBOTIC && aug.body_zone != target_zone)
user << "[tool] isn't the right type for [parse_zone(target_zone)]."
return -1
- L = surgery.organ
+ L = surgery.operated_bodypart
if(L)
user.visible_message("[user] begins to augment [target]'s [parse_zone(user.zone_selected)].", "You begin to augment [target]'s [parse_zone(user.zone_selected)]...")
else
@@ -45,15 +45,13 @@
/datum/surgery_step/add_limb/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(L)
- if(ishuman(target))
- var/mob/living/carbon/human/H = target
- user.visible_message("[user] successfully augments [target]'s [parse_zone(target_zone)]!", "You successfully augment [target]'s [parse_zone(target_zone)].")
- L.change_bodypart_status(ORGAN_ROBOTIC, 1)
- user.drop_item()
- qdel(tool)
- H.update_damage_overlays(0)
- H.updatehealth()
- add_logs(user, target, "augmented", addition="by giving him new [parse_zone(target_zone)] INTENT: [uppertext(user.a_intent)]")
+ user.visible_message("[user] successfully augments [target]'s [parse_zone(target_zone)]!", "You successfully augment [target]'s [parse_zone(target_zone)].")
+ L.change_bodypart_status(BODYPART_ROBOTIC, 1)
+ user.drop_item()
+ qdel(tool)
+ target.update_damage_overlays()
+ target.updatehealth()
+ add_logs(user, target, "augmented", addition="by giving him new [parse_zone(target_zone)] INTENT: [uppertext(user.a_intent)]")
else
user << "[target] has no organic [parse_zone(target_zone)] there!"
return 1
diff --git a/code/modules/surgery/organs/augments_eyes.dm b/code/modules/surgery/organs/augments_eyes.dm
index 50c3875f258a..eef8bf6dfd39 100644
--- a/code/modules/surgery/organs/augments_eyes.dm
+++ b/code/modules/surgery/organs/augments_eyes.dm
@@ -43,7 +43,7 @@
if(prob(10 * severity))
return
owner << "Static obfuscates your vision!"
- owner.flash_eyes(visual = 1)
+ owner.flash_act(visual = 1)
/obj/item/organ/cyberimp/eyes/xray
name = "X-ray implant"
diff --git a/code/modules/surgery/organs/helpers.dm b/code/modules/surgery/organs/helpers.dm
index f1ee5ec13f6b..48915fd59bd6 100644
--- a/code/modules/surgery/organs/helpers.dm
+++ b/code/modules/surgery/organs/helpers.dm
@@ -11,7 +11,7 @@ mob/proc/getorganslot(slot)
mob/living/carbon/getorgan(typepath)
return (locate(typepath) in internal_organs)
-mob/living/carbon/getorganszone(zone, var/subzones = 0)
+mob/living/carbon/getorganszone(zone, subzones = 0)
var/list/returnorg = list()
if(subzones)
// Include subzones - groin for chest, eyes and mouth for head
@@ -20,7 +20,8 @@ mob/living/carbon/getorganszone(zone, var/subzones = 0)
if(zone == "chest")
returnorg = getorganszone("groin")
- for(var/obj/item/organ/O in internal_organs)
+ for(var/X in internal_organs)
+ var/obj/item/organ/O = X
if(zone == O.zone)
returnorg += O
return returnorg
diff --git a/code/modules/surgery/prosthetic_replacement.dm b/code/modules/surgery/prosthetic_replacement.dm
index 7a0c9fa67180..5341c2bf09d8 100644
--- a/code/modules/surgery/prosthetic_replacement.dm
+++ b/code/modules/surgery/prosthetic_replacement.dm
@@ -1,52 +1,50 @@
/datum/surgery/prosthetic_replacement
name = "prosthetic replacement"
steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/add_prosthetic)
- species = list(/mob/living/carbon/human)
+ species = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list("r_arm", "l_arm", "l_leg", "r_leg", "head")
requires_bodypart = FALSE //need a missing limb
/datum/surgery/prosthetic_replacement/can_start(mob/user, mob/living/carbon/target)
- if(!ishuman(target))
+ if(!iscarbon(target))
return 0
- var/mob/living/carbon/human/H = target
- if(!H.get_bodypart(user.zone_selected)) //can only start if limb is missing
+ var/mob/living/carbon/C = target
+ if(!C.get_bodypart(user.zone_selected)) //can only start if limb is missing
return 1
/datum/surgery_step/add_prosthetic
name = "add prosthetic"
- implements = list(/obj/item/robot_parts = 100, /obj/item/bodypart = 100)
+ implements = list(/obj/item/bodypart = 100)
time = 32
var/organ_rejection_dam = 0
/datum/surgery_step/add_prosthetic/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- var/tool_body_zone
- if(istype(tool, /obj/item/robot_parts))
- var/obj/item/robot_parts/RP = tool
- tool_body_zone = RP.body_zone
- else if(istype(tool, /obj/item/bodypart))
- var/obj/item/bodypart/L = tool
- if(L.status != ORGAN_ROBOTIC)
- organ_rejection_dam = 10
- if(target.dna.species.id != L.species_id)
+ var/obj/item/bodypart/BP = tool
+ if(ismonkey(target))// monkey patient only accept organic monkey limbs
+ if(BP.status == BODYPART_ROBOTIC || BP.animal_origin != MONKEY_BODYPART)
+ user << "[BP] doesn't match the patient's morphology."
+ return -1
+ if(BP.status != BODYPART_ROBOTIC)
+ organ_rejection_dam = 10
+ if(ishuman(target))
+ if(BP.animal_origin)
+ user << "[BP] doesn't match the patient's morphology."
+ return -1
+ var/mob/living/carbon/human/H = target
+ if(H.dna.species.id != BP.species_id)
organ_rejection_dam = 30
- tool_body_zone = L.body_zone
- if(target_zone == tool_body_zone) //so we can't replace a leg with an arm.
+
+ if(target_zone == BP.body_zone) //so we can't replace a leg with an arm, or a human arm with a monkey arm.
user.visible_message("[user] begins to replace [target]'s [parse_zone(target_zone)].", "You begin to replace [target]'s [parse_zone(target_zone)]...")
else
user << "[tool] isn't the right type for [parse_zone(target_zone)]."
return -1
/datum/surgery_step/add_prosthetic/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- var/obj/item/bodypart/L
- if(istype(tool, /obj/item/robot_parts))
- L = newBodyPart(target_zone, 1, 1)
- user.drop_item()
- qdel(tool)
- else
- L = tool
- user.drop_item()
+ var/obj/item/bodypart/L = tool
+ user.drop_item()
L.attach_limb(target)
if(organ_rejection_dam)
target.adjustToxLoss(organ_rejection_dam)
diff --git a/code/modules/surgery/remove_embedded_object.dm b/code/modules/surgery/remove_embedded_object.dm
index 7117d276a76d..fa9db1ae8edd 100644
--- a/code/modules/surgery/remove_embedded_object.dm
+++ b/code/modules/surgery/remove_embedded_object.dm
@@ -12,7 +12,7 @@
/datum/surgery_step/remove_object/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
- L = surgery.organ
+ L = surgery.operated_bodypart
if(L)
user.visible_message("[user] looks for objects embedded in [target]'s [parse_zone(user.zone_selected)].", "You look for objects embedded in [target]'s [parse_zone(user.zone_selected)]...")
else
diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm
index 35b154323040..26e57700ae5f 100644
--- a/code/modules/surgery/surgery.dm
+++ b/code/modules/surgery/surgery.dm
@@ -10,26 +10,26 @@
var/list/possible_locs = list() //Multiple locations
var/ignore_clothes = 0 //This surgery ignores clothes
var/mob/living/carbon/target //Operation target mob
- var/obj/item/organ/organ //Operable body part
+ var/obj/item/bodypart/operated_bodypart //Operable body part
var/requires_bodypart = TRUE //Surgery available only when a bodypart is present, or only when it is missing.
var/success_multiplier = 0 //Step success propability multiplier
-/datum/surgery/New(surgery_target, surgery_location, surgery_organ)
+/datum/surgery/New(surgery_target, surgery_location, surgery_bodypart)
..()
if(surgery_target)
target = surgery_target
target.surgeries += src
if(surgery_location)
location = surgery_location
- if(surgery_organ)
- organ = surgery_organ
+ if(surgery_bodypart)
+ operated_bodypart = surgery_bodypart
/datum/surgery/Destroy()
if(target)
target.surgeries -= src
target = null
- organ = null
+ operated_bodypart = null
return ..()
diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm
index 64223336da14..7e3cbf954ac8 100644
--- a/code/modules/vehicles/scooter.dm
+++ b/code/modules/vehicles/scooter.dm
@@ -38,15 +38,18 @@
else
buckled_mob.pixel_y = -4
+/obj/vehicle/scooter/buckle_mob(mob/living/M, force = 0)
+ if(!istype(M))
+ return 0
+ if(M.get_num_legs() < 2 && M.get_num_arms() <= 0)
+ M << "Your limbless body can't use [src]."
+ return 0
+ . = ..()
+
/obj/vehicle/scooter/post_buckle_mob(mob/living/M)
vehicle_move_delay = initial(vehicle_move_delay)
- ..()
if(M.get_num_legs() < 2)
vehicle_move_delay ++
- if(M.get_num_arms() <= 0)
- if(has_buckled_mobs())//to prevent the message displaying twice due to unbuckling
- M << "Your limbless body flops off \the [src]."
- unbuckle_mob(M)
/obj/vehicle/scooter/skateboard
name = "skateboard"
diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm
index ac8fdaa8b6b2..f21275b6fce3 100644
--- a/code/modules/vehicles/vehicle.dm
+++ b/code/modules/vehicles/vehicle.dm
@@ -94,12 +94,14 @@
/obj/vehicle/relaymove(mob/user, direction)
if(user.incapacitated())
unbuckle_mob(user)
+ return
+ if(world.time < next_vehicle_move)
+ return
+ next_vehicle_move = world.time + vehicle_move_delay
if(keycheck(user))
- if(!Process_Spacemove(direction) || world.time < next_vehicle_move || !isturf(loc))
+ if(!Process_Spacemove(direction) || !isturf(loc))
return
- next_vehicle_move = world.time + vehicle_move_delay
-
step(src, direction)
handle_vehicle_layer()
diff --git a/icons/effects/blood.dmi b/icons/effects/blood.dmi
index f073ff5b3380..e915cb49e370 100644
Binary files a/icons/effects/blood.dmi and b/icons/effects/blood.dmi differ
diff --git a/icons/mob/animal_parts.dmi b/icons/mob/animal_parts.dmi
new file mode 100644
index 000000000000..b120e81d4119
Binary files /dev/null and b/icons/mob/animal_parts.dmi differ
diff --git a/icons/mob/augments.dmi b/icons/mob/augments.dmi
index 8cbb3f03d5e7..7ab1b3893d27 100644
Binary files a/icons/mob/augments.dmi and b/icons/mob/augments.dmi differ
diff --git a/icons/mob/dam_human.dmi b/icons/mob/dam_human.dmi
deleted file mode 100644
index d6d30c87f405..000000000000
Binary files a/icons/mob/dam_human.dmi and /dev/null differ
diff --git a/icons/mob/dam_mob.dmi b/icons/mob/dam_mob.dmi
new file mode 100644
index 000000000000..fe92746b43ec
Binary files /dev/null and b/icons/mob/dam_mob.dmi differ
diff --git a/icons/mob/human_parts.dmi b/icons/mob/human_parts.dmi
index bddb6641c8a1..58ba1d421687 100644
Binary files a/icons/mob/human_parts.dmi and b/icons/mob/human_parts.dmi differ
diff --git a/icons/mob/mob.dmi b/icons/mob/mob.dmi
index 9ec94d38800a..413248185ef9 100644
Binary files a/icons/mob/mob.dmi and b/icons/mob/mob.dmi differ
diff --git a/icons/obj/guns/projectile.dmi b/icons/obj/guns/projectile.dmi
index ffac4fc2f7e7..29ab421834e9 100644
Binary files a/icons/obj/guns/projectile.dmi and b/icons/obj/guns/projectile.dmi differ
diff --git a/tgstation.dme b/tgstation.dme
index 57e25379006b..14896210baf9 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -558,7 +558,6 @@
#include "code\game\objects\effects\bump_teleporter.dm"
#include "code\game\objects\effects\contraband.dm"
#include "code\game\objects\effects\forcefields.dm"
-#include "code\game\objects\effects\gibs.dm"
#include "code\game\objects\effects\glowshroom.dm"
#include "code\game\objects\effects\landmarks.dm"
#include "code\game\objects\effects\manifest.dm"
@@ -1315,10 +1314,20 @@
#include "code\modules\mob\living\say.dm"
#include "code\modules\mob\living\status_procs.dm"
#include "code\modules\mob\living\ventcrawling.dm"
+#include "code\modules\mob\living\brain\brain.dm"
+#include "code\modules\mob\living\brain\brain_item.dm"
+#include "code\modules\mob\living\brain\death.dm"
+#include "code\modules\mob\living\brain\emote.dm"
+#include "code\modules\mob\living\brain\life.dm"
+#include "code\modules\mob\living\brain\MMI.dm"
+#include "code\modules\mob\living\brain\posibrain.dm"
+#include "code\modules\mob\living\brain\say.dm"
+#include "code\modules\mob\living\brain\status_procs.dm"
#include "code\modules\mob\living\carbon\carbon.dm"
#include "code\modules\mob\living\carbon\carbon_defense.dm"
#include "code\modules\mob\living\carbon\carbon_defines.dm"
#include "code\modules\mob\living\carbon\carbon_movement.dm"
+#include "code\modules\mob\living\carbon\damage_procs.dm"
#include "code\modules\mob\living\carbon\death.dm"
#include "code\modules\mob\living\carbon\emote.dm"
#include "code\modules\mob\living\carbon\examine.dm"
@@ -1329,6 +1338,7 @@
#include "code\modules\mob\living\carbon\update_icons.dm"
#include "code\modules\mob\living\carbon\alien\alien.dm"
#include "code\modules\mob\living\carbon\alien\alien_defense.dm"
+#include "code\modules\mob\living\carbon\alien\damage_procs.dm"
#include "code\modules\mob\living\carbon\alien\death.dm"
#include "code\modules\mob\living\carbon\alien\life.dm"
#include "code\modules\mob\living\carbon\alien\login.dm"
@@ -1337,10 +1347,12 @@
#include "code\modules\mob\living\carbon\alien\say.dm"
#include "code\modules\mob\living\carbon\alien\screen.dm"
#include "code\modules\mob\living\carbon\alien\status_procs.dm"
+#include "code\modules\mob\living\carbon\alien\update_icons.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\alien_powers.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\death.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\emote.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\humanoid.dm"
+#include "code\modules\mob\living\carbon\alien\humanoid\humanoid_defense.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\inventory.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\life.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\queen.dm"
@@ -1353,28 +1365,17 @@
#include "code\modules\mob\living\carbon\alien\larva\emote.dm"
#include "code\modules\mob\living\carbon\alien\larva\inventory.dm"
#include "code\modules\mob\living\carbon\alien\larva\larva.dm"
+#include "code\modules\mob\living\carbon\alien\larva\larva_defense.dm"
#include "code\modules\mob\living\carbon\alien\larva\life.dm"
#include "code\modules\mob\living\carbon\alien\larva\powers.dm"
#include "code\modules\mob\living\carbon\alien\larva\update_icons.dm"
#include "code\modules\mob\living\carbon\alien\special\alien_embryo.dm"
#include "code\modules\mob\living\carbon\alien\special\facehugger.dm"
-#include "code\modules\mob\living\carbon\brain\brain.dm"
-#include "code\modules\mob\living\carbon\brain\brain_item.dm"
-#include "code\modules\mob\living\carbon\brain\death.dm"
-#include "code\modules\mob\living\carbon\brain\emote.dm"
-#include "code\modules\mob\living\carbon\brain\life.dm"
-#include "code\modules\mob\living\carbon\brain\MMI.dm"
-#include "code\modules\mob\living\carbon\brain\posibrain.dm"
-#include "code\modules\mob\living\carbon\brain\say.dm"
-#include "code\modules\mob\living\carbon\brain\status_procs.dm"
+#include "code\modules\mob\living\carbon\human\damage_procs.dm"
#include "code\modules\mob\living\carbon\human\death.dm"
#include "code\modules\mob\living\carbon\human\emote.dm"
#include "code\modules\mob\living\carbon\human\examine.dm"
#include "code\modules\mob\living\carbon\human\human.dm"
-#include "code\modules\mob\living\carbon\human\human_attackalien.dm"
-#include "code\modules\mob\living\carbon\human\human_attackhand.dm"
-#include "code\modules\mob\living\carbon\human\human_attackpaw.dm"
-#include "code\modules\mob\living\carbon\human\human_damage.dm"
#include "code\modules\mob\living\carbon\human\human_defense.dm"
#include "code\modules\mob\living\carbon\human\human_defines.dm"
#include "code\modules\mob\living\carbon\human\human_helpers.dm"
@@ -1384,6 +1385,7 @@
#include "code\modules\mob\living\carbon\human\say.dm"
#include "code\modules\mob\living\carbon\human\species.dm"
#include "code\modules\mob\living\carbon\human\species_types.dm"
+#include "code\modules\mob\living\carbon\human\status_procs.dm"
#include "code\modules\mob\living\carbon\human\update_icons.dm"
#include "code\modules\mob\living\carbon\human\whisper.dm"
#include "code\modules\mob\living\carbon\monkey\death.dm"
@@ -1391,16 +1393,20 @@
#include "code\modules\mob\living\carbon\monkey\inventory.dm"
#include "code\modules\mob\living\carbon\monkey\life.dm"
#include "code\modules\mob\living\carbon\monkey\monkey.dm"
+#include "code\modules\mob\living\carbon\monkey\monkey_defense.dm"
#include "code\modules\mob\living\carbon\monkey\punpun.dm"
#include "code\modules\mob\living\carbon\monkey\update_icons.dm"
+#include "code\modules\mob\living\silicon\damage_procs.dm"
#include "code\modules\mob\living\silicon\death.dm"
#include "code\modules\mob\living\silicon\examine.dm"
#include "code\modules\mob\living\silicon\laws.dm"
#include "code\modules\mob\living\silicon\login.dm"
#include "code\modules\mob\living\silicon\say.dm"
#include "code\modules\mob\living\silicon\silicon.dm"
+#include "code\modules\mob\living\silicon\silicon_defense.dm"
#include "code\modules\mob\living\silicon\status_procs.dm"
#include "code\modules\mob\living\silicon\ai\ai.dm"
+#include "code\modules\mob\living\silicon\ai\ai_defense.dm"
#include "code\modules\mob\living\silicon\ai\death.dm"
#include "code\modules\mob\living\silicon\ai\examine.dm"
#include "code\modules\mob\living\silicon\ai\laws.dm"
@@ -1417,6 +1423,7 @@
#include "code\modules\mob\living\silicon\pai\examine.dm"
#include "code\modules\mob\living\silicon\pai\life.dm"
#include "code\modules\mob\living\silicon\pai\pai.dm"
+#include "code\modules\mob\living\silicon\pai\pai_defense.dm"
#include "code\modules\mob\living\silicon\pai\personality.dm"
#include "code\modules\mob\living\silicon\pai\say.dm"
#include "code\modules\mob\living\silicon\pai\software.dm"
@@ -1428,11 +1435,14 @@
#include "code\modules\mob\living\silicon\robot\life.dm"
#include "code\modules\mob\living\silicon\robot\login.dm"
#include "code\modules\mob\living\silicon\robot\robot.dm"
+#include "code\modules\mob\living\silicon\robot\robot_defense.dm"
#include "code\modules\mob\living\silicon\robot\robot_modules.dm"
#include "code\modules\mob\living\silicon\robot\robot_movement.dm"
#include "code\modules\mob\living\silicon\robot\say.dm"
+#include "code\modules\mob\living\simple_animal\animal_defense.dm"
#include "code\modules\mob\living\simple_animal\constructs.dm"
#include "code\modules\mob\living\simple_animal\corpse.dm"
+#include "code\modules\mob\living\simple_animal\damage_procs.dm"
#include "code\modules\mob\living\simple_animal\parrot.dm"
#include "code\modules\mob\living\simple_animal\shade.dm"
#include "code\modules\mob\living\simple_animal\simple_animal.dm"
@@ -1853,6 +1863,7 @@
#include "code\modules\surgery\bodyparts\dismemberment.dm"
#include "code\modules\surgery\bodyparts\head.dm"
#include "code\modules\surgery\bodyparts\helpers.dm"
+#include "code\modules\surgery\bodyparts\robot_bodyparts.dm"
#include "code\modules\surgery\organs\augments_arms.dm"
#include "code\modules\surgery\organs\augments_chest.dm"
#include "code\modules\surgery\organs\augments_eyes.dm"