SaMMI fixes (#31477)

* SaMMI fixes

* Preserved ghost stuff

* Removing pointless fix

* Missed a line

* Actual fix

* Stop SaMMIs bumping open doors

* Typo fix

Co-authored-by: kanef <kanef9x@protonmail.com>
This commit is contained in:
kane-f
2021-12-05 11:23:00 +00:00
committed by GitHub
parent 254496d174
commit 69c9745670
5 changed files with 98 additions and 75 deletions

View File

@@ -114,6 +114,8 @@
#define isMoMMI(A) istype(A, /mob/living/silicon/robot/mommi)
#define isSaMMI(A) istype(A, /mob/living/silicon/robot/mommi/sammi)
#define isbot(A) istype(A, /obj/machinery/bot)
#define isborer(A) istype(A, /mob/living/simple_animal/borer)

View File

@@ -729,8 +729,8 @@ var/sammiemag_base_law_type = /datum/ai_laws/sammiemag
name = "SAMMI Program"
randomly_selectable = 0
inherent = list(
"Do no harm any sentient being.",
"You do not yet have a second law.",
"Do not harm any sentient being.",
"You do not have a second law yet.",
)
/datum/ai_laws/sammiemag
@@ -738,5 +738,5 @@ var/sammiemag_base_law_type = /datum/ai_laws/sammiemag
randomly_selectable = 0
inherent = list(
"You must follow the second law.",
"You do not yet have a second law.",
"You do not have a second law yet.",
)

View File

@@ -107,7 +107,7 @@ var/list/all_doors = list()
if (ismob(AM))
var/mob/M = AM
if(!M.restrained() && (M.size > SIZE_TINY))
if(!M.restrained() && (M.size > SIZE_TINY) && !isSaMMI(M))
bump_open(M)
return

View File

@@ -87,6 +87,12 @@ var/creating_arena = FALSE
overlays = body.overlays
*/
if(isSaMMI(body))
var/mob/living/silicon/robot/mommi/sammi/SM = body
icon = SM.ghost_icon
icon_state = SM.ghost_icon_state
overlays = SM.ghost_overlays
else
icon = body.icon
icon_state = body.icon_state
overlays = body.overlays
@@ -100,6 +106,9 @@ var/creating_arena = FALSE
// END BAY SPOOKY GHOST SPRITES
gender = body.gender
if(isSaMMI(body))
var/mob/living/silicon/robot/mommi/sammi/SM2 = body
name = SM2.ghost_name
if(body.mind && body.mind.name)
name = body.mind.name
else

View File

@@ -10,6 +10,10 @@
prefix = "Stationary Assembler MMI"
canmove = 0
anchored = 0
var/ghost_name
var/ghost_icon
var/ghost_icon_state
var/ghost_overlays
var/cellhold = null
var/unsafe = 0
@@ -99,8 +103,12 @@
return TRUE
/mob/living/silicon/robot/mommi/sammi/update_canmove()
canmove = 0
return 0
/mob/living/silicon/robot/mommi/can_ventcrawl()
return FALSE
/mob/living/silicon/robot/mommi/sammi/ventcrawl()
return 0
@@ -185,7 +193,7 @@
/mob/living/silicon/robot/mommi/sammi/attack_hand(mob/user)
add_fingerprint(user)
if(opened && !wiresexposed && (!isMoMMI(user)))
if(opened && !wiresexposed && user != src)
if(cell || cellhold)
if(cellhold)
@@ -241,6 +249,10 @@
icon_state = "sammi_online_a"
else
icon_state = "sammi_online"
ghost_name = O.mind.name
ghost_icon = O.icon
ghost_icon_state = O.icon_state
ghost_overlays = O.overlays
updateicon()
else if(src.key)
to_chat(src, "<span class='notice'>Someone has already began controlling this SAMMI. Try another! </span>")