mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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.",
|
||||
)
|
||||
@@ -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
|
||||
|
||||
@@ -86,10 +86,16 @@ var/creating_arena = FALSE
|
||||
icon_state = body.icon_state
|
||||
overlays = body.overlays
|
||||
*/
|
||||
|
||||
icon = body.icon
|
||||
icon_state = body.icon_state
|
||||
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
|
||||
|
||||
// No icon? Ghost icon time.
|
||||
if(isnull(icon) || isnull(icon_state))
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -108,84 +116,84 @@
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/robot/mommi/sammi/attackby(obj/item/W, mob/user)
|
||||
if (istype(W, /obj/item/weapon/cell) && opened) // trying to put a cell inside
|
||||
if(wiresexposed)
|
||||
to_chat(user, "Close the wiring panel first.")
|
||||
else if(cell)
|
||||
to_chat(user, "There is a power cell already installed.")
|
||||
else
|
||||
user.drop_item(W, src)
|
||||
if(anchored)
|
||||
cell = W
|
||||
else
|
||||
cellhold = W
|
||||
to_chat(user, "You insert the power cell.")
|
||||
// chargecount = 0
|
||||
updateicon()
|
||||
if (istype(W, /obj/item/weapon/cell) && opened) // trying to put a cell inside
|
||||
if(wiresexposed)
|
||||
to_chat(user, "Close the wiring panel first.")
|
||||
else if(cell)
|
||||
to_chat(user, "There is a power cell already installed.")
|
||||
else
|
||||
user.drop_item(W, src)
|
||||
if(anchored)
|
||||
cell = W
|
||||
else
|
||||
cellhold = W
|
||||
to_chat(user, "You insert the power cell.")
|
||||
// chargecount = 0
|
||||
updateicon()
|
||||
|
||||
else if (iswirecutter(W) || istype(W, /obj/item/device/multitool))
|
||||
if (wiresexposed)
|
||||
wires.Interact(user)
|
||||
else
|
||||
//to_chat(user, "You can't reach the wiring.")
|
||||
if(opened)
|
||||
change_sammi_law(user)
|
||||
else
|
||||
to_chat(user, "The console's cover is closed.")
|
||||
else if (iswirecutter(W) || istype(W, /obj/item/device/multitool))
|
||||
if (wiresexposed)
|
||||
wires.Interact(user)
|
||||
else
|
||||
//to_chat(user, "You can't reach the wiring.")
|
||||
if(opened)
|
||||
change_sammi_law(user)
|
||||
else
|
||||
to_chat(user, "The console's cover is closed.")
|
||||
|
||||
else if(W.is_wrench(user)) // Need to make this not bludgeon them
|
||||
W.playtoolsound(loc, 50)
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='notice'>You unbolt the SAMMI from the floor.</span>")
|
||||
anchored = 0
|
||||
cellhold = cell
|
||||
cell = null
|
||||
if(icon_state == "sammi_offline_a")
|
||||
icon_state = "sammi_offline"
|
||||
else
|
||||
icon_state = "sammi_online"
|
||||
updateicon()
|
||||
else if(W.is_wrench(user)) // Need to make this not bludgeon them
|
||||
W.playtoolsound(loc, 50)
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='notice'>You unbolt the SAMMI from the floor.</span>")
|
||||
anchored = 0
|
||||
cellhold = cell
|
||||
cell = null
|
||||
if(icon_state == "sammi_offline_a")
|
||||
icon_state = "sammi_offline"
|
||||
else
|
||||
icon_state = "sammi_online"
|
||||
updateicon()
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You anchor the SAMMI to the floor.</span>")
|
||||
anchored = 1
|
||||
cell = cellhold
|
||||
cellhold = null
|
||||
if(icon_state == "sammi_offline")
|
||||
icon_state = "sammi_offline_a"
|
||||
else
|
||||
icon_state = "sammi_online_a"
|
||||
updateicon()
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You anchor the SAMMI to the floor.</span>")
|
||||
anchored = 1
|
||||
cell = cellhold
|
||||
cellhold = null
|
||||
if(icon_state == "sammi_offline")
|
||||
icon_state = "sammi_offline_a"
|
||||
else
|
||||
icon_state = "sammi_online_a"
|
||||
updateicon()
|
||||
|
||||
return 0
|
||||
return 0
|
||||
|
||||
else if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if(emagged)//still allow them to open the cover
|
||||
to_chat(user, "The interface seems slightly damaged")
|
||||
if(opened)
|
||||
else if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
|
||||
if(emagged)//still allow them to open the cover
|
||||
to_chat(user, "The interface seems slightly damaged")
|
||||
if(opened)
|
||||
|
||||
if(can_access(user.GetAccess(),20))//cmagged
|
||||
var/cmw = "Yes"
|
||||
cmw = alert(user, "Are you sure you want to disable this SAMMIs safety protocols?", "You sure?", "Yes", "No")
|
||||
if(cmw == "Yes")
|
||||
emag_act(user, 0)
|
||||
else
|
||||
if(allowed(usr))
|
||||
locked = !locked
|
||||
to_chat(user, "You [ locked ? "lock" : "unlock"] [src]'s interface.")
|
||||
if(can_diagnose())
|
||||
to_chat(src, "<span class='info' style=\"font-family:Courier\">Interface [ locked ? "locked" : "unlocked"].</span>")
|
||||
updateicon()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
if(can_access(user.GetAccess(),20))//cmagged
|
||||
var/cmw = "Yes"
|
||||
cmw = alert(user, "Are you sure you want to disable this SAMMIs safety protocols?", "You sure?", "Yes", "No")
|
||||
if(cmw == "Yes")
|
||||
emag_act(user, 0)
|
||||
else
|
||||
if(allowed(usr))
|
||||
locked = !locked
|
||||
to_chat(user, "You [ locked ? "lock" : "unlock"] [src]'s interface.")
|
||||
if(can_diagnose())
|
||||
to_chat(src, "<span class='info' style=\"font-family:Courier\">Interface [ locked ? "locked" : "unlocked"].</span>")
|
||||
updateicon()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
|
||||
else
|
||||
return ..()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/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>")
|
||||
Reference in New Issue
Block a user