Me go sleeb

This commit is contained in:
VerySoft
2022-06-27 06:20:03 -04:00
parent 0a36d76423
commit dc79359d34
7 changed files with 207 additions and 8 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
// VOREStation Edit End
/obj/item/device/paicard/attack_self(mob/user)
/obj/item/device/paicard/proc/access_screen(mob/user)
if (!in_range(src, user))
return
user.set_machine(src)
@@ -0,0 +1,163 @@
/obj/item/device/paicard
var/panel_open = FALSE
var/cell = TRUE //critical- power
var/processor = TRUE //critical- the thinky part
var/board = TRUE //critical- makes everything work
var/capacitor = TRUE //critical- power processing
var/projector = TRUE //non-critical- affects unfolding
var/emitter = TRUE //non-critical- affects unfolding
var/screen = TRUE //non-critical- affects screen
var/list/parts = list(
"cell",
"processor",
"board",
"capacitor",
"projector",
"emitter",
"screen")
/obj/item/device/paicard/attackby(var/obj/item/I as obj, mob/user as mob)
if(istype(I,/obj/item/weapon/tool/screwdriver))
if(panel_open)
panel_open = FALSE
user.visible_message("<span class ='warning'>\The [user] secured \the [src]'s maintenance panel.</span>")
else
panel_open = TRUE
user.visible_message("<span class ='notice'>\The [user] opened \the [src]'s maintenance panel.</span>")
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>")
else
if(cell)
to_chat(user,"Power cell: <span class ='notice'>functional</span>")
else
to_chat(user,"Power cell: <span class ='warning'>damaged - CRITICAL</span>")
if(processor)
to_chat(user,"Processor: <span class ='notice'>functional</span>")
else
to_chat(user,"Processor: <span class ='warning'>damaged - CRITICAL</span>")
if(board)
to_chat(user,"Board: <span class ='notice'>functional</span>")
else
to_chat(user,"Board: <span class ='warning'>damaged - CRITICAL</span>")
if(capacitor)
to_chat(user,"Capacitors: <span class ='notice'>functional</span>")
else
to_chat(user,"Capacitors: <span class ='warning'>damaged - CRITICAL</span>")
if(projector)
to_chat(user,"Projectors: <span class ='notice'>functional</span>")
else
to_chat(user,"Projectors: <span class ='warning'>damaged</span>")
if(emitter)
to_chat(user,"Emitters: <span class ='notice'>functional</span>")
else
to_chat(user,"Emitters: <span class ='warning'>damaged</span>")
if(screen)
to_chat(user,"Screen: <span class ='notice'>functional</span>")
else
to_chat(user,"Screen: <span class ='warning'>damaged</span>")
if(istype(I,/obj/item/device/multitool))
if(!panel_open)
to_chat(user, "<span class ='warning'>You can't do that in this state.</span>")
else
var/choice = tgui_input_list(user, "Which part would you like to check?", "Check part", parts)
switch(choice)
if("cell")
if(cell)
to_chat(user,"Power cell: <span class ='notice'>functional</span>")
else
to_chat(user,"Power cell: <span class ='warning'>damaged</span>")
if("processor")
if(processor)
to_chat(user,"Processor: <span class ='notice'>functional</span>")
else
to_chat(user,"Processor: <span class ='warning'>damaged</span>")
if("board")
if(board)
to_chat(user,"Board: <span class ='notice'>functional</span>")
else
to_chat(user,"Board: <span class ='warning'>damaged</span>")
if("capacitor")
if(capacitor)
to_chat(user,"Capacitors: <span class ='notice'>functional</span>")
else
to_chat(user,"Capacitors: <span class ='warning'>damaged</span>")
if("projector")
if(projector)
to_chat(user,"Projectors: <span class ='notice'>functional</span>")
else
to_chat(user,"Projectors: <span class ='warning'>damaged</span>")
if("emitter")
if(emitter)
to_chat(user,"Emitters: <span class ='notice'>functional</span>")
else
to_chat(user,"Emitters: <span class ='warning'>damaged</span>")
if("screen")
if(screen)
to_chat(user,"Screen: <span class ='notice'>functional</span>")
else
to_chat(user,"Screen: <span class ='warning'>damaged</span>")
/obj/item/device/paicard/attack_self(mob/user)
if(!panel_open)
access_screen(user)
return
var/choice = tgui_input_list(user, "Which part would you like to remove?", "Remove part", parts)
switch(choice)
if("cell")
cell = FALSE
if(pai.stat != DEAD)
pai.death()
if("processor")
processor = FALSE
if(pai.stat != DEAD)
pai.death()
if("board")
board = FALSE
if(pai.stat != DEAD)
pai.death()
if("capacitor")
capacitor = FALSE
if(pai.stat != DEAD)
pai.death()
if("projector")
projector = FALSE
if("emitter")
emitter = FALSE
if("screen")
screen = FALSE
parts -= choice
/obj/item/device/paicard/proc/death_damage()
var/number = pick(1,4)
while(number)
switch(pick(1,4))
if(1)
cell = FALSE
if(2)
processor = FALSE
if(3)
board = FALSE
if(4)
capacitor = FALSE
/obj/item/device/paicard/proc/damage_random_component(nonfatal = FALSE)
if(prob(80) || nonfatal) //Way more likely to be non-fatal part damage
switch(pick(1,3))
if(1)
projector = FALSE
if(2)
emitter = FALSE
if(3)
screen = FALSE
else
switch(pick(1,4))
if(1)
cell = FALSE
if(2)
processor = FALSE
if(3)
board = FALSE
if(4)
capacitor = FALSE
+15 -3
View File
@@ -1,8 +1,5 @@
/mob/living/silicon/pai/Life()
if (src.stat == DEAD)
return
if(src.cable)
if(get_dist(src, src.cable) > 1)
var/turf/T = get_turf_or_move(src.loc)
@@ -13,6 +10,21 @@
qdel(src.cable)
src.cable = null
if (src.stat == DEAD)
return
if(!card.cell || !card.processor || !card.board || !card.capacitor)
death()
if(!card.projector && !card.emitter)
if(loc != card)
close_up()
to_chat(src, "<span class ='warning'>ERROR: System malfunction. Service required!</span>")
if(!card.projector || !card.emitter)
if(prob(5))
close_up()
to_chat(src, "<span class ='warning'>ERROR: System malfunction. Service recommended!</span>")
handle_regular_hud_updates()
handle_vision()
+7 -3
View File
@@ -171,7 +171,8 @@
/mob/living/silicon/pai/emp_act(severity)
// Silence for 2 minutes
// 20% chance to kill
// 20% chance to damage critical components
// 50% chance to damage a non critical component
// 33% chance to unbind
// 33% chance to change prime directive (based on severity)
// 33% chance of no additional effect
@@ -180,10 +181,12 @@
to_chat(src, "<font color=green><b>Communication circuit overload. Shutting down and reloading communication circuits - speech and messaging functionality will be unavailable until the reboot is complete.</b></font>")
if(prob(20))
var/turf/T = get_turf_or_move(src.loc)
card.death_damage()
for (var/mob/M in viewers(T))
M.show_message("<font color='red'>A shower of sparks spray from [src]'s inner workings.</font>", 3, "<font color='red'>You hear and smell the ozone hiss of electrical sparks being expelled violently.</font>", 2)
return src.death(0)
return
if(prob(50))
card.damage_random_component(TRUE)
switch(pick(1,2,3))
if(1)
src.master = null
@@ -285,6 +288,7 @@
card.forceMove(src)
card.screen_loc = null
canmove = TRUE
var/turf/T = get_turf(src)
if(istype(T)) T.visible_message("<b>[src]</b> folds outwards, expanding into a mobile form.")
+20 -1
View File
@@ -67,8 +67,8 @@
/mob/living/silicon/pai/Login()
. = ..()
last_special = world.time + 100 //Let's give get_character_icon time to work
if(!holo_icon)
last_special = world.time + 100 //Let's give get_character_icon time to work
get_character_icon()
if(stat == DEAD)
healths.icon_state = "health7"
@@ -76,7 +76,14 @@
/mob/living/silicon/pai/proc/full_restore()
adjustBruteLoss(- bruteloss)
adjustFireLoss(- fireloss)
spawn(10)
card.cut_overlays()
card.setEmotion(16)
update_icon()
spawn(50)
stat = CONSCIOUS
canmove = TRUE
card.setEmotion(15)
/mob/living/silicon/pai/proc/pai_nom(var/mob/living/T in oview(1))
set name = "pAI Nom"
@@ -628,3 +635,15 @@
icon = holo_icon
else
icon = holo_icon_north
/mob/living/silicon/pai/adjustBruteLoss(amount, include_robo)
. = ..()
if(amount > 0 && health <= 90) //Something's probably attacking us!
if(prob(amount)) //The more damage it is doing, the more likely it is to damage something important!
card.damage_random_component()
/mob/living/silicon/pai/adjustFireLoss(amount, include_robo)
. = ..()
if(amount > 0 && health <= 90)
if(prob(amount))
card.damage_random_component()
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 B

+1
View File
@@ -1196,6 +1196,7 @@
#include "code\game\objects\items\devices\modkit.dm"
#include "code\game\objects\items\devices\multitool.dm"
#include "code\game\objects\items\devices\paicard.dm"
#include "code\game\objects\items\devices\paicard_vr.dm"
#include "code\game\objects\items\devices\pipe_painter.dm"
#include "code\game\objects\items\devices\powersink.dm"
#include "code\game\objects\items\devices\spy_bug.dm"