diff --git a/baystation12.dme b/baystation12.dme index dd97b7d5f2e..0790915ec24 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -142,8 +142,8 @@ #define FILE_DIR "code/WorkInProgress/Mini" #define FILE_DIR "code/WorkInProgress/organs" #define FILE_DIR "code/WorkInProgress/SkyMarshal" +#define FILE_DIR "code/WorkInProgress/Tastyfish" #define FILE_DIR "code/WorkInProgress/virus2" -#define FILE_DIR "code/WorkInProgress/Wrongnumber" #define FILE_DIR "html" #define FILE_DIR "icons" #define FILE_DIR "icons/effects" @@ -796,6 +796,7 @@ #include "code\modules\mob\living\say.dm" #include "code\modules\mob\living\blob\blob.dm" #include "code\modules\mob\living\carbon\carbon.dm" +#include "code\modules\mob\living\carbon\shock.dm" #include "code\modules\mob\living\carbon\alien\alien.dm" #include "code\modules\mob\living\carbon\alien\say.dm" #include "code\modules\mob\living\carbon\alien\humanoid\alien_powers.dm" @@ -985,6 +986,10 @@ #include "code\WorkInProgress\SkyMarshal\coatrack.dm" #include "code\WorkInProgress\SkyMarshal\eraser.dm" #include "code\WorkInProgress\SkyMarshal\policetape.dm" +#include "code\WorkInProgress\Tastyfish\Eliza.dm" +#include "code\WorkInProgress\Tastyfish\Eliza_Data.dm" +#include "code\WorkInProgress\Tastyfish\paiLiza.dm" +#include "code\WorkInProgress\Tastyfish\Parser.dm" #include "code\WorkInProgress\virus2\analyser.dm" #include "code\WorkInProgress\virus2\antibodies.dm" #include "code\WorkInProgress\virus2\base.dm" diff --git a/code/WorkInProgress/Tastyfish/Eliza.dm b/code/WorkInProgress/Tastyfish/Eliza.dm new file mode 100644 index 00000000000..8ebd7236222 --- /dev/null +++ b/code/WorkInProgress/Tastyfish/Eliza.dm @@ -0,0 +1,152 @@ +// Contains: +// /datum/text_parser/parser/eliza +// /datum/text_parser/keyword + +/datum/text_parser/parser/eliza + //var/datum/text_parser/reply/replies[] // R(X) 36 + var/prev_reply = "" // previous reply + var/username = "" + var/callsign = "" + var/yesno_state = "" + var/yesno_param = "" + +/datum/text_parser/parser/eliza/new_session() + ..() + for(var/datum/text_parser/keyword/key in keywords) + key.eliza = src + + prev_reply = "" + username = "" + yesno_state = "" + yesno_param = "" + print("Hi! I'm [callsign], how are you doing?") + +/datum/text_parser/parser/eliza/process_line() + ..() + // pad so we can detect initial and final words correctly + input_line = " " + src.input_line + " " + // remove apostrophes + for(var/i = -1, i != 0, i = findtext(input_line, "'")) + if(i == -1) + continue + input_line = copytext(input_line, 1, i) + copytext(input_line, i + 1, 0) + + // did user insult us? (i don't really want cursing in the source code, + // so keep it the simple original check from the 70's code :p) + if(findtext(input_line, "shut")) + // sssh + return + + if(input_line == prev_reply) + print("Please don't repeat yourself!") + + // find a keyword + var/keyphrase = "" + var/datum/text_parser/keyword/keyword // the actual keyword + var/keypos = 0 // pos of keyword so we can grab extra text after it + + for(var/i = 1, i <= keywords.len, i++) + keyword = keywords[i] + for(var/j = 1, j <= keyword.phrases.len, j++) + keypos = findtext(input_line, " " + keyword.phrases[j]) + if(keypos != 0) + // found it! + keyphrase = keyword.phrases[j] + break + if(keyphrase != "") + break + + //world << "keyphrase: " + keyphrase + " " + num2text(keypos) + + var/conjugated = "" + // was it not recognized? then make it nokeyfound + if(keyphrase == "") + keyword = keywords[keywords.len] // nokeyfound + else + // otherwise, business as usual + + // let's conjugate this mess + conjugated = copytext(input_line, 1 + keypos + lentext(keyphrase)) + + // go ahead and strip punctuation + if(lentext(conjugated) > 0 && copytext(conjugated, lentext(conjugated)) == " ") + conjugated = copytext(conjugated, 1, lentext(conjugated)) + if(lentext(conjugated) > 0) + var/final_punc = copytext(conjugated, lentext(conjugated)) + if(final_punc == "." || final_punc == "?" || final_punc == "!") + conjugated = copytext(conjugated, 1, lentext(conjugated)) + + conjugated += " " + + if(keyword.conjugate) + // now run through conjugation pairs + for(var/i = 1, i <= lentext(conjugated), i++) + for(var/x = 1, x <= conjugs.len, x += 2) + var/cx = conjugs[x] + var/cxa = conjugs[x + 1] + if(i + lentext(cx) <= lentext(conjugated) + 1 && cmptext(cx, copytext(conjugated, i, i + lentext(cx)))) + // world << cx + + conjugated = copytext(conjugated, 1, i) + cxa + copytext(conjugated, i + lentext(cx)) + i = i + lentext(cx) + // don't count right padding + if(copytext(cx, lentext(cx)) == " ") + i-- + break + else if(i + lentext(cxa) <= lentext(conjugated) + 1 && cmptext(cxa, copytext(conjugated, i, i + lentext(cxa)))) + // world << cxa + + conjugated = copytext(conjugated, 1, i) + cx + copytext(conjugated, i + lentext(cxa)) + i = i + lentext(cxa) + // don't count right padding + if(copytext(cxa, lentext(cxa)) == " ") + i-- + break + + conjugated = copytext(conjugated, 1, lentext(conjugated)) + + //world << "Conj: " + conjugated + + // now actually get a reply + var/reply = keyword.process(conjugated) + print(reply) + + prev_reply = reply + +/datum/text_parser/keyword + var/list/phrases = new() + var/list/replies = new() + var/datum/text_parser/parser/eliza/eliza + var/conjugate = 1 + + New(p, r) + phrases = p + replies = r + + proc/process(object) + eliza.yesno_state = "" + eliza.yesno_param = "" + var/reply = pick(replies) + if(copytext(reply, lentext(reply)) == "*") + // add object of statement (hopefully not actually mess :p) + if(object == "") + object = pick(generic_objects) + // possibly add name or just ? + if(eliza.username != "" && rand(3) == 0) + object += ", " + eliza.username + return copytext(reply, 1, lentext(reply)) + object + "?" + else + // get punct + var/final_punc = "" + if(lentext(reply) > 0) + final_punc = copytext(reply, lentext(reply)) + if(final_punc == "." || final_punc == "?" || final_punc == "!") + reply = copytext(reply, 1, lentext(reply)) + else + final_punc = "" + + // possibly add name or just ?/./! + if(eliza.username != "" && rand(2) == 0) + reply += ", " + eliza.username + + return reply + final_punc diff --git a/code/WorkInProgress/Tastyfish/Eliza_Data.dm b/code/WorkInProgress/Tastyfish/Eliza_Data.dm new file mode 100644 index 00000000000..3537c73c2cc --- /dev/null +++ b/code/WorkInProgress/Tastyfish/Eliza_Data.dm @@ -0,0 +1,430 @@ +// Contains: +// Implementation-specific data for /datum/text_parser/parser/eliza + +/datum/text_parser/keyword + // if we have a * reply, but no object from the user + var/list/generic_objects = list( + " what", " something", "...") + + var/list/object_leaders = list( + " is ", "'s ") + +/datum/text_parser/parser/eliza + + // conjugation data + var/list/conjugs = list( + " are ", " am ", " were ", " was ", " you ", " me ", " you ", " i " , " your ", " my ", + " ive ", " youve ", " Im ", " youre ") + + // keywords / replies + var/list/keywords = list( + new/datum/text_parser/keyword/tell( // NT-like + list("tell"), + list( + "Told *")), + new/datum/text_parser/keyword( + list("can you"), + list( + "Dont you believe that I can*", + "Perhaps you would like to be able to*", + "You want me to be able to*")), + new/datum/text_parser/keyword( + list("can i"), + list( + "Perhaps you don't want to*", + "Do you want to be able to*")), + new/datum/text_parser/keyword( + list("you are", "youre"), + list( + "What makes you think I am*", + "Does it please you to believe that I am*", + "Perhaps you would like to be*", + "Do you sometimes wish you were*")), + new/datum/text_parser/keyword( + list("i dont"), + list( + "Don't you really*", + "Why don't you*", + "Do you wish to be able to*", + "Does that trouble you?")), + new/datum/text_parser/keyword( + list("i feel"), + list( + "Tell me more about such feelings.", + "Do you often feel*", + "Do you enjoy feeling*")), + new/datum/text_parser/keyword( + list("why dont you"), + list( + "Do you really believe I don't*", + "Perhaps in good time I will*", + "Do you want me to*")), + new/datum/text_parser/keyword( + list("why cant i"), + list( + "Do you think you should be able to*", + "Why can't you*")), + new/datum/text_parser/keyword( + list("are you"), + list( + "Why are you interested in whether or not I am*", + "Would you prefer if I were not*", + "Perhaps in your fantasies I am*")), + new/datum/text_parser/keyword( + list("i cant"), + list( + "How do you know I can't*", + "Have you tried?", + "Perhaps you can now*")), + new/datum/text_parser/keyword/setparam/username( + list("my name", "im called", "am called", "call me"), + list( + "Your name is *", + "You call yourself *", + "You're called *")), + new/datum/text_parser/keyword/setparam/callsign( + list("your name", "call yourself"), + list( + "My name is *", + "I call myself *", + "I'm called *")), + new/datum/text_parser/keyword( + list("i am", "im"), + list( + "Did you come to me because you are*", + "How long have you been*", + "Do you believe it is normal to be*", + "Do you enjoy being*")), + new/datum/text_parser/keyword( + list("thanks", "thank you"), + list( + "You're welcome.", + "No problem.", + "Thank you!")), + new/datum/text_parser/keyword( + list("you"), + list( + "We were discussing you - not me.", + "Oh, I*", + "You're not really talking about me, are you?")), + new/datum/text_parser/keyword( + list("i want"), + list( + "What would it mean if you got*", + "Why do you want*", + "Suppose you got*", + "What if you never got*", + "I sometimes also want*")), + new/datum/text_parser/keyword( + list("what", "how", "who", "where", "when", "why"), + list( + "Why do you ask?", + "Does that question interest you?", + "What answer would please you the most?", + "What do you think?", + "Are such questions on your mind often?", + "What is it you really want to know?", + "Have you asked anyone else?", + "Have you asked such questions before?", + "What else comes to mind when you ask that?")), + new/datum/text_parser/keyword/paramlist/pick( // NT-like + list("pick","choose"), + list( + "I choose... *", + "I prefer *", + "My favorite is *")), + new/datum/text_parser/keyword( + list("name"), + list( + "Names don't interest me.", + "I don't care about names. Go on.")), + new/datum/text_parser/keyword( + list("cause"), + list( + "Is that a real reason?", + "Don't any other reasons come to mind?", + "Does that reason explain anything else?", + "What other reason might there be?")), + new/datum/text_parser/keyword( + list("sorry"), + list( + "Please don't apologize.", + "Apologies are not necessary.", + "What feelings do you get when you apologize?", + "Don't be so defensive!")), + new/datum/text_parser/keyword( + list("dream"), + list( + "What does that dream suggest to you?", + "Do you dream often?", + "What persons are in your dreams?", + "Are you disturbed by your dreams?")), + new/datum/text_parser/keyword( + list("hello", "hi", "yo", "hiya"), + list( + "How do you do... Please state your name and problem.")), + new/datum/text_parser/keyword( + list("go away", "bye"), + list( + "Good bye. I hope to have another session with you soon.")), + new/datum/text_parser/keyword( + list("maybe", "sometimes", "probably", "mostly", "most of the time"), + list( + "You don't seem quite certain.", + "Why the uncertain tone?", + "Can't you be more positive?", + "You aren't sure?", + "Don't you know?")), + new/datum/text_parser/keyword/no( + list("no", "nope", "nah"), + list( + "Are you saying that just to be negative?", + "You are being a bit negative.", + "Why not?", + "Are you sure?", + "Why no?")), + new/datum/text_parser/keyword( + list("your"), + list( + "Why are you concerned about my*", + "What about your own*")), + new/datum/text_parser/keyword( + list("always"), + list( + "Can you think of a specific example?", + "When?", + "What are you thinking of?", + "Really, always?")), + new/datum/text_parser/keyword( + list("think"), + list( + "Do you really think so?", + "But you're not sure you*", + "Do you doubt you*")), + new/datum/text_parser/keyword( + list("alike"), + list( + "In what way?", + "What resemblence do you see?", + "What does the similarity suggest to you?", + "What other connections do you see?", + "Count there really be some connection?", + "How?", + "You seem quite positive.")), + new/datum/text_parser/keyword/yes( + list("yes", "yep", "yeah", "indeed"), + list( + "Are you sure?", + "I see.", + "I understand.")), + new/datum/text_parser/keyword( + list("friend"), + list( + "Why do you bring up the topic of friends?", + "Why do your friends worry you?", + "Do your friends pick on you?", + "Are you sure you have any friends?", + "Do you impose on your friends?", + "Perhaps your love for friends worries you?")), + new/datum/text_parser/keyword( + list("computer", "bot", "ai"), + list( + "Do computers worry you?", + "Are you talking about me in particular?", + "Are you frightened by machines?", + "Why do your mention computers?", + "What do you think computers have to do with your problem?", + "Don't you think computers can help people?", + "What is it about machines that worries you?")), + new/datum/text_parser/keyword( + list("murder", "death", "kill", "dead", "destroy", "traitor", "synd"), + list( + "Well, that's rather morbid.", + "Do you think that caused a trauma with you?", + "Have you ever previously spoken to anybody about this?")), + new/datum/text_parser/keyword( + list("bomb", "explosive", "toxin", "plasma"), + list( + "Do you worry about bombs often?", + "Do you work in toxins?", + "Do you find it odd to worry about bombs on a toxins research vessel?")), + new/datum/text_parser/keyword( + list("work", "job", "head", "staff", "transen"), + list( + "Do you like working here?", + "What are your feelings on working here?")), + new/datum/text_parser/keyword( + list("nokeyfound"), + list( + "Say, do you have any psychological problems?", + "What does that suggest to you?", + "I see.", + "I'm not sure I understand you fully.", + "Come elucidate on your thoughts.", + "Can you elaborate on that?", + "That is quite interesting."))) + +/datum/text_parser/keyword/setparam + proc/param(object) + + // drop leading parts + for(var/leader in object_leaders) + var/i = findtext(object, leader) + if(i) + object = copytext(object, i + lentext(leader)) + break + + // trim spaces + object = trim(object) + + // trim punctuation + if(lentext(object) > 0) + var/final_punc = copytext(object, lentext(object)) + if(final_punc == "." || final_punc == "?" || final_punc == "!") + object = copytext(object, 1, lentext(object)) + + return object + +/datum/text_parser/keyword/paramlist + proc/param(object) + // drop leading parts + for(var/leader in object_leaders) + var/i = findtext(object, leader) + if(i) + object = copytext(object, i + lentext(leader)) + break + + // trim spaces + object = trim(object) + + // trim punctuation + if(lentext(object) > 0) + var/final_punc = copytext(object, lentext(object)) + if(final_punc == "." || final_punc == "?" || final_punc == "!") + object = copytext(object, 1, lentext(object)) + + return dd_text2list(object, ",") + +/datum/text_parser/keyword/setparam/username + process(object) + object = param(object) + + // handle name + if(eliza.username == "") + // new name + var/t = ..(object) + eliza.yesno_state = "username" + eliza.yesno_param = object + return t + else if(cmptext(eliza.username, object)) + // but wait! + return "You already told me your name was [eliza.username]." + else + eliza.yesno_state = "username" + eliza.yesno_param = object + return "But you previously told me your name was [eliza.username]. Are you sure you want to be called [object]?" + +/datum/text_parser/keyword/setparam/callsign + process(object) + object = param(object) + + // handle name + if(eliza.callsign == "") + // new name + var/t = ..(object) + eliza.yesno_state = "callsign" + eliza.yesno_param = object + return t + else if(cmptext(eliza.callsign, object)) + // but wait! + return "You already told me that I should answer to [eliza.callsign]." + else + eliza.yesno_state = "callsign" + eliza.yesno_param = object + return "But you previously told me my name was [eliza.callsign]. Are you sure you want me to be called [object]?" + +/datum/text_parser/keyword/paramlist/pick + process(object) + var/choice = pick(param(object)) + return ..(choice) + +/datum/text_parser/keyword/tell + conjugate = 0 + + process(object) + // get name & message + var/i = findtext(object, " that ") + var/sl = 6 + if(!i || lentext(object) < i + sl) + i = findtext(object, ",") + sl = 1 + if(!i || lentext(object) < i + sl) + return "Tell who that you what?" + + var/name = trim(copytext(object, 1, i)) + object = trim(copytext(object, i + sl)) + if(!lentext(name) || !lentext(object)) + return "Tell who that you what?" + + // find PDA + var/obj/item/device/pda/pda + for (var/obj/item/device/pda/P in world) + if (!P.owner) + continue + else if (P.toff) + continue + + if(!cmptext(name, P.owner)) + continue + + pda = P + + if(!pda || pda.toff) + return "I couldn't find [name]'s PDA." + + // send message + pda.tnote += "← From [eliza.callsign]:
[object]
" + + if(prob(15) && eliza.speaker) //Give the AI a chance of intercepting the message + var/who = eliza.speaker + if(prob(50)) + who = "[eliza.speaker:master] via [eliza.speaker]" + for(var/mob/living/silicon/ai/ai in world) + ai.show_message("Intercepted message from [who]: [object]") + + if (!pda.silent) + playsound(pda.loc, 'twobeep.ogg', 50, 1) + for (var/mob/O in hearers(3, pda.loc)) + O.show_message(text("\icon[pda] *[pda.ttone]*")) + + pda.overlays = null + pda.overlays += image('pda.dmi', "pda-r") + + return "Told [name] that [object]." + +/datum/text_parser/keyword/yes + process(object) + var/reply + switch(eliza.yesno_state) + if("username") + eliza.username = eliza.yesno_param + reply = pick( + "[eliza.username] - that's a nice name.", + "Hello, [eliza.username]!", + "You sound nice.") + if("callsign") + eliza.callsign = eliza.yesno_param + eliza.set_name(eliza.callsign) + reply = pick( + "Oh, alright...", + "[eliza.callsign]... I like that.", + "OK!") + else + return ..(object) + eliza.yesno_state = "" + eliza.yesno_param = "" + return reply + +/datum/text_parser/keyword/no + process(object) + return ..(object) diff --git a/code/WorkInProgress/Tastyfish/Parser.dm b/code/WorkInProgress/Tastyfish/Parser.dm new file mode 100644 index 00000000000..0db2a261caa --- /dev/null +++ b/code/WorkInProgress/Tastyfish/Parser.dm @@ -0,0 +1,18 @@ +// Contains: +// /datum/text_parser/parser + +/datum/text_parser/parser + var/input_line = "" + var/mob/speaker + +/datum/text_parser/parser/proc/print(line) + speaker.say(line) + +/datum/text_parser/parser/proc/set_name(name) + speaker.name = name + speaker.real_name = name + +/datum/text_parser/parser/proc/new_session() + input_line = "" + +/datum/text_parser/parser/proc/process_line() diff --git a/code/WorkInProgress/Tastyfish/paiLiza.dm b/code/WorkInProgress/Tastyfish/paiLiza.dm new file mode 100644 index 00000000000..7cd9a034464 --- /dev/null +++ b/code/WorkInProgress/Tastyfish/paiLiza.dm @@ -0,0 +1,28 @@ +/datum/paiCandidate/chatbot + name = "NT Standard Chatbot" + description = "NT Standard Issue pAI Unit 13A" + role = "Advisor" + comments = "This is an actual AI." + ready = 1 + +/mob/living/silicon/pai/chatbot + var/datum/text_parser/parser/eliza/P = new() + + proc/init() + P.speaker = src + P.callsign = input("What do you want to call me?", "Chatbot Name", "NT") as text + P.set_name(P.callsign) + P.new_session() + + proc/hear_talk(mob/M, text) + if(stat) + return + + var/prefix = P.callsign + "," + + if(lentext(text) <= lentext(prefix)) + return + var/i = lentext(prefix) + 1 + if(cmptext(copytext(text, 1, i), prefix)) + P.input_line = html_decode(copytext(text, i)) + P.process_line() diff --git a/code/WorkInProgress/virus2/base.dm b/code/WorkInProgress/virus2/base.dm index 789bbddfdaa..598ee2d4f84 100644 --- a/code/WorkInProgress/virus2/base.dm +++ b/code/WorkInProgress/virus2/base.dm @@ -441,12 +441,6 @@ activate(var/mob/living/carbon/mob,var/multiplier) mob.brainloss = 20 -/datum/disease2/effect/lesser/drowsy - name = "Bedroom Syndrome" - stage = 2 - activate(var/mob/living/carbon/mob,var/multiplier) - mob.drowsyness = 5 - /datum/disease2/effect/lesser/deaf name = "Hard of hearing syndrome" stage = 3 diff --git a/code/WorkInProgress/virus2/curer.dm b/code/WorkInProgress/virus2/curer.dm index f4f53cff1b3..e5e0bc7f8d6 100644 --- a/code/WorkInProgress/virus2/curer.dm +++ b/code/WorkInProgress/virus2/curer.dm @@ -68,6 +68,9 @@ if(B) dat = "Blood sample inserted." + var/code = "" + for(var/V in ANTIGENS) if(text2num(V) & B.data["antibodies"]) code += ANTIGENS[V] + dat += "
Antibodies: [code]" dat += "
Begin antibody production" else dat += "
Please check container contents." diff --git a/code/defines/mob/living/carbon/carbon.dm b/code/defines/mob/living/carbon/carbon.dm index 3e8250b4b33..b34ef524275 100644 --- a/code/defines/mob/living/carbon/carbon.dm +++ b/code/defines/mob/living/carbon/carbon.dm @@ -5,7 +5,6 @@ var/brain_op_stage = 0.0 var/eye_op_stage = 0.0 var/appendix_op_stage = 0.0 - var/embryo_op_stage = 0.0 var/datum/disease2/disease/virus2 = null var/list/datum/disease2/disease/resistances2 = list() diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index bdea8513101..a40d1804805 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -1459,11 +1459,6 @@ icon_state = "stamp-hos" color = "hosred" -/obj/item/weapon/stamp/detective - name = "detective's rubber stamp" - icon_state = "stamp-hos" - color = "hosred" - /obj/item/weapon/stamp/ce name = "chief engineer's rubber stamp" icon_state = "stamp-ce" @@ -1522,7 +1517,7 @@ name = "d4" desc = "A dice with four sides." sides = 4 - icon_state = "dice" + icon_state = "d20" item_state = "dice" /obj/item/weapon/dice // -- TLE @@ -1714,4 +1709,4 @@ desc = "A container for hold compressed matter awaiting re-construction." origin_tech = "materials=5" rating = 3 - m_amt = 80 \ No newline at end of file + m_amt = 80 diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 1272ba40ff9..ac15717c1c6 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -12,7 +12,7 @@ icon_state = "pod_0" req_access = list(access_medlab) //For premature unlocking. var/mob/living/occupant - var/heal_level = 90 //The clone is released once its health reaches this level. + var/heal_level = 10 //The clone is released once its health reaches this level. var/locked = 0 var/obj/machinery/computer/cloning/connected = null //So we remember the connected clone machine. var/mess = 0 //Need to clean out it if it's full of exploded clone. diff --git a/code/game/objects/devices/paicard.dm b/code/game/objects/devices/paicard.dm index 0acb5bc2b52..05cdbbd2196 100644 --- a/code/game/objects/devices/paicard.dm +++ b/code/game/objects/devices/paicard.dm @@ -9,7 +9,7 @@ var/obj/item/device/radio/radio var/looking_for_personality = 0 var/mob/living/silicon/pai/pai - + var/datum/paiCandidate/chatbot/chatbot attack_self(mob/user) if (!in_range(src, user)) @@ -58,8 +58,19 @@ var/datum/dna/dna = usr.dna pai.master = M.real_name pai.master_dna = dna.unique_enzymes + if(istype(pai,/mob/living/silicon/pai/chatbot)) + if(istype(pai:P,/datum/text_parser/parser/eliza)) + var/datum/text_parser/parser/eliza/P = pai:P + P.yesno_state = "username" + P.yesno_param = M.real_name + P.input_line = "yes" + P.process_line() pai << "

