From 7a4b21382e136bb8755f2a4c37c3c54e63f2ec28 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Sat, 4 Feb 2012 14:17:17 -0700 Subject: [PATCH] Fixes for *custom v/h emotes Blood type is now a variable of the DNA datum Fixed runtime from blood Fixed the AI prompt being missed. Added breath holding. --- code/WorkInProgress/Cael_Aislinn/MultiZ.dm | 3 +- code/WorkInProgress/detective_work.dm | 7 ++- code/game/atom_procs.dm | 21 ++++---- code/game/gamemodes/game_mode.dm | 3 +- code/game/machinery/bots/mulebot.dm | 2 +- code/game/machinery/computer/Operating.dm | 2 +- code/game/machinery/computer/computer.dm | 8 +-- code/game/machinery/scanner.dm | 2 +- code/game/magic/cultist/ritual.dm | 10 ++-- code/game/objects/devices/scanners.dm | 3 +- code/modules/mob/living/carbon/human/emote.dm | 53 ++++++++++++++----- .../mob/living/carbon/human/examine.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 35 +++++++++--- code/modules/mob/living/silicon/ai/ai.dm | 10 ++-- code/modules/mob/transform_procs.dm | 6 +++ 16 files changed, 113 insertions(+), 56 deletions(-) diff --git a/code/WorkInProgress/Cael_Aislinn/MultiZ.dm b/code/WorkInProgress/Cael_Aislinn/MultiZ.dm index 19a3c65045..1f3c9a9568 100644 --- a/code/WorkInProgress/Cael_Aislinn/MultiZ.dm +++ b/code/WorkInProgress/Cael_Aislinn/MultiZ.dm @@ -175,8 +175,7 @@ H.apply_damage(0.5*damage, BRUTE, "r_arm") var/obj/effect/decal/cleanable/blood/B = new(src.loc) - B.blood_DNA = H.dna.unique_enzymes - B.blood_type = H.b_type + B.blood_DNA = list(list(H.dna.unique_enzymes, H.dna.btype)) H:weakened = max(H:weakened,2) H:updatehealth() diff --git a/code/WorkInProgress/detective_work.dm b/code/WorkInProgress/detective_work.dm index de93933cc0..424a23c2e4 100644 --- a/code/WorkInProgress/detective_work.dm +++ b/code/WorkInProgress/detective_work.dm @@ -714,8 +714,11 @@ turf/proc/add_bloody_footprints(mob/living/carbon/human/M,leaving,d,info) this.dir = d this.desc = "These bloody footprints appear to have been made by [info]." if(istype(M,/mob/living/carbon/human)) - this.blood_DNA.len++ - this.blood_DNA[this.blood_DNA.len] = list(M.dna.unique_enzymes,M.b_type) + if(this.blood_DNA.len) + this.blood_DNA.len++ + this.blood_DNA[this.blood_DNA.len] = list(M.dna.unique_enzymes,M.dna.b_type) + else + this.blood_DNA = list(list(M.dna.unique_enzymes,M.dna.b_type)) proc/get_tracks(mob/M) if(istype(M,/mob/living)) diff --git a/code/game/atom_procs.dm b/code/game/atom_procs.dm index cb0572d845..b40b1ab18b 100644 --- a/code/game/atom_procs.dm +++ b/code/game/atom_procs.dm @@ -148,12 +148,12 @@ I.Blend(new /icon('blood.dmi', "itemblood"),ICON_MULTIPLY) I.Blend(new /icon(src.icon, src.icon_state),ICON_UNDERLAY) src.icon = I - if(src.blood_DNA) + if(src.blood_DNA.len) src.blood_DNA.len++ - src.blood_DNA[src.blood_DNA.len] = list(M.dna.unique_enzymes,M.b_type) + src.blood_DNA[src.blood_DNA.len] = list(M.dna.unique_enzymes,M.dna.b_type) else var/list/blood_DNA_temp[1] - blood_DNA_temp[1] = list(M.dna.unique_enzymes, M.b_type) + blood_DNA_temp[1] = list(M.dna.unique_enzymes, M.dna.b_type) src.blood_DNA = blood_DNA_temp else if (istype(src, /turf/simulated)) var/turf/simulated/source2 = src @@ -172,22 +172,19 @@ this.viruses += newDisease newDisease.holder = this else if (istype(src, /mob/living/carbon/human)) - if(src.blood_DNA) + if(src.blood_DNA.len) src.blood_DNA.len++ - src.blood_DNA[src.blood_DNA.len] = list(M.dna.unique_enzymes,M.b_type) + src.blood_DNA[src.blood_DNA.len] = list(M.dna.unique_enzymes,M.dna.b_type) else var/list/blood_DNA_temp[1] - blood_DNA_temp[1] = list(M.dna.unique_enzymes, M.b_type) + blood_DNA_temp[1] = list(M.dna.unique_enzymes, M.dna.b_type) src.blood_DNA = blood_DNA_temp else return else - var/list/L = params2list(src.blood_DNA) - L -= M.dna.unique_enzymes - while(L.len >= 3) - L -= L[1] - L += M.dna.unique_enzymes - src.blood_DNA = list2params(L) + var/list/blood_DNA_temp[1] + blood_DNA_temp[1] = list(M.dna.unique_enzymes, M.dna.b_type) + src.blood_DNA = blood_DNA_temp return /atom/proc/add_vomit_floor(mob/living/carbon/M as mob, var/toxvomit = 0) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 70e1d553f8..b2860af20c 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -55,7 +55,6 @@ Devices and Tools; /obj/item/device/radio/headset/traitor:3:Headset with Binary Translator; /obj/item/weapon/plastique:2:C-4 (Destroys walls); /obj/item/weapon/syndie/c4explosive:4:Low Power Explosive Charge, with Detonator; -/obj/item/weapon/syndie/c4explosive/heavy:7:High (!) Power Explosive Charge, with Detonator; /obj/item/device/powersink:5:Powersink (DANGER!); /obj/machinery/singularity_beacon/syndicate:7:Singularity Beacon (DANGER!); Whitespace:Seperator; @@ -69,6 +68,8 @@ Badassery; /obj/item/toy/syndicateballoon:10:For showing that You Are The BOSS (Useless Balloon); Whitespace:Seperator;"} +//obj/item/weapon/syndie/c4explosive/heavy:7:High (!) Power Explosive Charge, with Detonator; + /datum/game_mode/proc/announce() //to be calles when round starts world << "Notice: [src] did not define announce()" diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index 441a7f06fb..9e0b575c3f 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -806,7 +806,7 @@ var/obj/effect/decal/cleanable/blood/B = new(src.loc) B.blood_DNA.len++ - B.blood_DNA[B.blood_DNA.len] = list(H.dna.unique_enzymes, H.b_type) + B.blood_DNA[B.blood_DNA.len] = list(H.dna.unique_enzymes, H.dna.b_type) bloodiness += 4 diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index e6516b74c3..8b37e8f6ee 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -33,7 +33,7 @@
Name: [src.victim.real_name]
Age: [!isnull(src.victim.age) ? src.victim.age : "Undetermined"]
-Blood Type: [src.victim.b_type]
+Blood Type: [src.victim.dna.b_type]

