Last one???

This commit is contained in:
VerySoft
2022-06-29 00:08:44 -04:00
parent 110f4c8865
commit 266b1a2afe
5 changed files with 96 additions and 40 deletions
+10 -2
View File
@@ -76,6 +76,13 @@
if(ourcard.panel_open)
to_chat(user, "<span class='warning'>\The [ourcard] won't fit in the recharger with its panel open.</span>")
return
if(ourcard.pai)
if(ourcard.pai.stat == CONSCIOUS)
to_chat(user, "<span class='warning'>\The [ourcard] boops... it doesn't need to be recharged!</span>")
return
else
to_chat(user, "<span class='warning'>\The [ourcard] doesn't have a personality!</span>")
return
user.drop_item()
G.loc = src
@@ -140,10 +147,11 @@
else if(pcard.pai.fireloss)
pcard.pai.adjustFireLoss(-1)
else
pcard.forceMove(get_turf(src))
pcard.pai.full_restore()
charging = null
update_icon()
src.visible_message("<span class ='notice'>\The [src] ejects the [pcard]!</span>")
pcard.forceMove(get_turf(src))
pcard.pai.full_restore()
//VOREStation Edit End
else
var/obj/item/weapon/cell/C = charging.get_cell()
@@ -58,6 +58,9 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
/obj/item/device/paicard/attack_ghost(mob/user as mob)
if(pai != null) //Have a person in them already?
return ..()
if(is_damage_critical())
to_chat(usr, "<span class='warning'>That card is too damaged to activate!</span>")
return
var/time_till_respawn = user.time_till_respawn()
if(time_till_respawn == -1) // Special case, never allowed to respawn
to_chat(usr, "<span class='warning'>Respawning is not allowed!</span>")
@@ -132,6 +135,9 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
// VOREStation Edit End
/obj/item/device/paicard/proc/access_screen(mob/user)
if(is_damage_critical())
to_chat(user, "<span class='warning'>WARNING: CRITICAL HARDWARE FAILURE, SERVICE DEVICE IMMEDIATELY</span>")
return
if (!in_range(src, user))
return
user.set_machine(src)
+74 -36
View File
@@ -19,9 +19,11 @@ var/global/list/paikeys = list()
if(panel_open)
panel_open = FALSE
user.visible_message("<span class ='notice'>\The [user] secured \the [src]'s maintenance panel.</span>")
else
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
else if(pai)
panel_open = TRUE
user.visible_message("<span class ='warning'>\The [user] opened \the [src]'s maintenance panel.</span>")
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
if(istype(I,/obj/item/device/robotanalyzer))
if(!panel_open)
to_chat(user, "<span class ='warning'>The panel isn't open. You will need to unscrew it to open it.</span>")
@@ -153,41 +155,69 @@ var/global/list/paikeys = list()
else
to_chat(user,"Speech Synthesizer: <span class ='warning'>missing</span>")
if(istype(I,/obj/item/paiparts/cell) && cell == PP_MISSING)
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
cell = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
if(istype(I,/obj/item/paiparts/processor) && processor == PP_MISSING)
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
processor = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
if(istype(I,/obj/item/paiparts/board) && board == PP_MISSING)
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
board = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
if(istype(I,/obj/item/paiparts/capacitor) && capacitor == PP_MISSING)
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
capacitor = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
if(istype(I,/obj/item/paiparts/projector) && projector == PP_MISSING)
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
projector = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
if(istype(I,/obj/item/paiparts/emitter) && emitter == PP_MISSING)
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
emitter = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
if(istype(I,/obj/item/paiparts/speech_synthesizer) && speech_synthesizer == PP_MISSING)
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
speech_synthesizer = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
if(istype(I,/obj/item/paiparts/cell))
if(cell == PP_MISSING)
if(do_after(user, 3 SECONDS))
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
cell = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
else
to_chat(user, "<span class ='warning'>You would need to remove the installed [I] first!</span>")
if(istype(I,/obj/item/paiparts/processor))
if(processor == PP_MISSING)
if(do_after(user, 3 SECONDS))
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
processor = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
else
to_chat(user, "<span class ='warning'>You would need to remove the installed [I] first!</span>")
if(istype(I,/obj/item/paiparts/board))
if(board == PP_MISSING)
if(do_after(user, 3 SECONDS))
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
board = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
else
to_chat(user, "<span class ='warning'>You would need to remove the installed [I] first!</span>")
if(istype(I,/obj/item/paiparts/capacitor))
if(capacitor == PP_MISSING)
if(do_after(user, 3 SECONDS))
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
capacitor = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
else
to_chat(user, "<span class ='warning'>You would need to remove the installed [I] first!</span>")
if(istype(I,/obj/item/paiparts/projector))
if(projector == PP_MISSING)
if(do_after(user, 3 SECONDS))
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
projector = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
else
to_chat(user, "<span class ='warning'>You would need to remove the installed [I] first!</span>")
if(istype(I,/obj/item/paiparts/emitter))
if(emitter == PP_MISSING)
if(do_after(user, 3 SECONDS))
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
emitter = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
else
to_chat(user, "<span class ='warning'>You would need to remove the installed [I] first!</span>")
if(istype(I,/obj/item/paiparts/speech_synthesizer))
if(speech_synthesizer == PP_MISSING)
if(do_after(user, 3 SECONDS))
user.visible_message("<span class ='notice'>\The [user] installs \the [I] into \the [src].</span>","<span class ='notice'>You install \the [I] into \the [src].</span>")
speech_synthesizer = PP_FUNCTIONAL
user.drop_from_inventory(I)
qdel(I)
else
to_chat(user, "<span class ='warning'>You would need to remove the installed [I] first!</span>")
/obj/item/device/paicard/attack_self(mob/user)
if(!panel_open)
@@ -210,6 +240,12 @@ var/global/list/paikeys = list()
parts |= "speech synthesizer"
var/choice = tgui_input_list(user, "Which part would you like to remove?", "Remove part", parts)
if(choice)
playsound(src, 'sound/items/pickup/component.ogg', vary = TRUE)
else
return
if(!do_after(user, 3 SECONDS))
return
switch(choice)
if("cell")
if(cell == PP_FUNCTIONAL)
@@ -311,6 +347,8 @@ var/global/list/paikeys = list()
desc = "It's broken scrap from a pAI card!"
icon = 'icons/obj/paicard.dmi'
icon_state = "broken"
pickup_sound = 'sound/items/pickup/card.ogg'
drop_sound = 'sound/items/drop/card.ogg'
/obj/item/paiparts/Initialize()
. = ..()
pixel_x = rand(-10,10)
@@ -76,12 +76,16 @@
/mob/living/silicon/pai/proc/full_restore()
adjustBruteLoss(- bruteloss)
adjustFireLoss(- fireloss)
spawn(100)
do_after(src, 1 SECONDS)
card.setEmotion(16)
spawn(500)
stat = CONSCIOUS
do_after(src, 5 SECONDS)
var/mob/observer/dead/ghost = src.get_ghost()
if(ghost)
ghost.notify_revive("Someone is trying to revive you. Re-enter your body if you want to be revived!", 'sound/effects/pai-restore.ogg', source = card)
canmove = TRUE
card.setEmotion(15)
playsound(card, 'sound/effects/pai-restore.ogg', 50, FALSE)
card.visible_message("\The [card] chimes.", runemessage = "chime")
/mob/living/silicon/pai/proc/pai_nom(var/mob/living/T in oview(1))
Binary file not shown.