Merge remote-tracking branch 'upstream/master' into so-edgey

This commit is contained in:
Fox-McCloud
2017-07-01 20:17:16 -04:00
71 changed files with 648 additions and 572 deletions
+27 -1
View File
@@ -96,6 +96,9 @@
return (copytext(message, length(message)) == "!") ? 2 : 1
/datum/language/proc/broadcast(mob/living/speaker, message, speaker_mask)
if(!check_can_speak(speaker))
return FALSE
log_say("[key_name(speaker)]: ([name]) [message]")
if(!speaker_mask)
@@ -114,6 +117,9 @@
/datum/language/proc/check_special_condition(mob/other, mob/living/speaker)
return TRUE
/datum/language/proc/check_can_speak(mob/living/speaker)
return TRUE
/datum/language/proc/get_spoken_verb(msg_end)
switch(msg_end)
if("!")
@@ -290,10 +296,30 @@
flags = RESTRICTED | HIVEMIND
/datum/language/grey/broadcast(mob/living/speaker, message, speaker_mask)
var/their = "their"
if(speaker.gender == "female")
their = "her"
if(speaker.gender == "male")
their = "his"
speaker.visible_message("<span class='notice'>[speaker] touches [their] fingers to [their] temple.</span>")
..(speaker,message,speaker.real_name)
/datum/language/grey/check_can_speak(mob/living/speaker)
if(ishuman(speaker))
var/mob/living/carbon/human/S = speaker
var/obj/item/organ/external/rhand = S.get_organ("r_hand")
var/obj/item/organ/external/lhand = S.get_organ("l_hand")
if((!rhand || !rhand.is_usable()) && (!lhand || !lhand.is_usable()))
to_chat(speaker,"<span class='warning'>You can't communicate without the ability to use your hands!</span>")
return FALSE
if(speaker.incapacitated(ignore_lying = 1))
to_chat(speaker,"<span class='warning'>You can't communicate while unable to move your hands to your head!</span>")
return FALSE
return TRUE
/datum/language/grey/check_special_condition(mob/living/carbon/human/other, mob/living/carbon/human/speaker)
if(other in range(7, speaker))
if(atoms_share_level(other, speaker))
return TRUE
return FALSE
@@ -71,9 +71,9 @@
var/obj/item/organ/internal/brain/B = src
if(!special)
var/mob/living/simple_animal/borer/borer = owner.has_brain_worms()
if(borer)
borer.detach() //Should remove borer if the brain is removed - RR
borer.leave_host() //Should remove borer if the brain is removed - RR
if(owner.mind && !non_primary)//don't transfer if the owner does not have a mind.
B.transfer_identity(user)
+4
View File
@@ -244,6 +244,10 @@
if(status == "")
status = "OK"
src.show_message(text("\t []My [] is [].",status=="OK"?"<span class='notice'></span>":"<span class='warning'></span>",org.name,status),1)
for(var/obj/item/I in org.embedded_objects)
to_chat(src, "\t <a href='byond://?src=[UID()];embedded_object=[I.UID()];embedded_limb=[org.UID()]' class='warning'>There is \a [I] embedded in your [org.name]!</a>")
if(staminaloss)
if(staminaloss > 30)
to_chat(src, "<span class='info'>You're completely exhausted.</span>")
+6 -17
View File
@@ -90,8 +90,10 @@
if(src) qdel(src)
/mob/living/carbon/human/death(gibbed)
if(stat == DEAD) return
if(healths) healths.icon_state = "health5"
if(stat == DEAD)
return
if(healths)
healths.icon_state = "health5"
if(!gibbed)
emote("deathgasp") //let the world KNOW WE ARE DEAD
@@ -102,21 +104,8 @@
set_heartattack(FALSE)
//Handle species-specific deaths.
if(species) species.handle_death(src)
//Handle brain slugs.
var/obj/item/organ/external/head = get_organ("head")
var/mob/living/simple_animal/borer/B
if(istype(head))
for(var/I in head.implants)
if(istype(I,/mob/living/simple_animal/borer))
B = I
if(B)
if(B.controlling && B.host == src)
B.detach()
verbs -= /mob/living/carbon/proc/release_control
if(species)
species.handle_death(src)
callHook("death", list(src, gibbed))
@@ -382,6 +382,9 @@
else
wound_flavor_text["[temp.limb_name]"] = ""
for(var/obj/item/I in temp.embedded_objects)
msg += "<B>[t_He] [t_has] \a [bicon(I)] [I] embedded in [t_his] [temp.name]!</B>\n"
//Handles the text strings being added to the actual description.
//If they have something that covers the limb, and it is not missing, put flavortext. If it is covered but bleeding, add other flavortext.
var/display_chest = 0
@@ -438,9 +441,6 @@
if(display_gloves)
msg += "<span class='warning'><b>[src] has blood running from under [t_his] gloves!</b></span>\n"
for(var/implant in get_visible_implants(0))
msg += "<span class='warning'><b>[src] has \a [implant] sticking out of [t_his] flesh!</b></span>\n"
if(digitalcamo)
msg += "[t_He] [t_is] repulsively uncanny!\n"
if(!(skipface || ( wear_mask && ( wear_mask.flags_inv & HIDEFACE || wear_mask.flags_cover & MASKCOVERSMOUTH) ) ) && is_thrall(src) && in_range(user,src))
+22 -34
View File
@@ -8,7 +8,6 @@
//why are these here and not in human_defines.dm
//var/list/hud_list[10]
var/datum/species/species //Contains icon generation and language information, set during New().
var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us.
var/obj/item/weapon/rig/wearing_rig // This is very not good, but it's much much better than calling get_rig() every update_canmove() call.
/mob/living/carbon/human/New(var/new_loc, var/new_species = null, var/delay_ready_dna = 0)
@@ -700,6 +699,28 @@
if(G && G.pickpocket)
thief_mode = 1
if(href_list["embedded_object"])
var/obj/item/organ/external/L = locate(href_list["embedded_limb"]) in bodyparts
if(!L)
return
var/obj/item/I = locate(href_list["embedded_object"]) in L.embedded_objects
if(!I || I.loc != src) //no item, no limb, or item is not in limb or in the person anymore
return
var/time_taken = I.embedded_unsafe_removal_time*I.w_class
usr.visible_message("<span class='warning'>[usr] attempts to remove [I] from their [L.name].</span>","<span class='notice'>You attempt to remove [I] from your [L.name]... (It will take [time_taken/10] seconds.)</span>")
if(do_after(usr, time_taken, needhand = 1, target = src))
if(!I || !L || I.loc != src || !(I in L.embedded_objects))
return
L.embedded_objects -= I
L.take_damage(I.embedded_unsafe_removal_pain_multiplier*I.w_class)//It hurts to rip it out, get surgery you dingus.
I.forceMove(get_turf(src))
usr.put_in_hands(I)
usr.emote("scream")
usr.visible_message("[usr] successfully rips [I] out of their [L.name]!","<span class='notice'>You successfully remove [I] from your [L.name].</span>")
if(!has_embedded_objects())
clear_alert("embeddedobject")
return
if(href_list["item"])
var/slot = text2num(href_list["item"])
if(slot in check_obscured_slots())
@@ -1348,16 +1369,6 @@
else
..()
/mob/living/carbon/human/get_visible_implants(var/class = 0)
var/list/visible_implants = list()
for(var/obj/item/organ/external/organ in bodyparts)
for(var/obj/item/weapon/O in organ.implants)
if(!istype(O,/obj/item/weapon/implant) && (O.w_class > class) && !istype(O,/obj/item/weapon/shard/shrapnel))
visible_implants += O
return(visible_implants)
/mob/living/carbon/human/generate_name()
name = species.makeName(gender,src)
real_name = name
@@ -1365,29 +1376,6 @@
dna.real_name = name
return name
/mob/living/carbon/human/proc/handle_embedded_objects()
for(var/obj/item/organ/external/organ in bodyparts)
if(organ.status & ORGAN_SPLINTED) //Splints prevent movement.
continue
for(var/obj/item/weapon/O in organ.implants)
if(!istype(O,/obj/item/weapon/implant) && prob(5)) //Moving with things stuck in you could be bad.
// All kinds of embedded objects cause bleeding.
var/msg = null
switch(rand(1,3))
if(1)
msg ="<span class='warning'>A spike of pain jolts your [organ.name] as you bump [O] inside.</span>"
if(2)
msg ="<span class='warning'>Your movement jostles [O] in your [organ.name] painfully.</span>"
if(3)
msg ="<span class='warning'>[O] in your [organ.name] twists painfully as you move.</span>"
to_chat(src, msg)
organ.take_damage(rand(1,3), 0, 0)
if(!(organ.status & ORGAN_ROBOT)) //There is no blood in protheses.
organ.status |= ORGAN_BLEEDING
src.adjustToxLoss(rand(1,3))
/mob/living/carbon/human/verb/check_pulse()
set category = null
set name = "Check pulse"
@@ -8,7 +8,7 @@ emp_act
*/
/mob/living/carbon/human/bullet_act(var/obj/item/projectile/P, var/def_zone)
/mob/living/carbon/human/bullet_act(obj/item/projectile/P, def_zone)
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
@@ -41,19 +41,6 @@ emp_act
. = bullet_act(P, "chest") //act on chest instead
return
//Shrapnel
if(P.damage_type == BRUTE)
var/armor = getarmor_organ(organ, "bullet")
if((P.embed && prob(20 + max(P.damage - armor, -10))))
var/obj/item/weapon/shard/shrapnel/SP = new()
(SP.name) = "[P.name] shrapnel"
if(P.ammo_casing && P.ammo_casing.caliber)
(SP.desc) = "[SP.desc] It looks like it is a [P.ammo_casing.caliber] caliber round."
else
(SP.desc) = "[SP.desc] The round's caliber is unidentifiable."
(SP.loc) = organ
organ.embed(SP)
organ.add_autopsy_data(P.name, P.damage) // Add the bullet's name to the autopsy data
return (..(P , def_zone))
@@ -295,21 +282,6 @@ emp_act
if(Iforce > 10 || Iforce >= 5 && prob(33))
forcesay(hit_appends) //forcesay checks stat already
/* //Melee weapon embedded object code. Commented out, as most people on the forums seem to find this annoying and think it does not contribute to general gameplay. - Dave
if(I.damtype == BRUTE && !I.is_robot_module())
var/damage = I.force
if(armor)
damage /= armor+1
//blunt objects should really not be embedding in things unless a huge amount of force is involved
var/embed_chance = weapon_sharp? damage/I.w_class : damage/(I.w_class*3)
var/embed_threshold = weapon_sharp? 5*I.w_class : 15*I.w_class
//Sharp objects will always embed if they do enough damage.
if(((weapon_sharp && damage > (10*I.w_class)) || (damage > embed_threshold && prob(embed_chance))) && (I.no_embed == 0) )
affecting.embed(I)
return 1*/
//this proc handles being hit by a thrown atom
/mob/living/carbon/human/hitby(atom/movable/AM, skipcatch = 0, hitpush = 1, blocked = 0)
var/obj/item/I
@@ -323,24 +295,19 @@ emp_act
hitpush = 0
skipcatch = 1
blocked = 1
/*else if(I)
else if(I)
if(I.throw_speed >= EMBED_THROWSPEED_THRESHOLD)
if(!I.is_robot_module())
var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].", I.armour_penetration) //I guess "melee" is the best fit here
var/sharp = is_sharp(I)
var/damage = throwpower * (I.throw_speed / 5)
if(armor)
damage /= armor + 1
//blunt objects should really not be embedding in things unless a huge amount of force is involved
var/embed_chance = sharp? damage / I.w_class : damage/(I.w_class * 3)
var/embed_threshold = sharp? 5 * I.w_class : 15 * I.w_class
//Sharp objects will always embed if they do enough damage.
//Thrown sharp objects have some momentum already and have a small chance to embed even if the damage is below the threshold
if(((sharp && prob(damage / (10 * I.w_class) * 100)) || (damage > embed_threshold && prob(embed_chance))) && (I.no_embed == 0))
affecting.embed(I)*/
if(can_embed(I))
if(prob(I.embed_chance))
throw_alert("embeddedobject", /obj/screen/alert/embeddedobject)
var/obj/item/organ/external/L = pick(bodyparts)
L.embedded_objects |= I
// I.add_mob_blood(src)//it embedded itself in you, of course it's bloody!
I.forceMove(src)
L.take_damage(I.w_class*I.embedded_impact_pain_multiplier)
visible_message("<span class='danger'>[I] embeds itself in [src]'s [L.name]!</span>","<span class='userdanger'>[I] embeds itself in your [L.name]!</span>")
hitpush = 0
skipcatch = 1 //can't catch the now embedded item
return ..()
/mob/living/carbon/human/proc/bloody_hands(var/mob/living/source, var/amount = 2)
@@ -419,5 +386,5 @@ emp_act
/mob/living/carbon/human/water_act(volume, temperature, source)
..()
if(temperature >= 330) bodytemperature = bodytemperature + (temperature - bodytemperature)
if(temperature <= 280) bodytemperature = bodytemperature - (bodytemperature - temperature)
species.water_act(src,volume,temperature,source)
+20 -7
View File
@@ -40,6 +40,10 @@
if(!client)
species.handle_npc(src)
if(stat != DEAD)
//Stuff jammed in your limbs hurts
handle_embedded_objects()
if(stat == DEAD)
handle_decay()
@@ -813,13 +817,6 @@
blinded = 1
stat = UNCONSCIOUS
if(embedded_flag && !(mob_master.current_cycle % 10))
var/list/E
E = get_visible_implants(0)
if(!E.len)
embedded_flag = 0
//Vision //god knows why this is here
var/obj/item/organ/vision
if(species.vision_organ)
@@ -932,6 +929,22 @@
adjustToxLoss(-3)
lastpuke = 0
/mob/living/carbon/human/proc/handle_embedded_objects()
for(var/X in bodyparts)
var/obj/item/organ/external/BP = X
for(var/obj/item/I in BP.embedded_objects)
if(prob(I.embedded_pain_chance))
BP.take_damage(I.w_class*I.embedded_pain_multiplier)
to_chat(src, "<span class='userdanger'>[I] embedded in your [BP.name] hurts!</span>")
if(prob(I.embedded_fall_chance))
BP.take_damage(I.w_class*I.embedded_fall_pain_multiplier)
BP.embedded_objects -= I
I.forceMove(get_turf(src))
visible_message("<span class='danger'>[I] falls out of [name]'s [BP.name]!</span>","<span class='userdanger'>[I] falls out of your [BP.name]!</span>")
if(!has_embedded_objects())
clear_alert("embeddedobject")
/mob/living/carbon/human/handle_changeling()
if(mind)
if(mind.changeling)
@@ -399,9 +399,6 @@
if(has_gravity(H))
gravity = 1
if(H.embedded_flag)
H.handle_embedded_objects() //Moving with objects stuck in you can cause bad times.
if(!ignoreslow && gravity)
if(slowdown)
. = slowdown
@@ -741,3 +738,9 @@ It'll return null if the organ doesn't correspond, so include null checks when u
if(H.see_override) //Override all
H.see_invisible = H.see_override
/datum/species/proc/water_act(mob/living/carbon/human/M, volume, temperature, source)
if(temperature >= 330)
M.bodytemperature = M.bodytemperature + (temperature - M.bodytemperature)
if(temperature <= 280)
M.bodytemperature = M.bodytemperature - (M.bodytemperature - temperature)
@@ -753,6 +753,11 @@
genemutcheck(C,REMOTETALKBLOCK,null,MUTCHK_FORCED)
..()
/datum/species/grey/water_act(var/mob/living/carbon/C, volume, temperature, source)
..()
C.take_organ_damage(5,min(volume,20))
C.emote("scream")
/datum/species/grey/after_equip_job(datum/job/J, mob/living/carbon/human/H)
var/speech_pref = H.client.prefs.speciesprefs
if(speech_pref)
+1
View File
@@ -512,6 +512,7 @@
human_mob.restore_blood()
human_mob.shock_stage = 0
human_mob.decaylevel = 0
human_mob.remove_all_embedded_objects()
restore_all_organs()
surgeries.Cut() //End all surgeries.
@@ -260,10 +260,6 @@
stored_comms["glass"]++
else if(istype(W,/obj/item/ammo_casing))
stored_comms["metal"]++
else if(istype(W,/obj/item/weapon/shard/shrapnel))
stored_comms["metal"]++
stored_comms["metal"]++
stored_comms["metal"]++
else if(istype(W,/obj/item/weapon/shard))
stored_comms["glass"]++
stored_comms["glass"]++
-98
View File
@@ -1052,104 +1052,6 @@ var/list/slot_equipment_priority = list( \
/mob/proc/get_species()
return ""
/mob/proc/get_visible_implants(var/class = 0)
var/list/visible_implants = list()
for(var/obj/item/O in embedded)
if(O.w_class > class)
visible_implants += O
return visible_implants
/mob/proc/yank_out_object()
set category = "Object"
set name = "Yank out object"
set desc = "Remove an embedded item at the cost of bleeding and pain."
set src in view(1)
if(!isliving(usr) || usr.next_move > world.time)
return
usr.changeNext_move(CLICK_CD_RESIST)
if(usr.stat == 1)
to_chat(usr, "You are unconcious and cannot do that!")
return
if(usr.restrained())
to_chat(usr, "You are restrained and cannot do that!")
return
var/mob/S = src
var/mob/U = usr
var/list/valid_objects = list()
var/self = null
if(S == U)
self = 1 // Removing object from yourself.
valid_objects = get_visible_implants(0)
if(!valid_objects.len)
if(self)
to_chat(src, "You have nothing stuck in your body that is large enough to remove.")
else
to_chat(U, "[src] has nothing stuck in their wounds that is large enough to remove.")
return
var/obj/item/weapon/selection = input("What do you want to yank out?", "Embedded objects") in valid_objects
if(self)
visible_message("<span class='warning'>[usr] appears to be trying to extract an object from their body.</span>")
to_chat(src, "<span class='warning'>You attempt to get a good grip on [selection] in your body.</span>")
else
visible_message("<span class='warning'>[usr] attempts to get a good grip on [selection] in [S]'s body.</span>")
to_chat(U, "<span class='warning'>You attempt to get a good grip on [selection] in [S]'s body.</span>")
if(!do_after(U, 80, target = S))
return
if(!selection || !S || !U)
return
if(self)
visible_message("<span class='warning'><b>[src] rips [selection] out of their body.</b></span>","<span class='warning'><b>You rip [selection] out of your body.</b></span>")
else
visible_message("<span class='warning'><b>[usr] rips [selection] out of [src]'s body.</b></span>","<span class='warning'><b>[usr] rips [selection] out of your body.</b></span>")
valid_objects = get_visible_implants(0)
if(valid_objects.len == 1) //Yanking out last object - removing verb.
src.verbs -= /mob/proc/yank_out_object
if(ishuman(src))
var/mob/living/carbon/human/H = src
var/obj/item/organ/external/affected
for(var/obj/item/organ/external/organ in H.bodyparts) //Grab the organ holding the implant.
for(var/obj/item/weapon/O in organ.implants)
if(O == selection)
affected = organ
affected.implants -= selection
H.shock_stage+=10
if(prob(10)) //I'M SO ANEMIC I COULD JUST -DIE-.
var/datum/wound/internal_bleeding/I = new ()
affected.wounds += I
H.custom_pain("Something tears wetly in your [affected] as [selection] is pulled free!", 1)
if(ishuman(U))
var/mob/living/carbon/human/human_user = U
human_user.bloody_hands(H)
selection.forceMove(get_turf(src))
if(!(U.l_hand && U.r_hand))
U.put_in_hands(selection)
for(var/obj/item/weapon/O in pinned)
if(O == selection)
pinned -= O
if(!pinned.len)
anchored = 0
return 1
/mob/dead/observer/verb/respawn()
set name = "Respawn as NPC"
set category = "Ghost"
-2
View File
@@ -53,8 +53,6 @@
var/lastpuke = 0
var/unacidable = 0
var/can_strip = 1
var/list/pinned = list() //List of things pinning this creature to walls (see living_defense.dm)
var/list/embedded = list() //Embedded items, since simple mobs don't have organs.
var/list/languages = list() // For speaking/listening.
var/list/abilities = list() // For species-derived or admin-given powers.
var/list/speak_emote = list("says") // Verbs used when speaking. Defaults to 'say' if speak_emote is null.