Death of pAIs!!!

This commit is contained in:
Casey
2022-06-29 01:58:25 -04:00
committed by CHOMPStation2
parent e2227297a5
commit 285b424a75
19 changed files with 1655 additions and 50 deletions

View File

@@ -10,7 +10,11 @@
active_power_usage = 40000 //40 kW
var/efficiency = 40000 //will provide the modified power rate when upgraded
var/obj/item/charging = null
<<<<<<< HEAD
var/list/allowed_devices = list(/obj/item/weapon/gun/energy, /obj/item/weapon/melee/baton, /obj/item/modular_computer, /obj/item/weapon/computer_hardware/battery_module, /obj/item/weapon/cell, /obj/item/device/suit_cooling_unit/emergency, /obj/item/device/flashlight, /obj/item/device/electronic_assembly, /obj/item/weapon/weldingtool/electric, /obj/item/ammo_magazine/smart, /obj/item/device/flash, /obj/item/device/defib_kit, /obj/item/ammo_casing/microbattery, /obj/item/ammo_magazine/cell_mag, /obj/item/weapon/gun/projectile/cell_loaded) //VOREStation Add - NSFW Batteries
=======
var/list/allowed_devices = list(/obj/item/weapon/gun/energy, /obj/item/weapon/melee/baton, /obj/item/modular_computer, /obj/item/weapon/computer_hardware/battery_module, /obj/item/weapon/cell, /obj/item/device/suit_cooling_unit/emergency, /obj/item/device/flashlight, /obj/item/device/electronic_assembly, /obj/item/weapon/weldingtool/electric, /obj/item/ammo_magazine/smart, /obj/item/device/flash, /obj/item/device/defib_kit, /obj/item/ammo_casing/microbattery, /obj/item/device/paicard) //VOREStation Add - NSFW Batteries
>>>>>>> e1dca305a0... Merge pull request #13180 from Very-Soft/paideath
var/icon_state_charged = "recharger2"
var/icon_state_charging = "recharger1"
var/icon_state_idle = "recharger0" //also when unpowered
@@ -68,6 +72,7 @@
if(EW.use_external_power)
to_chat(user, "<span class='notice'>\The [EW] has no recharge port.</span>")
return
<<<<<<< HEAD
else if(istype(G, /obj/item/ammo_magazine/cell_mag))
var/obj/item/ammo_magazine/cell_mag/maggy = G
if(maggy.stored_ammo.len < 1)
@@ -82,6 +87,22 @@
return
else
to_chat(user, "\The [G] does not have a magazine installed..")
=======
if(!G.get_cell() && !istype(G, /obj/item/ammo_casing/microbattery) && !istype(G, /obj/item/device/paicard)) //VOREStation Edit: NSFW charging
to_chat(user, "\The [G] does not have a battery installed.")
return
if(istype(G, /obj/item/device/paicard))
var/obj/item/device/paicard/ourcard = G
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>")
>>>>>>> e1dca305a0... Merge pull request #13180 from Very-Soft/paideath
return
user.drop_item()
@@ -134,6 +155,25 @@
if(!charging)
update_use_power(USE_POWER_IDLE)
icon_state = icon_state_idle
//VOREStation Edit Start - pAI revival!
else if(istype(charging, /obj/item/device/paicard))
var/obj/item/device/paicard/pcard = charging
if(pcard.is_damage_critical())
pcard.forceMove(get_turf(src))
charging = null
pcard.damage_random_component()
update_icon()
else if(pcard.pai.bruteloss)
pcard.pai.adjustBruteLoss(-1)
else if(pcard.pai.fireloss)
pcard.pai.adjustFireLoss(-1)
else
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()
if(istype(C))

View File

@@ -61,6 +61,7 @@
"Cyborg Parts",
"Cyborg Internals",
"Cybernetics",
"pAI Parts", //VOREStation Add
"Implants",
"Control Interfaces",
"Other",

View File

