Carbon Dismemberment , second attempt. (#20461)

* - I rearranged X_defense.dm mob files, more damage_procs.dm.Here's what's inside:
* X_defense.dm: is for the procs of attacks onto the mob, all the XXX_act() proc (things happening to the mob), as well as protection check and get procs (armor, ear prot, projectile dismemberment)
* damage_procs.dm: actual damage procs like adjustBruteLoss() getfireloss, any proc that handles damaging.

- some bugfixes with gibspawner effects.
- monkey's bodyparts can be dismembered and are used to create its icon.
- brains are no longer carbons.
- all carbon have bodyparts that can be dropped when the mob is gibbed.
- adminspawned bodyparts now have a default icon.
- robotic parts are now a child of bodyparts.
- health analyzer on alien/monkey shows damage on each limb
- added admin option to add/remove bodyparts for all carbon (instead of just remove on humans)
- Fixes keycheck message spam for janicart and all when trying to move.
- Fixes bug with buckling to a scooter while limbless.
- removed arg "hit_zone" in proj's on_hit() because we can already use the def_zone var (where hit_zone got its value)
- Fixes mob not getting any damage when hit by a projectile on their missing limb, despite a hit message shown). carbon/apply_damage() now when we specify a def_zone and the corresponding BP is missing we default to the chest instead of stopping the proc. Consistently with how human/attacked_by() default to its attack to chest if missing limb.
- Fixes mini uzi icon when empty and no mag (typo).
- I renamed and changed a bit check_eye_prot and ear prot
- renamed flash_eyes to flash_act()
- I made a soundbang_act() similar to flash_act but for loud bangs.
- added a gib and dust animation to larva.
- husked monkeys
- no damage overlay for husk or skeleton.
- damage overlay for robotic limb now.
- no damage overlay when organic bodypart husked.
- one handed human with a bloody hand still get a bloody single hand overlay.
- fix admin heal being unable to heal robotic bodyparts.
- slightly touched robotic bodypart sprites (head one pixel too high)
- Fixes 18532 "beheaded husk has hair".
- Fixes 18584 "Ling stasis appearance bug"
- no more eyes or lipstick on husks.
- can remove flashes/wires/cells from robot chest and head with crowbar.
- Fixes not being able to surgically amputate robotic arm/leg.

* More merge conflict fixes and adding the new files I forgot to add.

* of course I forgot birdstation

* More typos and stuff I forgot to undo.

* Fixing a typo in examine.dm
Removing an unnecessary check.
Making admin heal regenerate limbs on all carbons.
Monkey-human transformation now transfer missing limbs info and presence of a cavity implant.
NODISMEMBER species can still lack a limb if the mob lacked a limb and changed into that new species.
Changeling Regenerate ability now also regenerate limbs when in monkey form. (and remove some cryptic useless code)

* Fixing more conflicts with remie's multihands PR.

* Fixes runtime with hud when calling build_hand_slots().
Fixes lightgeist healing not working.
Fixes null.handle_fall() runtimes with pirate mobs.
Fixes typo in has_left_hadn() and has_right_hand().

* Derp, forgot to remove debug message.
This commit is contained in:
phil235
2016-09-12 19:33:50 +02:00
committed by AnturK
parent 2a58dd54a9
commit 443a4501ec
234 changed files with 4926 additions and 4116 deletions
+37 -10
View File
@@ -279,11 +279,11 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
if(iscarbon(D))
body += "<option value>---</option>"
body += "<option value='?_src_=vars;editorgans=\ref[D]'>Modify organs</option>"
body += "<option value='?_src_=vars;editbodypart=\ref[D]'>Modify bodypart</option>"
body += "<option value='?_src_=vars;makeai=\ref[D]'>Make AI</option>"
if(ishuman(D))
body += "<option value='?_src_=vars;makemonkey=\ref[D]'>Make monkey</option>"
body += "<option value='?_src_=vars;setspecies=\ref[D]'>Set Species</option>"
body += "<option value='?_src_=vars;removebodypart=\ref[D]'>Remove Body Part</option>"
body += "<option value='?_src_=vars;makerobot=\ref[D]'>Make cyborg</option>"
body += "<option value='?_src_=vars;makealien=\ref[D]'>Make alien</option>"
body += "<option value='?_src_=vars;makeslime=\ref[D]'>Make slime</option>"
@@ -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("<span class='notice'>[key_name(usr)] dealt [amount] amount of [Text] damage to [L] </span>")
href_list["datumrefresh"] = href_list["mobToDamage"]
@@ -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
/*
@@ -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 << "<span class='warning'>[pick("Your skin feels itchy.", "You feel light headed.")]</span>"
M.dna.remove_mutation_group(possible_mutations)
randmut(M, possible_mutations)
C << "<span class='warning'>[pick("Your skin feels itchy.", "You feel light headed.")]</span>"
C.dna.remove_mutation_group(possible_mutations)
C.randmut(possible_mutations)
return
// Archive their DNA before they were infected.
+1 -1
View File
@@ -38,7 +38,7 @@
if(prob(1))
affected_mob << "<span class='danger'>Your muscles ache.</span>"
if(prob(20))
affected_mob.take_organ_damage(1)
affected_mob.take_bodypart_damage(1)
if(prob(1))
affected_mob << "<span class='danger'>Your stomach hurts.</span>"
if(prob(20))
+2 -2
View File
@@ -26,7 +26,7 @@
if(prob(1))
affected_mob << "<span class='danger'>Your muscles ache.</span>"
if(prob(20))
affected_mob.take_organ_damage(1)
affected_mob.take_bodypart_damage(1)
if(prob(1))
affected_mob << "<span class='danger'>Your stomach hurts.</span>"
if(prob(20))
@@ -45,7 +45,7 @@
if(prob(1))
affected_mob << "<span class='danger'>Your muscles ache.</span>"
if(prob(20))
affected_mob.take_organ_damage(1)
affected_mob.take_bodypart_damage(1)
if(prob(1))
affected_mob << "<span class='danger'>Your stomach hurts.</span>"
if(prob(20))
+2 -2
View File
@@ -22,7 +22,7 @@
affected_mob.emote("cough")
if(prob(1))
affected_mob << "<span class='danger'>You're burning in your own skin!</span>"
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 << "<span class='danger'>You're burning in your own skin!</span>"
affected_mob.take_organ_damage(0,5)
affected_mob.take_bodypart_damage(0,5)
return
+51 -27
View File
@@ -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())
+1 -1
View File
@@ -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 ..()
+4 -4
View File
@@ -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
+3 -4
View File
@@ -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