mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-03 22:13:50 +00:00
Merge branch 'master' of git://github.com/Baystation12/Baystation12
Conflicts: code/game/objects/items/weapons/papers_bins.dm code/game/objects/items/weapons/uplinks.dm
This commit is contained in:
152
code/WorkInProgress/Tastyfish/Eliza.dm
Normal file
152
code/WorkInProgress/Tastyfish/Eliza.dm
Normal file
@@ -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
|
||||
430
code/WorkInProgress/Tastyfish/Eliza_Data.dm
Normal file
430
code/WorkInProgress/Tastyfish/Eliza_Data.dm
Normal file
@@ -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 += "<i><b>← From [eliza.callsign]:</b></i><br>[object]<br>"
|
||||
|
||||
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("<i>Intercepted message from <b>[who]</b>: [object]</i>")
|
||||
|
||||
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)
|
||||
18
code/WorkInProgress/Tastyfish/Parser.dm
Normal file
18
code/WorkInProgress/Tastyfish/Parser.dm
Normal file
@@ -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()
|
||||
28
code/WorkInProgress/Tastyfish/paiLiza.dm
Normal file
28
code/WorkInProgress/Tastyfish/paiLiza.dm
Normal file
@@ -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()
|
||||
@@ -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
|
||||
|
||||
@@ -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 += "<BR>Antibodies: [code]"
|
||||
dat += "<BR><A href='?src=\ref[src];antibody=1'>Begin antibody production</a>"
|
||||
else
|
||||
dat += "<BR>Please check container contents."
|
||||
|
||||
Reference in New Issue
Block a user