@@ -58,11 +58,24 @@ 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>")
else if(time_till_respawn) // Nonzero time to respawn
to_chat(usr, "<span class='warning'>You can't do that yet! You died too recently. You need to wait another [round(time_till_respawn/10/60, 0.1)] minutes.</span>")
return
if(jobban_isbanned(usr, "pAI"))
to_chat(usr,"<span class='warning'>You cannot join a pAI card when you are banned from playing as a pAI.</span>")
return
for(var/ourkey in paikeys)
if(ourkey == user.ckey)
to_chat(usr, "<span class='warning'>You can't just rejoin any old pAI card!!! Your card still exists.</span>")
return
var/choice = tgui_alert(user, "You sure you want to inhabit this PAI, or submit yourself to being recruited?", "Confirmation", list("Inhabit", "Recruit", "Cancel"))
if(choice == "Cancel")
return ..()
@@ -81,12 +94,14 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
var/obj/item/device/paicard/typeb/card = new(location)
var/mob/living/silicon/pai/new_pai = new(card)
new_pai.key = user.key
paikeys |= new_pai.ckey
card.setPersonality(new_pai)
new_pai.SetName(actual_pai_name)
else
var/obj/item/device/paicard/card = new(location)
var/mob/living/silicon/pai/new_pai = new(card)
new_pai.key = user.key
paikeys |= new_pai.ckey
card.setPersonality(new_pai)
new_pai.SetName(actual_pai_name)
@@ -95,6 +110,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
var/obj/item/device/paicard/typeb/card = new(location)
var/mob/living/silicon/pai/new_pai = new(card)
new_pai.key = user.key
paikeys |= new_pai.ckey
card.setPersonality(new_pai)
if(!new_pai.savefile_load(new_pai))
var/pai_name = tgui_input_text(new_pai, "Choose your character's name", "Character Name")
@@ -105,6 +121,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
var/obj/item/device/paicard/card = new(location)
var/mob/living/silicon/pai/new_pai = new(card)
new_pai.key = user.key
paikeys |= new_pai.ckey
card.setPersonality(new_pai)
if(!new_pai.savefile_load(new_pai))
var/pai_name = tgui_input_text(new_pai, "Choose your character's name", "Character Name")
@@ -117,7 +134,10 @@ 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(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)
@@ -513,6 +533,5 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
return pick(/obj/item/device/paicard ,/obj/item/device/paicard/typeb)
/obj/item/device/paicard/digest_act(var/atom/movable/item_storage = null)
if(!pai.digestable)
return
. = ..()
if(pai.digestable)
return ..()

View File