You have been bound to a new master.

" if(href_list["request"]) + if(!looking_for_personality) + spawn(600) // wait a minute + chatbot = new() + alertUpdate() src.looking_for_personality = 1 paiController.findPAI(src, usr) if(href_list["wipe"]) @@ -76,6 +87,8 @@ var/t1 = text2num(href_list["wires"]) if (radio.wires & t1) radio.wires &= ~t1 + else + radio.wires |= t1 if(href_list["setlaws"]) var/newlaws = input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message if(newlaws) @@ -99,4 +112,10 @@ emp_act(severity) for(var/mob/M in src) M.emp_act(severity) - ..() \ No newline at end of file + ..() + + hear_talk(mob/M, text) + ..() + if(istype(pai, /mob/living/silicon/pai/chatbot)) + var/mob/living/silicon/pai/chatbot/C = pai + C.hear_talk(M, text) diff --git a/code/game/objects/items/weapons/uplinks.dm b/code/game/objects/items/weapons/uplinks.dm index 8a8b9fa3cc0..ecd247490ef 100644 --- a/code/game/objects/items/weapons/uplinks.dm +++ b/code/game/objects/items/weapons/uplinks.dm @@ -48,6 +48,7 @@ SYNDICATE UPLINK dat += "
" dat += "Freedom Implant (with injector) (3)
" // dat += "Paralysis Pen (3)
" //Note that this goes to the updated sleepypen now. + dat += "Sleepy Pen (4)
" //Terrible -Pete. //Reinstated -Skymarshal dat += "
" dat += "Detomatix Cartridge (3)
" @@ -197,10 +198,6 @@ SYNDICATE UPLINK if (src.uses >= 10) uses -= 10 new /obj/item/toy/syndicateballoon(get_turf(src)) - if("eraser") - if(uses) - uses -- - new /obj/item/weapon/stamperaser(get_turf(src)) else if (href_list["lock"] && src.origradio) // presto chango, a regular radio again! (reset the freq too...) shutdown_uplink() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index e67bc80f549..093e3b113cd 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -181,6 +181,8 @@ if (bodytemperature < 283.222) tally += (283.222 - bodytemperature) / 10 * 1.75 + if (shock_stage >= 10) tally += 3 + return tally /mob/living/carbon/human/Stat() @@ -2328,4 +2330,4 @@ It can still be worn/put on as normal. /mob/living/carbon/human/Paralyse(amount) if(mutations & HULK) return - ..() + ..() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 15adc1d1cae..59127f887c5 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -21,6 +21,9 @@ var/datum/gas_mixture/environment = loc.return_air() + // clean all symptoms, they must be set again in this cycle + src.disease_symptoms = 0 + if (stat != 2) //still breathing //First, resolve location and get a breath @@ -34,6 +37,8 @@ var/obj/location_as_object = loc location_as_object.handle_internal_lifeform(src, 0) + src.handle_shock() + //Apparently, the person who wrote this code designed it so that //blinded get reset each cycle and then get activated later in the //code. Very ugly. I dont care. Moving this stuff here so its easy @@ -992,9 +997,6 @@ for(var/datum/disease/D in viruses) D.cure() - // clean all the symptoms incurred by the virus - src.disease_symptoms = 0 - if(!virus2) // the following is silly since it lets you infect people through glass /*for(var/mob/living/carbon/M in oviewers(4,src)) @@ -1058,65 +1060,35 @@ if ((changeling.geneticdamage > 0)) changeling.geneticdamage = changeling.geneticdamage-1 -/* - // Commented out so hunger system won't be such shock - // Damage and effect from not eating - if(nutrition <= 50) - if (prob (0.1)) - src << "\red Your stomach rumbles." - if (prob (10)) - bruteloss++ - if (prob (5)) - src << "You feel very weak." - weakened += rand(2, 3) -*/ -/* -snippets + handle_shock() + ..() - if (mach) - if (machine) - mach.icon_state = "mach1" + if(traumatic_shock >= 80) + shock_stage += 1 else - mach.icon_state = null + shock_stage-- + shock_stage = max(shock_stage, 0) + return - if (!m_flag) - moved_recently = 0 - m_flag = null + if (shock_stage > 60) + if(shock_stage == 61) + for(var/mob/O in viewers(src, null)) + O.show_message("[src.name]'s body becomes limp.", 1) + Stun(20) + lying = 1 + disease_symptoms |= DISEASE_WHISPER - - - if ((istype(loc, /turf/space) && !( locate(/obj/movable, loc) ))) - var/layers = 20 - // ******* Check - if (((istype(head, /obj/item/clothing/head) && head.flags & 4) || (istype(wear_mask, /obj/item/clothing/mask) && (!( wear_mask.flags & 4 ) && wear_mask.flags & 8)))) - layers -= 5 - if (istype(w_uniform, /obj/item/clothing/under)) - layers -= 5 - if ((istype(wear_suit, /obj/item/clothing/suit) && wear_suit.flags & 8)) - layers -= 10 - if (layers > oxcheck) - oxcheck = layers - - - if(bodytemperature < 282.591 && (!firemut)) - if(bodytemperature < 250) - adjustFireLoss(4) - updatehealth() - if(paralysis <= 2) paralysis += 2 - else if(prob(1) && !paralysis) - if(paralysis <= 5) paralysis += 5 - emote("collapse") - src << "\red You collapse from the cold!" - if(bodytemperature > 327.444 && (!firemut)) - if(bodytemperature > 345.444) - if(!eye_blurry) src << "\red The heat blurs your vision!" - eye_blurry = max(4, eye_blurry) - if(prob(3)) adjustFireLoss(rand(1,2)) - else if(prob(3) && !paralysis) - paralysis += 2 - emote("collapse") - src << "\red You collapse from heat exaustion!" - plcheck = t_plasma - oxcheck = t_oxygen - G.turf_add(T, G.total_moles()) -*/ \ No newline at end of file + if (shock_stage > 70) if(shock_stage % 30 == 0) + Paralyse(rand(15,28)) + if(shock_stage >= 30) + if(shock_stage == 30) emote("me",1,"is having trouble keeping their eyes open.") + eye_blurry = max(2, eye_blurry) + stuttering = max(stuttering, 5) + bodytemperature = 313.15 // high fever + // pain messages + if(shock_stage == 10) + src << ""+pick("It hurts so much!", "You really need some painkillers..", "Dear god, the pain!") + else if(shock_stage == 40) + src << ""+pick("The pain is excrutiating!", "Please, just end the pain!", "Your whole body is going numb!") + else if(shock_stage == 80) + src << ""+pick("You see a light at the end of the tunnel!", "You feel like you could die any moment now.", "You're about to lose consciousness.") \ No newline at end of file diff --git a/code/modules/mob/living/carbon/shock.dm b/code/modules/mob/living/carbon/shock.dm new file mode 100644 index 00000000000..c3539233692 --- /dev/null +++ b/code/modules/mob/living/carbon/shock.dm @@ -0,0 +1,18 @@ +/mob/living/carbon/var/traumatic_shock = 0 +/mob/living/carbon/var/shock_stage = 0 + +// proc to find out in how much pain the mob is at the moment +/mob/living/carbon/proc/updateshock() + src.traumatic_shock = src.getOxyLoss() + src.getToxLoss() + src.getFireLoss() + 1.2*src.getBruteLoss() + 2*src.getCloneLoss() + if(reagents.has_reagent("alkysine")) + src.traumatic_shock -= 10 + if(reagents.has_reagent("inaprovaline")) + src.traumatic_shock -= 15 + if(reagents.has_reagent("synaptizine")) + src.traumatic_shock -= 50 + + return src.traumatic_shock + + +/mob/living/carbon/proc/handle_shock() + updateshock() diff --git a/code/modules/mob/living/silicon/pai/recruit.dm b/code/modules/mob/living/silicon/pai/recruit.dm index 31369de7aee..330be3c4838 100644 --- a/code/modules/mob/living/silicon/pai/recruit.dm +++ b/code/modules/mob/living/silicon/pai/recruit.dm @@ -11,8 +11,6 @@ var/datum/paiController/paiController // Global handler for pAI candidates comments ready = 0 - - /datum/paiController var/list/pai_candidates = list() var/list/asked = list() @@ -25,7 +23,14 @@ var/datum/paiController/paiController // Global handler for pAI candidates var/obj/item/device/paicard/card = locate(href_list["device"]) if(card.pai) return - if(istype(card,/obj/item/device/paicard) && istype(candidate,/datum/paiCandidate)) + if(istype(card,/obj/item/device/paicard) && istype(candidate,/datum/paiCandidate/chatbot)) + var/mob/living/silicon/pai/chatbot/pai = new(card) + pai.name = candidate.name + pai.real_name = pai.name + card.pai = pai + pai.init() + usr << browse(null, "window=findPai") + else if(istype(card,/obj/item/device/paicard) && istype(candidate,/datum/paiCandidate)) var/mob/living/silicon/pai/pai = new(card) pai.name = candidate.name pai.real_name = pai.name @@ -154,6 +159,12 @@ var/datum/paiController/paiController // Global handler for pAI candidates dat += "Preferred Role:[c.role]" dat += "OOC Comments:[c.comments]" dat += "\[Download [c.name]\]" + if(p.chatbot) + dat += "Name:[p.chatbot.name]" + dat += "Description:[p.chatbot.description]" + dat += "Preferred Role:[p.chatbot.role]" + dat += "OOC Comments:[p.chatbot.comments]" + dat += "\[Download [p.chatbot.name]\]" dat += "" diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 35c94e66cde..0056bb2a90c 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -883,6 +883,10 @@ Frequency: if (buckled) return + // borgs can't move with no power + if(!cell || !cell.charge) + return + if (restrained()) pulling = null diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 3c76a1a74db..e25605fd998 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -128,7 +128,7 @@ output += "
Lobby Music
" - src << browse(output,"window=playersetup;size=250x233;can_close=0") + src << browse(output,"window=playersetup;size=250x258;can_close=0") return proc/Playmusic()