diff --git a/code/modules/mob/living/silicon/pai/death.dm b/code/modules/mob/living/silicon/pai/death.dm index f9d75773ff9..6ad793fff88 100644 --- a/code/modules/mob/living/silicon/pai/death.dm +++ b/code/modules/mob/living/silicon/pai/death.dm @@ -1,15 +1,15 @@ /mob/living/silicon/pai/death(gibbed) - if(stat == DEAD) return - if(canmove || resting) - var/turf/T = get_turf_or_move(loc) - for (var/mob/M in viewers(T)) - M.show_message("\red [src] emits a dull beep before it loses power and collapses.", 3, "\red You hear a dull beep followed by the sound of glass crunching.", 2) - name = "pAI debris" - desc = "The unfortunate remains of some poor personal AI device." - icon_state = "[chassis]_dead" - else - card.overlays.Cut() - card.overlays += "pai-off" + if(stat == DEAD) + return + + force_fold_out() + + var/turf/T = get_turf_or_move(loc) + for (var/mob/M in viewers(T)) + M.show_message("\red [src] emits a dull beep before it loses power and collapses.", 3, "\red You hear a dull beep followed by the sound of glass crunching.", 2) + name = "pAI debris" + desc = "The unfortunate remains of some poor personal AI device." + icon_state = "[chassis]_dead" stat = DEAD canmove = 0 sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 4e1373e979b..1cd6c04b02d 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -351,24 +351,27 @@ last_special = world.time + 200 //I'm not sure how much of this is necessary, but I would rather avoid issues. - if(istype(card.loc,/mob)) - var/mob/holder = card.loc - holder.unEquip(card) - else if(istype(card.loc,/obj/item/device/pda)) - var/obj/item/device/pda/holder = card.loc - holder.pai = null - - - src.client.perspective = EYE_PERSPECTIVE - src.client.eye = src - src.forceMove(get_turf(card)) - - card.forceMove(src) - card.screen_loc = null + force_fold_out() var/turf/T = get_turf(src) if(istype(T)) T.visible_message("[src] folds outwards, expanding into a mobile form.") +/mob/living/silicon/pai/proc/force_fold_out() + if(istype(card.loc, /mob)) + var/mob/holder = card.loc + holder.unEquip(card) + else if(istype(card.loc, /obj/item/device/pda)) + var/obj/item/device/pda/holder = card.loc + holder.pai = null + + if(client) + client.perspective = EYE_PERSPECTIVE + client.eye = src + forceMove(get_turf(card)) + + card.forceMove(src) + card.screen_loc = null + /mob/living/silicon/pai/verb/fold_up() set category = "pAI Commands" set name = "Collapse Chassis"