@@ -0,0 +1,384 @@
#define PP_FUNCTIONAL 0
#define PP_BROKEN 1
#define PP_MISSING 2
var/global/list/paikeys = list()
/obj/item/device/paicard
var/panel_open = FALSE
var/cell = PP_FUNCTIONAL //critical- power
var/processor = PP_FUNCTIONAL //critical- the thinky part
var/board = PP_FUNCTIONAL //critical- makes everything work
var/capacitor = PP_FUNCTIONAL //critical- power processing
var/projector = PP_FUNCTIONAL //non-critical- affects unfolding
var/emitter = PP_FUNCTIONAL //non-critical- affects unfolding
var/speech_synthesizer = PP_FUNCTIONAL //non-critical- affects speech
/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 ='notice'>\The [user] secured \the [src]'s maintenance panel.</span>")
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>")
else
if(cell == PP_FUNCTIONAL)
to_chat(user,"Power cell: <span class ='notice'>functional</span>")
else if(cell == PP_BROKEN)
to_chat(user,"Power cell: <span class ='warning'>damaged - CRITICAL</span>")
else
to_chat(user,"Power cell: <span class ='warning'>missing - CRITICAL</span>")
if(processor == PP_FUNCTIONAL)
to_chat(user,"Processor: <span class ='notice'>functional</span>")
else if(processor == PP_BROKEN)
to_chat(user,"Processor: <span class ='warning'>damaged - CRITICAL</span>")
else
to_chat(user,"Processor: <span class ='warning'>missing - CRITICAL</span>")
if(board == PP_FUNCTIONAL)
to_chat(user,"Board: <span class ='notice'>functional</span>")
else if(board == PP_BROKEN)
to_chat(user,"Board: <span class ='warning'>damaged - CRITICAL</span>")
else
to_chat(user,"Board: <span class ='warning'>missing - CRITICAL</span>")
if(capacitor == PP_FUNCTIONAL)
to_chat(user,"Capacitors: <span class ='notice'>functional</span>")
else if(capacitor == PP_BROKEN)
to_chat(user,"Capacitors: <span class ='warning'>damaged - CRITICAL</span>")
else
to_chat(user,"Capacitors: <span class ='warning'>missing - CRITICAL</span>")
if(projector == PP_FUNCTIONAL)
to_chat(user,"Projectors: <span class ='notice'>functional</span>")
else if(projector == PP_BROKEN)
to_chat(user,"Projectors: <span class ='warning'>damaged</span>")
else
to_chat(user,"Projectors: <span class ='warning'>missing</span>")
if(emitter == PP_FUNCTIONAL)
to_chat(user,"Emitters: <span class ='notice'>functional</span>")
else if(emitter == PP_BROKEN)
to_chat(user,"Emitters: <span class ='warning'>damaged</span>")
else
to_chat(user,"Emitters: <span class ='warning'>missing</span>")
if(speech_synthesizer == PP_FUNCTIONAL)
to_chat(user,"Speech Synthesizer: <span class ='notice'>functional</span>")
else if(speech_synthesizer == PP_BROKEN)
to_chat(user,"Speech Synthesizer: <span class ='warning'>damaged</span>")
else
to_chat(user,"Speech Synthesizer: <span class ='warning'>missing</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/list/parts = list()
if(cell != PP_MISSING)
parts |= "cell"
if(processor != PP_MISSING)
parts |= "processor"
if(board != PP_MISSING)
parts |= "board"
if(capacitor != PP_MISSING)
parts |= "capacitor"
if(projector != PP_MISSING)
parts |= "projector"
if(emitter != PP_MISSING)
parts |= "emitter"
if(speech_synthesizer != PP_MISSING)
parts |= "speech synthesizer"
var/choice = tgui_input_list(user, "Which part would you like to check?", "Check part", parts)
switch(choice)
if("cell")
if(cell == PP_FUNCTIONAL)
to_chat(user,"Power cell: <span class ='notice'>functional</span>")
else if(speech_synthesizer == PP_BROKEN)
to_chat(user,"Power cell: <span class ='warning'>damaged</span>")
else
to_chat(user,"Power cell: <span class ='warning'>missing</span>")
if("processor")
if(processor == PP_FUNCTIONAL)
to_chat(user,"Processor: <span class ='notice'>functional</span>")
else if(speech_synthesizer == PP_BROKEN)
to_chat(user,"Processor: <span class ='warning'>damaged</span>")
else
to_chat(user,"Processor: <span class ='warning'>missing</span>")
if("board")
if(board == PP_FUNCTIONAL)
to_chat(user,"Board: <span class ='notice'>functional</span>")
else if(speech_synthesizer == PP_BROKEN)
to_chat(user,"Board: <span class ='warning'>damaged</span>")
else
to_chat(user,"Board: <span class ='warning'>missing</span>")
if("capacitor")
if(capacitor == PP_FUNCTIONAL)
to_chat(user,"Capacitors: <span class ='notice'>functional</span>")
else if(speech_synthesizer == PP_BROKEN)
to_chat(user,"Capacitors: <span class ='warning'>damaged</span>")
else
to_chat(user,"Capacitors: <span class ='warning'>missing</span>")
if("projector")
if(projector == PP_FUNCTIONAL)
to_chat(user,"Projectors: <span class ='notice'>functional</span>")
else if(speech_synthesizer == PP_BROKEN)
to_chat(user,"Projectors: <span class ='warning'>damaged</span>")
else
to_chat(user,"Projectors: <span class ='warning'>missing</span>")
if("emitter")
if(emitter == PP_FUNCTIONAL)
to_chat(user,"Emitters: <span class ='notice'>functional</span>")
else if(speech_synthesizer == PP_BROKEN)
to_chat(user,"Emitters: <span class ='warning'>damaged</span>")
else
to_chat(user,"Emitters: <span class ='warning'>missing</span>")
if("speech synthesizer")
if(speech_synthesizer == PP_FUNCTIONAL)
to_chat(user,"Speech Synthesizer: <span class ='notice'>functional</span>")
else if(speech_synthesizer == PP_BROKEN)
to_chat(user,"Speech Synthesizer: <span class ='warning'>damaged</span>")
else
to_chat(user,"Speech Synthesizer: <span class ='warning'>missing</span>")
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)
access_screen(user)
return
var/list/parts = list()
if(cell != PP_MISSING)
parts |= "cell"
if(processor != PP_MISSING)
parts |= "processor"
if(board != PP_MISSING)
parts |= "board"
if(capacitor != PP_MISSING)
parts |= "capacitor"
if(projector != PP_MISSING)
parts |= "projector"
if(emitter != PP_MISSING)
parts |= "emitter"
if(speech_synthesizer != PP_MISSING)
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)
new /obj/item/paiparts/capacitor(get_turf(user))
else
new /obj/item/paiparts(get_turf(user))
user.visible_message("<span class ='warning'>\The [user] removes \the [choice] from \the [src].</span>","<span class ='warning'>You remove \the [choice] from \the [src].</span>")
cell = PP_MISSING
if("processor")
if(processor == PP_FUNCTIONAL)
new /obj/item/paiparts/capacitor(get_turf(user))
else
new /obj/item/paiparts(get_turf(user))
user.visible_message("<span class ='warning'>\The [user] removes \the [choice] from \the [src].</span>","<span class ='warning'>You remove \the [choice] from \the [src].</span>")
processor = PP_MISSING
if("board")
board = PP_MISSING
if(board == PP_FUNCTIONAL)
new /obj/item/paiparts/capacitor(get_turf(user))
else
new /obj/item/paiparts(get_turf(user))
user.visible_message("<span class ='warning'>\The [user] removes \the [choice] from \the [src].</span>","<span class ='warning'>You remove \the [choice] from \the [src].</span>")
if("capacitor")
if(capacitor == PP_FUNCTIONAL)
new /obj/item/paiparts/capacitor(get_turf(user))
else
new /obj/item/paiparts(get_turf(user))
user.visible_message("<span class ='warning'>\The [user] removes \the [choice] from \the [src].</span>","<span class ='warning'>You remove \the [choice] from \the [src].</span>")
capacitor = PP_MISSING
if("projector")
if(projector == PP_FUNCTIONAL)
new /obj/item/paiparts/capacitor(get_turf(user))
else
new /obj/item/paiparts(get_turf(user))
user.visible_message("<span class ='warning'>\The [user] removes \the [choice] from \the [src].</span>","<span class ='warning'>You remove \the [choice] from \the [src].</span>")
projector = PP_MISSING
if("emitter")
if(emitter == PP_FUNCTIONAL)
new /obj/item/paiparts/capacitor(get_turf(user))
else
new /obj/item/paiparts(get_turf(user))
user.visible_message("<span class ='warning'>\The [user] removes \the [choice] from \the [src].</span>","<span class ='warning'>You remove \the [choice] from \the [src].</span>")
emitter = PP_MISSING
if("speech synthesizer")
if(speech_synthesizer == PP_FUNCTIONAL)
new /obj/item/paiparts/capacitor(get_turf(user))
else
new /obj/item/paiparts(get_turf(user))
user.visible_message("<span class ='warning'>\The [user] removes \the [choice] from \the [src].</span>","<span class ='warning'>You remove \the [choice] from \the [src].</span>")
speech_synthesizer = PP_MISSING
/obj/item/device/paicard/proc/death_damage()
var/number = rand(1,4)
while(number)
number --
switch(rand(1,4))
if(1)
cell = PP_BROKEN
if(2)
processor = PP_BROKEN
if(3)
board = PP_BROKEN
if(4)
capacitor = PP_BROKEN
/obj/item/device/paicard/proc/damage_random_component(nonfatal = FALSE)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(2, 1, src)
s.start()
if(prob(80) || nonfatal) //Way more likely to be non-fatal part damage
switch(rand(1,3))
if(1)
projector = PP_BROKEN
if(2)
emitter = PP_BROKEN
if(3)
speech_synthesizer = PP_BROKEN
else
switch(rand(1,4))
if(1)
cell = PP_BROKEN
if(2)
processor = PP_BROKEN
if(3)
board = PP_BROKEN
if(4)
capacitor = PP_BROKEN
/obj/item/device/paicard/proc/is_damage_critical()
if(cell != PP_FUNCTIONAL || processor != PP_FUNCTIONAL || board != PP_FUNCTIONAL || capacitor != PP_FUNCTIONAL)
return TRUE
return FALSE
/obj/item/paiparts
name = "broken pAI component"
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)
pixel_y = rand(-10,10)
/obj/item/paiparts/cell
name = "pAI power cell"
desc = "It's very small and efficient! It powers the pAI!"
icon_state = "cell"
/obj/item/paiparts/processor
name = "pAI processor"
desc = "It's the brain of your computer friend!"
icon_state = "processor"
/obj/item/paiparts/board
name = "pAI board"
desc = "It's the thing all the other parts get attatched to!"
icon_state = "board"
/obj/item/paiparts/capacitor
name = "pAI capacitor"
desc = "It helps regulate power flow!"
icon_state = "capacitor"
/obj/item/paiparts/projector
name = "pAI projector"
desc = "It projects the pAI's form!"
icon_state = "projector"
/obj/item/paiparts/emitter
name = "pAI emitter"
desc = "It emits the fields to help the pAI get around!"
icon_state = "emitter"
/obj/item/paiparts/speech_synthesizer
name = "pAI speech synthesizer"
desc = "It's a little voice box!"
icon_state = "speech_synthesizer"

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,16 @@
/mob/living/silicon/pai/death(gibbed)
//VOREStation Edit - Let's make it so that pAIs don't just always cease to be when they die! It would be cool if we could fix them.
/mob/living/silicon/pai/death(gibbed,deathmessage="fizzles out and clatters to the floor...")
// set_respawn_timer()
release_vore_contents()
close_up(TRUE)
if(card)
card.removePersonality()
//if(gibbed) //VOREStation Edit Start. This prevents pAIs from joining back into their card after the card's killed
src.loc = get_turf(card)
card.cut_overlays()
card.setEmotion(16)
card.damage_random_component()
if(gibbed)
qdel(card)
/*else
close_up()
qdel(card)*/ //VOREStation Edit End.
if(mind)
qdel(mind)
..(gibbed)
ghostize()
qdel(src)
else
card.add_overlay("pai-dead")
..(gibbed,deathmessage)

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 != PP_FUNCTIONAL|| card.processor != PP_FUNCTIONAL || card.board != PP_FUNCTIONAL || card.capacitor != PP_FUNCTIONAL)
death()
if(card.projector != PP_FUNCTIONAL && card.emitter != PP_FUNCTIONAL)
if(loc != card)
close_up()
to_chat(src, "<span class ='warning'>ERROR: System malfunction. Service required!</span>")
else if(card.projector != PP_FUNCTIONAL|| card.emitter != PP_FUNCTIONAL)
if(prob(5))
close_up()
to_chat(src, "<span class ='warning'>ERROR: System malfunction. Service recommended!</span>")
handle_regular_hud_updates()
handle_vision()
@@ -24,7 +36,8 @@
handle_statuses()
if(health <= 0)
death(null,"gives one shrill beep before falling lifeless.")
card.death_damage()
death(null,"fizzles out and clatters to the floor...")
else if(health < maxHealth && istype(src.loc , /obj/item/device/paicard))
adjustBruteLoss(-0.5)
adjustFireLoss(-0.5)

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
@@ -248,6 +251,9 @@
if(src.loc != card)
return
if(card.projector != PP_FUNCTIONAL && card.emitter != PP_FUNCTIONAL)
to_chat(src, "<span class ='warning'>ERROR: System malfunction. Service required!</span>")
if(world.time <= last_special)
to_chat(src, "<span class ='warning'>You can't unfold yet.</span>")
return
@@ -285,6 +291,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.")
@@ -409,7 +416,7 @@
close_up()
//I'm not sure how much of this is necessary, but I would rather avoid issues.
/mob/living/silicon/pai/proc/close_up()
/mob/living/silicon/pai/proc/close_up(silent= FALSE)
last_special = world.time + 100
@@ -419,7 +426,7 @@
release_vore_contents(FALSE) //VOREStation Add
var/turf/T = get_turf(src)
if(istype(T)) T.visible_message("<b>[src]</b> neatly folds inwards, compacting down to a rectangular card.")
if(istype(T) && !silent) T.visible_message("<b>[src]</b> neatly folds inwards, compacting down to a rectangular card.")
if(client)
src.stop_pulling()