Health: [src.victim.health]
Brute Damage: [src.victim.getBruteLoss()]
diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 4d8d31c860..91e6b8b9b7 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -404,7 +404,7 @@ Pod/Blast Doors computer G.fields["fingerprint"] = text("[]", md5(H.dna.uni_identity)) G.fields["p_stat"] = "Active" G.fields["m_stat"] = "Stable" - M.fields["b_type"] = text("[]", H.b_type) + M.fields["b_type"] = text("[]", H.dna.b_type) M.fields["b_dna"] = H.dna.unique_enzymes M.fields["mi_dis"] = "None" M.fields["mi_dis_d"] = "No minor disabilities have been declared." @@ -428,7 +428,7 @@ Pod/Blast Doors computer L.fields["age"] = H.age L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") L.fields["rank"] = H.mind.assigned_role - L.fields["b_type"] = H.b_type + L.fields["b_type"] = H.dna.b_type L.fields["b_dna"] = H.dna.unique_enzymes L.fields["enzymes"] = H.dna.struc_enzymes L.fields["identity"] = H.dna.uni_identity @@ -481,7 +481,7 @@ Pod/Blast Doors computer G.fields["fingerprint"] = text("[]", md5(H.dna.uni_identity)) G.fields["p_stat"] = "Active" G.fields["m_stat"] = "Stable" - M.fields["b_type"] = text("[]", H.b_type) + M.fields["b_type"] = text("[]", H.dna.b_type) M.fields["b_dna"] = H.dna.unique_enzymes M.fields["mi_dis"] = "None" M.fields["mi_dis_d"] = "No minor disabilities have been declared." @@ -505,7 +505,7 @@ Pod/Blast Doors computer L.fields["age"] = H.age L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") L.fields["rank"] = H.mind.assigned_role - L.fields["b_type"] = H.b_type + L.fields["b_type"] = H.dna.b_type L.fields["b_dna"] = H.dna.unique_enzymes L.fields["enzymes"] = H.dna.struc_enzymes L.fields["identity"] = H.dna.uni_identity diff --git a/code/game/machinery/scanner.dm b/code/game/machinery/scanner.dm index 857ed1dbbf..3488d1f610 100644 --- a/code/game/machinery/scanner.dm +++ b/code/game/machinery/scanner.dm @@ -46,7 +46,7 @@ obj/machinery/scanner/attack_hand(mob/living/carbon/human/user) lastuser = user.real_name var/mname = user.real_name var/dna = user.dna.unique_enzymes - var/bloodtype = user.b_type + var/bloodtype = user.dna.b_type var/fingerprint = md5(user.dna.uni_identity) var/list/marks = list() var/age = user.age diff --git a/code/game/magic/cultist/ritual.dm b/code/game/magic/cultist/ritual.dm index 65e7448421..919c535d74 100644 --- a/code/game/magic/cultist/ritual.dm +++ b/code/game/magic/cultist/ritual.dm @@ -555,8 +555,11 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", R.word2 = w2 R.word3 = w3 R.check_icon() - R.blood_DNA.len++ - R.blood_DNA[R.blood_DNA.len] = list(H.dna.unique_enzymes, H.b_type) + if(R.blood_DNA.len) + R.blood_DNA.len++ + R.blood_DNA[R.blood_DNA.len] = list(H.dna.unique_enzymes, H.dna.b_type) + else + R.blood_DNA = list(list(H.dna.unique_enzymes, H.dna.b_type)) return else user << "The book seems full of illegible scribbles. Is this a joke?" @@ -601,8 +604,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", var/obj/effect/rune/R = new /obj/effect/rune if(istype(user, /mob/living/carbon/human)) var/mob/living/carbon/human/H = user - R.blood_DNA.len++ - R.blood_DNA[R.blood_DNA.len] = list(H.dna.unique_enzymes, H.b_type) + R.blood_DNA = list(list(H.dna.unique_enzymes, H.dna.b_type)) switch(r) if("teleport") var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") diff --git a/code/game/objects/devices/scanners.dm b/code/game/objects/devices/scanners.dm index 01462387d2..2d3f8b6c6a 100644 --- a/code/game/objects/devices/scanners.dm +++ b/code/game/objects/devices/scanners.dm @@ -119,6 +119,7 @@ MASS SPECTROMETER F.fingerprints = md5(M.dna.uni_identity) F.icon_state = "fingerprint1" F.name = text("FPrintC- '[M.name]'") + user << "\blue Done printing." user << text("\blue [M]'s Fingerprints: [md5(M.dna.uni_identity)]") if ( !(M.blood_DNA) ) @@ -126,7 +127,7 @@ MASS SPECTROMETER else user << "\blue Blood found on [M]. Analysing..." spawn(15) - for(var/i = 1, i < M.blood_DNA.len, i++) + for(var/i = 1, i <= M.blood_DNA.len, i++) var/list/templist = M.blood_DNA[i] user << "\blue Blood type: [templist[2]]\nDNA: [templist[1]]" return diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 6c906ea1b8..bb3507561d 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -1,8 +1,8 @@ /mob/living/carbon/human/emote(var/act,var/m_type=1,var/message = null) var/param = null - if (findtext(act, "-", 1, null)) - var/t1 = findtext(act, "-", 1, null) + if (findtext(act, " ", 1, null)) + var/t1 = findtext(act, " ", 1, null) param = copytext(act, t1 + 1, length(act) + 1) act = copytext(act, 1, t1) @@ -50,22 +50,33 @@ m_type = 1 if ("custom") - var/input = input("Choose an emote to display.") as text|null - if (!input) - return - input = sanitize(input) - var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable") - if (input2 == "Visible") + m_type = 0 + if(copytext(param,1,2) == "v") m_type = 1 - else if (input2 == "Hearable") - if (src.miming) - return + else if(copytext(param,1,2) == "h") m_type = 2 else - alert("Unable to use this emote, must be either hearable or visible.") + var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable") + if (input2 == "Visible") + m_type = 1 + else if (input2 == "Hearable") + m_type = 2 + else + alert("Unable to use this emote, must be either hearable or visible.") + return + if(m_type) + param = trim(copytext(param,2)) + else + param = trim(param) + var/input + if(!param) + input = input("Choose an emote to display.") as text|null + else + input = param + if(input) + message = "[src] [input]" + else return - message = "[src] [input]" - if ("me") if(silent) return @@ -186,6 +197,20 @@ message = "[src] makes a weak noise." m_type = 2 + if ("breathe") + message = "[src] breathes." + m_type = 1 + holdbreath = 0 + + if ("stopbreath") + message = "[src] stops breathing..." + m_type = 1 + + if ("holdbreath") + message = "[src] stops breathing..." + m_type = 1 + holdbreath = 1 + if ("deathgasp") message = "[src] seizes up and falls limp, \his eyes dead and lifeless..." m_type = 1 diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 78ba469142..dcd3740215 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -121,7 +121,7 @@ if (src.stat == 1 || stat == 2) usr << "\red [name] doesn't seem to be responding to anything around [t_him], [t_his] eyes closed as though asleep." - if(health < 0 && distance <= 3) + if((!isbreathing || holdbreath) && distance <= 3) usr << "\red [name] does not appear to be breathing." if(istype(usr, /mob/living/carbon/human) && usr.stat == 0 && src.stat == 1 && distance <= 1) for(var/mob/O in viewers(usr.loc, null)) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 8781017873..86cd2b9d4f 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -21,7 +21,7 @@ var/b_eyes = 0.0 var/s_tone = 0.0 var/age = 30.0 - var/b_type +// var/b_type var/obj/item/clothing/suit/wear_suit = null var/obj/item/clothing/under/w_uniform = null diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 5a551dd5fd..ec5db3871c 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -10,6 +10,8 @@ // used to do some stuff only on every X life tick life_tick = 0 + isbreathing = 1 + holdbreath = 0 /mob/living/carbon/human/Life() set invisibility = 0 @@ -272,16 +274,37 @@ var/datum/air_group/breath // HACK NEED CHANGING LATER if(health < config.health_threshold_dead) - losebreath++ + isbreathing = 0 + spawn emote("stopbreath") - if(losebreath>0 && prob(90)) //Suffocating so do not take a breath - losebreath-- - if (prob(75)) //High chance of gasping for air - spawn emote("gasp") + if(holdbreath) + isbreathing = 0 + + if(isbreathing) + // are we running out of air in our lungs? + if(losebreath > 0) + // inaprovaline prevents the need to breathe for a while + if(reagents.has_reagent("inaprovaline")) + losebreath = 0 + else + // we're running out of air, gasp for it! + if (prob(25)) //High chance of gasping for air + spawn emote("gasp") + else if(health >= 0) + if(holdbreath) + // we're simply holding our breath, see if we can hold it longer + if(health < 30) + holdbreath = 0 + isbreathing = 1 + spawn emote("custom h inhales sharply.") + else + isbreathing = 1 + emote("breathe") + else if(istype(loc, /obj/)) var/obj/location_as_object = loc location_as_object.handle_internal_lifeform(src, 0) - else + if(isbreathing) //First, check for air from internal atmosphere (using an air tank and mask generally) breath = get_breath_from_internal(BREATH_VOLUME) // Super hacky -- TLE //breath = get_breath_from_internal(0.5) // Manually setting to old BREATH_VOLUME amount -- TLE diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 9b267e5885..5833e5a6c4 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -51,15 +51,15 @@ src << "To use something, simply double-click it." src << "Currently right-click functions will not work for the AI (except examine), and will either be replaced with dialogs or won't be usable by the AI." src << "Remember to adjust your camera network if you are having difficulty navigating the camera networks with the arrow keys or clicking on certain objects.
" - src << "
IMPORTANT GAMEPLAY ASPECTS:" - src << "1.) Act like an AI. If someone is breaking into your upload, say something like \"Alert. Unauthorised Access Detected: AI Upload.\" not \"Help! Urist is trying to subvert me!\"" - src << "2.) Do not watch the traitor like a hawk alerting the station to his/her every move. This relates to 1." - src << "3.) You are theoretically omniscient, but you should not be Beepsky 5000, laying down the law left and right. That is security's job. Instead, try to keep the station productive and effective. (Feel free to report the location of major violence and crimes and all that, just do not be the evil thing looking over peoples shoulders)" - src << "
We want everyone to have a good time, so we, the admins, will try to correct you if you stray from these rules. Just try to keep it sensible." if (!(ticker && ticker.mode && (mind in ticker.mode.malf_ai))) show_laws() src << "These laws may be changed by other players, or by you being the traitor." + src << "
IMPORTANT GAMEPLAY ASPECTS:" + src << "1.) Act like an AI. If someone is breaking into your upload, say something like \"Alert. Unauthorised Access Detected: AI Upload.\" not \"Help! Urist is trying to subvert me!\"" + src << "2.) Do not watch the traitor like a hawk alerting the station to his/her every move. This relates to 1." + src << "3.) You are theoretically omniscient, but you should not be Beepsky 5000, laying down the law left and right. That is security's job. Instead, try to keep the station productive and effective. (Feel free to report the location of major violence and crimes and all that, just do not be the evil thing looking over peoples shoulders)" + src << "
We want everyone to have a good time, so we, the admins, will try to correct you if you stray from these rules. Just try to keep it sensible." job = "AI" spawn(0) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 601f0cc256..95aadff89b 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -119,6 +119,12 @@ if (!(ticker && ticker.mode && (O.mind in ticker.mode.malf_ai))) O.show_laws() O << "These laws may be changed by other players, or by you being the traitor." + O << "
IMPORTANT GAMEPLAY ASPECTS:" + O << "1.) Act like an AI. If someone is breaking into your upload, say something like \"Alert. Unauthorised Access Detected: AI Upload.\" not \"Help! Urist is trying to subvert me!\"" + O << "2.) Do not watch the traitor like a hawk alerting the station to his/her every move. This relates to 1." + O << "3.) You are theoretically omniscient, but you should not be Beepsky 5000, laying down the law left and right. That is security's job. Instead, try to keep the station productive and effective. (Feel free to report the location of major violence and crimes and all that, just do not be the evil thing looking over peoples shoulders)" + O << "
We want everyone to have a good time, so we, the admins, will try to correct you if you stray from these rules. Just try to keep it sensible." + O.verbs += /mob/living/silicon/ai/proc/ai_call_shuttle O.verbs += /mob/living/silicon/ai/proc/show_laws_verb