mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-06-29 17:24:40 +01:00
326 lines
11 KiB
Plaintext
326 lines
11 KiB
Plaintext
/mob/living/silicon
|
|
gender = NEUTER
|
|
robot_talk_understand = 1
|
|
voice_name = "synthesized voice"
|
|
var/syndicate = 0
|
|
var/datum/ai_laws/laws = null//Now... THEY ALL CAN ALL HAVE LAWS
|
|
var/list/alarms_to_show = list()
|
|
var/list/alarms_to_clear = list()
|
|
var/list/hud_list[10]
|
|
var/list/speech_synthesizer_langs = list() //which languages can be vocalized by the speech synthesizer
|
|
var/list/alarm_types_show = list("Motion" = 0, "Fire" = 0, "Atmosphere" = 0, "Power" = 0, "Camera" = 0)
|
|
var/list/alarm_types_clear = list("Motion" = 0, "Fire" = 0, "Atmosphere" = 0, "Power" = 0, "Camera" = 0)
|
|
var/designation = ""
|
|
var/obj/item/device/camera/siliconcam/aiCamera = null //photography
|
|
//Used in say.dm, allows for pAIs to have different say flavor text, as well as silicons, although the latter is not implemented.
|
|
var/speak_statement = "states"
|
|
var/speak_exclamation = "declares"
|
|
var/speak_query = "queries"
|
|
var/pose //Yes, now AIs can pose too.
|
|
var/sensor_mode = 0 //Determines the current HUD.
|
|
#define SEC_HUD 1 //Security HUD mode
|
|
#define MED_HUD 2 //Medical HUD mode
|
|
var/local_transmit //If set, can only speak to others of the same type within a short range.
|
|
var/obj/item/device/radio/common_radio
|
|
|
|
/mob/living/silicon/proc/cancelAlarm()
|
|
return
|
|
|
|
/mob/living/silicon/proc/triggerAlarm()
|
|
return
|
|
|
|
/mob/living/silicon/proc/show_laws()
|
|
return
|
|
|
|
/mob/living/silicon/proc/queueAlarm(var/message, var/type, var/incoming = 1)
|
|
var/in_cooldown = (alarms_to_show.len > 0 || alarms_to_clear.len > 0)
|
|
if(incoming)
|
|
alarms_to_show += message
|
|
alarm_types_show[type] += 1
|
|
else
|
|
alarms_to_clear += message
|
|
alarm_types_clear[type] += 1
|
|
|
|
if(!in_cooldown)
|
|
spawn(10 * 10) // 10 seconds
|
|
|
|
if(alarms_to_show.len < 5)
|
|
for(var/msg in alarms_to_show)
|
|
src << msg
|
|
else if(alarms_to_show.len)
|
|
|
|
var/msg = "--- "
|
|
|
|
if(alarm_types_show["Motion"])
|
|
msg += "MOTION: [alarm_types_show["Motion"]] alarms detected. - "
|
|
|
|
if(alarm_types_show["Fire"])
|
|
msg += "FIRE: [alarm_types_show["Fire"]] alarms detected. - "
|
|
|
|
if(alarm_types_show["Atmosphere"])
|
|
msg += "ATMOSPHERE: [alarm_types_show["Atmosphere"]] alarms detected. - "
|
|
|
|
if(alarm_types_show["Power"])
|
|
msg += "POWER: [alarm_types_show["Power"]] alarms detected. - "
|
|
|
|
if(alarm_types_show["Camera"])
|
|
msg += "CAMERA: [alarm_types_show["Power"]] alarms detected. - "
|
|
|
|
msg += "<A href=?src=\ref[src];showalerts=1'>\[Show Alerts\]</a>"
|
|
src << msg
|
|
|
|
if(alarms_to_clear.len < 3)
|
|
for(var/msg in alarms_to_clear)
|
|
src << msg
|
|
|
|
else if(alarms_to_clear.len)
|
|
var/msg = "--- "
|
|
|
|
if(alarm_types_clear["Motion"])
|
|
msg += "MOTION: [alarm_types_clear["Motion"]] alarms cleared. - "
|
|
|
|
if(alarm_types_clear["Fire"])
|
|
msg += "FIRE: [alarm_types_clear["Fire"]] alarms cleared. - "
|
|
|
|
if(alarm_types_clear["Atmosphere"])
|
|
msg += "ATMOSPHERE: [alarm_types_clear["Atmosphere"]] alarms cleared. - "
|
|
|
|
if(alarm_types_clear["Power"])
|
|
msg += "POWER: [alarm_types_clear["Power"]] alarms cleared. - "
|
|
|
|
if(alarm_types_show["Camera"])
|
|
msg += "CAMERA: [alarm_types_show["Power"]] alarms detected. - "
|
|
|
|
msg += "<A href=?src=\ref[src];showalerts=1'>\[Show Alerts\]</a>"
|
|
src << msg
|
|
|
|
|
|
alarms_to_show = list()
|
|
alarms_to_clear = list()
|
|
for(var/i = 1; i < alarm_types_show.len; i++)
|
|
alarm_types_show[i] = 0
|
|
for(var/i = 1; i < alarm_types_clear.len; i++)
|
|
alarm_types_clear[i] = 0
|
|
|
|
/mob/living/silicon/drop_item()
|
|
return
|
|
|
|
/mob/living/silicon/emp_act(severity)
|
|
switch(severity)
|
|
if(1)
|
|
src.take_organ_damage(20)
|
|
Stun(8)
|
|
if(2)
|
|
src.take_organ_damage(10)
|
|
Stun(3)
|
|
flick("noise", src:flash)
|
|
src << "\red <B>*BZZZT*</B>"
|
|
src << "\red Warning: Electromagnetic pulse detected."
|
|
..()
|
|
|
|
/mob/living/silicon/stun_effect_act(var/stun_amount, var/agony_amount)
|
|
return //immune
|
|
|
|
/mob/living/silicon/proc/damage_mob(var/brute = 0, var/fire = 0, var/tox = 0)
|
|
return
|
|
|
|
/mob/living/silicon/can_inject(var/mob/user, var/error_msg)
|
|
if(error_msg)
|
|
user << "<span class='alert'>Their outer shell is too tough.</span>"
|
|
return 0
|
|
|
|
/mob/living/silicon/IsAdvancedToolUser()
|
|
return 1
|
|
|
|
/mob/living/silicon/bullet_act(var/obj/item/projectile/Proj)
|
|
|
|
|
|
if(!Proj.nodamage)
|
|
switch(Proj.damage_type)
|
|
if(BRUTE)
|
|
adjustBruteLoss(Proj.damage)
|
|
if(BURN)
|
|
adjustFireLoss(Proj.damage)
|
|
|
|
Proj.on_hit(src,2)
|
|
|
|
return 2
|
|
|
|
/mob/living/silicon/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0)
|
|
return 0//The only effect that can hit them atm is flashes and they still directly edit so this works for now
|
|
/*
|
|
if(!effect || (blocked >= 2)) return 0
|
|
switch(effecttype)
|
|
if(STUN)
|
|
stunned = max(stunned,(effect/(blocked+1)))
|
|
if(WEAKEN)
|
|
weakened = max(weakened,(effect/(blocked+1)))
|
|
if(PARALYZE)
|
|
paralysis = max(paralysis,(effect/(blocked+1)))
|
|
if(IRRADIATE)
|
|
radiation += min((effect - (effect*getarmor(null, "rad"))), 0)//Rads auto check armor
|
|
if(STUTTER)
|
|
stuttering = max(stuttering,(effect/(blocked+1)))
|
|
if(EYE_BLUR)
|
|
eye_blurry = max(eye_blurry,(effect/(blocked+1)))
|
|
if(DROWSY)
|
|
drowsyness = max(drowsyness,(effect/(blocked+1)))
|
|
updatehealth()
|
|
return 1*/
|
|
|
|
/proc/islinked(var/mob/living/silicon/robot/bot, var/mob/living/silicon/ai/ai)
|
|
if(!istype(bot) || !istype(ai))
|
|
return 0
|
|
if (bot.connected_ai == ai)
|
|
return 1
|
|
return 0
|
|
|
|
|
|
// this function shows the health of the pAI in the Status panel
|
|
/mob/living/silicon/proc/show_system_integrity()
|
|
if(!src.stat)
|
|
stat(null, text("System integrity: [round((health/maxHealth)*100)]%"))
|
|
else
|
|
stat(null, text("Systems nonfunctional"))
|
|
|
|
|
|
// This is a pure virtual function, it should be overwritten by all subclasses
|
|
/mob/living/silicon/proc/show_malf_ai()
|
|
return 0
|
|
|
|
|
|
// this function displays the station time in the status panel
|
|
/mob/living/silicon/proc/show_station_time()
|
|
stat(null, "Station Time: [worldtime2text()]")
|
|
|
|
|
|
// this function displays the shuttles ETA in the status panel if the shuttle has been called
|
|
/mob/living/silicon/proc/show_emergency_shuttle_eta()
|
|
if(emergency_shuttle)
|
|
var/eta_status = emergency_shuttle.get_status_panel_eta()
|
|
if(eta_status)
|
|
stat(null, eta_status)
|
|
|
|
|
|
|
|
// This adds the basic clock, shuttle recall timer, and malf_ai info to all silicon lifeforms
|
|
/mob/living/silicon/Stat()
|
|
..()
|
|
statpanel("Status")
|
|
if (src.client.statpanel == "Status")
|
|
show_station_time()
|
|
show_emergency_shuttle_eta()
|
|
show_system_integrity()
|
|
show_malf_ai()
|
|
|
|
//Silicon mob language procs
|
|
|
|
/mob/living/silicon/can_speak(datum/language/speaking)
|
|
return universal_speak || (speaking in src.speech_synthesizer_langs) //need speech synthesizer support to vocalize a language
|
|
|
|
/mob/living/silicon/add_language(var/language, var/can_speak=1)
|
|
if (..(language) && can_speak)
|
|
speech_synthesizer_langs.Add(all_languages[language])
|
|
return 1
|
|
|
|
/mob/living/silicon/remove_language(var/rem_language)
|
|
..(rem_language)
|
|
|
|
for (var/datum/language/L in speech_synthesizer_langs)
|
|
if (L.name == rem_language)
|
|
speech_synthesizer_langs -= L
|
|
|
|
/mob/living/silicon/check_languages()
|
|
set name = "Check Known Languages"
|
|
set category = "IC"
|
|
set src = usr
|
|
|
|
var/dat = "<b><font size = 5>Known Languages</font></b><br/><br/>"
|
|
|
|
if(default_language)
|
|
dat += "Current default language: [default_language] - <a href='byond://?src=\ref[src];default_lang=reset'>reset</a><br/><br/>"
|
|
|
|
for(var/datum/language/L in languages)
|
|
if(!(L.flags & NONGLOBAL))
|
|
var/default_str
|
|
if(L == default_language)
|
|
default_str = " - default - <a href='byond://?src=\ref[src];default_lang=reset'>reset</a>"
|
|
else
|
|
default_str = " - <a href='byond://?src=\ref[src];default_lang=[L]'>set default</a>"
|
|
|
|
var/synth = (L in speech_synthesizer_langs)
|
|
dat += "<b>[L.name] (:[L.key])</b>[synth ? default_str : null]<br/>Speech Synthesizer: <i>[synth ? "YES" : "NOT SUPPORTED"]</i><br/>[L.desc]<br/><br/>"
|
|
|
|
src << browse(dat, "window=checklanguage")
|
|
return
|
|
|
|
// this function displays the stations manifest in a separate window
|
|
/mob/living/silicon/proc/show_station_manifest()
|
|
var/dat
|
|
dat += "<h4>Crew Manifest</h4>"
|
|
if(data_core)
|
|
dat += data_core.get_manifest(1) // make it monochrome
|
|
dat += "<br>"
|
|
src << browse(dat, "window=airoster")
|
|
onclose(src, "airoster")
|
|
|
|
/mob/living/silicon/Bump(atom/movable/AM as mob|obj, yes) //Allows the AI to bump into mobs if it's itself pushed
|
|
if ((!( yes ) || now_pushing))
|
|
return
|
|
now_pushing = 1
|
|
if(ismob(AM))
|
|
var/mob/tmob = AM
|
|
if(!(tmob.status_flags & CANPUSH))
|
|
now_pushing = 0
|
|
return
|
|
now_pushing = 0
|
|
..()
|
|
if (!istype(AM, /atom/movable))
|
|
return
|
|
if (!now_pushing)
|
|
now_pushing = 1
|
|
if (!AM.anchored)
|
|
var/t = get_dir(src, AM)
|
|
if (istype(AM, /obj/structure/window))
|
|
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
|
|
for(var/obj/structure/window/win in get_step(AM,t))
|
|
now_pushing = 0
|
|
return
|
|
step(AM, t)
|
|
now_pushing = null
|
|
|
|
/mob/living/silicon/assess_threat() //Secbots won't hunt silicon units
|
|
return -10
|
|
|
|
/mob/living/silicon/verb/pose()
|
|
set name = "Set Pose"
|
|
set desc = "Sets a description which will be shown when someone examines you."
|
|
set category = "IC"
|
|
|
|
pose = sanitize(copytext(input(usr, "This is [src]. It is...", "Pose", null) as text, 1, MAX_MESSAGE_LEN))
|
|
|
|
/mob/living/silicon/verb/set_flavor()
|
|
set name = "Set Flavour Text"
|
|
set desc = "Sets an extended description of your character's features."
|
|
set category = "IC"
|
|
|
|
flavor_text = sanitize(copytext(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text, 1))
|
|
|
|
/mob/living/silicon/binarycheck()
|
|
return 1
|
|
|
|
/mob/living/silicon/proc/toggle_sensor_mode()
|
|
var/sensor_type = input("Please select sensor type.", "Sensor Integration", null) in list("Security", "Medical","Disable")
|
|
switch(sensor_type)
|
|
if ("Security")
|
|
sensor_mode = SEC_HUD
|
|
src << "<span class='notice'>Security records overlay enabled.</span>"
|
|
if ("Medical")
|
|
sensor_mode = MED_HUD
|
|
src << "<span class='notice'>Life signs monitor overlay enabled.</span>"
|
|
if ("Disable")
|
|
sensor_mode = 0
|
|
src << "Sensor augmentations disabled."
|
|
|
|
/mob/living/silicon/IsAdvancedToolUser()
|
|
return 1 |