View File

@@ -67,8 +67,26 @@
/mob/living/silicon/pai/Login()
. = ..()
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"
/mob/living/silicon/pai/proc/full_restore()
adjustBruteLoss(- bruteloss)
adjustFireLoss(- fireloss)
do_after(src, 1 SECONDS)
card.setEmotion(16)
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))
set name = "pAI Nom"
@@ -208,6 +226,13 @@
// Release belly contents before being gc'd!
/mob/living/silicon/pai/Destroy()
release_vore_contents()
if(ckey)
paikeys -= ckey
return ..()
/mob/living/silicon/pai/clear_client()
if(ckey)
paikeys -= ckey
return ..()
/mob/living/silicon/pai/proc/add_eyes()
@@ -483,7 +508,10 @@
to_chat(G, "<span class='cult'>[src.name]'s screen prints, \"[message]\"</span>")
/mob/living/silicon/pai/proc/touch_window(soft_name) //This lets us touch TGUI procs and windows that may be nested behind other TGUI procs and windows
for(var/thing in software) //so we can access our software without having to open up the software interface TGUI window
if(stat != CONSCIOUS) //so we can access our software without having to open up the software interface TGUI window
to_chat(src, "<span class ='warning'>You can't do that right now.</span>")
return
for(var/thing in software)
var/datum/pai_software/S = software[thing]
if(istype(S, /datum/pai_software) && S.name == soft_name)
if(S.toggle)
@@ -617,3 +645,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()

View File

@@ -37,6 +37,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates
if(istype(card,/obj/item/device/paicard) && istype(candidate,/datum/paiCandidate))
var/mob/living/silicon/pai/pai = new(card)
pai.key = candidate.key
paikeys |= pai.ckey
card.setPersonality(pai)
if(!candidate.name)
pai.SetName(pick(ninja_names))
@@ -378,6 +379,16 @@ var/datum/paiController/paiController // Global handler for pAI candidates
if(!C) return
asked.Add(C.key)
asked[C.key] = world.time
var/mob/ourmob = C.mob
if(ourmob)
var/time_till_respawn = ourmob.time_till_respawn()
if(time_till_respawn == -1 || time_till_respawn)
return
for(var/ourkey in paikeys)
if(ourkey == ourmob.ckey)
return
var/response = tgui_alert(C, "[inquirer] is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", list("Yes", "No", "Never for this round"))
if(!C) return //handle logouts that happen whilst the alert is waiting for a response.
if(response == "Yes")

View File

@@ -1,5 +1,7 @@
/mob/living/silicon/pai/say(var/message, var/datum/language/speaking = null, var/whispering = 0)
if(silence_time)
to_chat(src, "<font color=green>Communication circuits remain uninitialized.</font>")
else if(card.speech_synthesizer != PP_FUNCTIONAL)
to_chat(src, "<span class='warning'>Communication circuits damaged. Service required.</span>")
else
..()

View File

@@ -369,7 +369,7 @@
popup.set_content(dat)
popup.open()
/mob/new_player/proc/time_till_respawn()
/mob/proc/time_till_respawn()
if(!ckey)
return -1 // What?

View File

@@ -49,3 +49,46 @@
req_tech = list(TECH_COMBAT = 6, TECH_MATERIAL = 5, TECH_POWER = 4)
materials = list(MAT_PLASTEEL = 5000, MAT_GLASS = 1000, MAT_URANIUM = 500, MAT_PLATINUM = 350)
build_path = /obj/item/borg/upgrade/pka
///// pAI parts!!!
//////////////////// Cyborg Parts ////////////////////
/datum/design/item/prosfab/paiparts
category = list("pAI Parts")
time = 20
materials = list(MAT_STEEL = 1000, MAT_GLASS = 1000)
/datum/design/item/prosfab/paiparts/cell
name = "pAI Cell"
id = "pai_cell"
build_path = /obj/item/paiparts/cell
/datum/design/item/prosfab/paiparts/processor
name = "pAI Processor"
id = "pai_processor"
build_path = /obj/item/paiparts/processor
/datum/design/item/prosfab/paiparts/board
name = "pAI Board"
id = "pai_board"
build_path = /obj/item/paiparts/board
/datum/design/item/prosfab/paiparts/capacitor
name = "pAI capacitor"
id = "pai_capacitor"
build_path = /obj/item/paiparts/capacitor
/datum/design/item/prosfab/paiparts/projector
name = "pAI Projector"
id = "pai_projector"
build_path = /obj/item/paiparts/projector
/datum/design/item/prosfab/paiparts/emitter
name = "pAI Emitter"
id = "pai_emitter"
build_path = /obj/item/paiparts/emitter
/datum/design/item/prosfab/paiparts/speech_synthesizer
name = "pAI Speech Synthesizer"
id = "pai_speech_synthesizer"
build_path = /obj/item/paiparts/speech_synthesizer

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -59,7 +59,7 @@
layer = 3.3;
pixel_y = 30
},
/turf/simulated/floor/carpet/deco,
/turf/simulated/floor/carpet/geo,
/area/submap/groundbase/poi/wildvillage/wide/wide5)
"j" = (
/obj/structure/bed/chair/office/light{
@@ -138,7 +138,7 @@
/turf/simulated/floor/bmarble,
/area/submap/groundbase/poi/wildvillage/wide/wide5)
"u" = (
/turf/simulated/floor/carpet/deco,
/turf/simulated/floor/carpet/geo,
/area/submap/groundbase/poi/wildvillage/wide/wide5)
"v" = (
/turf/simulated/floor/bmarble,
@@ -150,7 +150,7 @@
/obj/structure/curtain/open/bed{
color = "#5e0c1d"
},
/turf/simulated/floor/carpet/deco,
/turf/simulated/floor/carpet/geo,
/area/submap/groundbase/poi/wildvillage/wide/wide5)
"y" = (
/obj/machinery/light/small{
@@ -170,14 +170,14 @@
/obj/structure/table/standard,
/obj/random/maintenance/misc,
/obj/random/maintenance/misc,
/turf/simulated/floor/carpet/deco,
/turf/simulated/floor/carpet/geo,
/area/submap/groundbase/poi/wildvillage/wide/wide5)
"B" = (
/turf/simulated/wall,
/area/submap/groundbase/poi/wildvillage/wide/wide5)
"C" = (
/obj/structure/undies_wardrobe,
/turf/simulated/floor/carpet/deco,
/turf/simulated/floor/carpet/geo,
/area/submap/groundbase/poi/wildvillage/wide/wide5)
"D" = (
/obj/structure/table/rack/shelf,
@@ -284,7 +284,7 @@
/obj/structure/table/standard,
/obj/random/maintenance/misc,
/obj/random/maintenance/misc,
/turf/simulated/floor/carpet/deco,
/turf/simulated/floor/carpet/geo,
/area/submap/groundbase/poi/wildvillage/wide/wide5)
"V" = (
/obj/structure/bed/chair/sofa/corp/left,
@@ -297,7 +297,7 @@
color = "#4287f5"
},
/obj/machinery/light/small,
/turf/simulated/floor/carpet/deco,
/turf/simulated/floor/carpet/geo,
/area/submap/groundbase/poi/wildvillage/wide/wide5)
"X" = (
/obj/machinery/door/airlock/silver{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

View File

@@ -1255,7 +1255,11 @@
#include "code\game\objects\items\devices\modkit.dm"
#include "code\game\objects\items\devices\multitool.dm"
#include "code\game\objects\items\devices\paicard.dm"
<<<<<<< HEAD
#include "code\game\objects\items\devices\paicard_ch.dm"
=======
#include "code\game\objects\items\devices\paicard_vr.dm"
>>>>>>> e1dca305a0... Merge pull request #13180 from Very-Soft/paideath
#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"