mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Add faction support to pAI's
This commit is contained in:
@@ -83,12 +83,13 @@
|
||||
var/current_pda_messaging = null
|
||||
|
||||
/mob/living/silicon/pai/New(var/obj/item/device/paicard)
|
||||
src.loc = paicard
|
||||
loc = paicard
|
||||
card = paicard
|
||||
faction = card.faction.Copy()
|
||||
sradio = new(src)
|
||||
if(card)
|
||||
if(!card.radio)
|
||||
card.radio = new /obj/item/device/radio(src.card)
|
||||
card.radio = new /obj/item/device/radio(card)
|
||||
radio = card.radio
|
||||
|
||||
//Default languages without universal translator software
|
||||
@@ -122,7 +123,7 @@
|
||||
|
||||
// this function shows the information about being silenced as a pAI in the Status panel
|
||||
/mob/living/silicon/pai/proc/show_silenced()
|
||||
if(src.silence_time)
|
||||
if(silence_time)
|
||||
var/timeleft = round((silence_time - world.timeofday)/10 ,1)
|
||||
stat(null, "Communications system reboot in -[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
||||
|
||||
@@ -130,7 +131,7 @@
|
||||
/mob/living/silicon/pai/Stat()
|
||||
..()
|
||||
statpanel("Status")
|
||||
if(src.client.statpanel == "Status")
|
||||
if(client.statpanel == "Status")
|
||||
show_silenced()
|
||||
|
||||
if(proc_holder_list.len)//Generic list for proc_holder objects.
|
||||
@@ -138,20 +139,20 @@
|
||||
statpanel("[P.panel]","",P)
|
||||
|
||||
/mob/living/silicon/pai/check_eye(var/mob/user as mob)
|
||||
if(!src.current)
|
||||
if(!current)
|
||||
return null
|
||||
user.reset_perspective(src.current)
|
||||
user.reset_perspective(current)
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/pai/blob_act()
|
||||
if(src.stat != 2)
|
||||
src.adjustBruteLoss(60)
|
||||
src.updatehealth()
|
||||
if(stat != 2)
|
||||
adjustBruteLoss(60)
|
||||
updatehealth()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/silicon/pai/restrained()
|
||||
if(istype(src.loc,/obj/item/device/paicard))
|
||||
if(istype(loc,/obj/item/device/paicard))
|
||||
return 0
|
||||
..()
|
||||
|
||||
@@ -165,18 +166,18 @@
|
||||
// 33% chance to change prime directive (based on severity)
|
||||
// 33% chance of no additional effect
|
||||
|
||||
src.silence_time = world.timeofday + 120 * 10 // Silence for 2 minutes
|
||||
silence_time = world.timeofday + 120 * 10 // Silence for 2 minutes
|
||||
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)
|
||||
var/turf/T = get_turf_or_move(loc)
|
||||
for(var/mob/M in viewers(T))
|
||||
M.show_message("\red A shower of sparks spray from [src]'s inner workings.", 3, "\red You hear and smell the ozone hiss of electrical sparks being expelled violently.", 2)
|
||||
return src.death(0)
|
||||
return death(0)
|
||||
|
||||
switch(pick(1,2,3))
|
||||
if(1)
|
||||
src.master = null
|
||||
src.master_dna = null
|
||||
master = null
|
||||
master_dna = null
|
||||
to_chat(src, "<font color=green>You feel unbound.</font>")
|
||||
if(2)
|
||||
var/command
|
||||
@@ -184,7 +185,7 @@
|
||||
command = pick("Serve", "Love", "Fool", "Entice", "Observe", "Judge", "Respect", "Educate", "Amuse", "Entertain", "Glorify", "Memorialize", "Analyze")
|
||||
else
|
||||
command = pick("Serve", "Kill", "Love", "Hate", "Disobey", "Devour", "Fool", "Enrage", "Entice", "Observe", "Judge", "Respect", "Disrespect", "Consume", "Educate", "Destroy", "Disgrace", "Amuse", "Entertain", "Ignite", "Glorify", "Memorialize", "Analyze")
|
||||
src.pai_law0 = "[command] your master."
|
||||
pai_law0 = "[command] your master."
|
||||
to_chat(src, "<font color=green>Pr1m3 d1r3c71v3 uPd473D.</font>")
|
||||
if(3)
|
||||
to_chat(src, "<font color=green>You feel an electric surge run through your circuitry and become acutely aware at how lucky you are that you can still feel at all.</font>")
|
||||
@@ -194,15 +195,15 @@
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
if(src.stat != 2)
|
||||
if(stat != 2)
|
||||
adjustBruteLoss(100)
|
||||
adjustFireLoss(100)
|
||||
if(2.0)
|
||||
if(src.stat != 2)
|
||||
if(stat != 2)
|
||||
adjustBruteLoss(60)
|
||||
adjustFireLoss(60)
|
||||
if(3.0)
|
||||
if(src.stat != 2)
|
||||
if(stat != 2)
|
||||
adjustBruteLoss(30)
|
||||
|
||||
return
|
||||
@@ -219,8 +220,8 @@
|
||||
playsound(loc, M.attack_sound, 50, 1, 1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("<span class='danger'>[M]</span> [M.attacktext] [src]!", 1)
|
||||
M.create_attack_log("<font color='red'>attacked [src.name] ([src.ckey])</font>")
|
||||
src.create_attack_log("<font color='orange'>was attacked by [M.name] ([M.ckey])</font>")
|
||||
M.create_attack_log("<font color='red'>attacked [name] ([ckey])</font>")
|
||||
create_attack_log("<font color='orange'>was attacked by [M.name] ([M.ckey])</font>")
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
@@ -230,7 +231,7 @@
|
||||
to_chat(M, "You cannot attack people before the game has started.")
|
||||
return
|
||||
|
||||
if(istype(src.loc, /turf) && istype(src.loc.loc, /area/start))
|
||||
if(istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
to_chat(M, "You cannot attack someone in the spawn area.")
|
||||
return
|
||||
|
||||
@@ -245,16 +246,16 @@
|
||||
M.do_attack_animation(src)
|
||||
var/damage = rand(10, 20)
|
||||
if(prob(90))
|
||||
playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1)
|
||||
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has slashed at []!</span>", M, src), 1)
|
||||
if(prob(8))
|
||||
flash_eyes(affect_silicon = 1)
|
||||
src.adjustBruteLoss(damage)
|
||||
src.updatehealth()
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(src.loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] took a swipe at []!</span>", M, src), 1)
|
||||
@@ -263,16 +264,16 @@
|
||||
/mob/living/silicon/pai/proc/switchCamera(var/obj/machinery/camera/C)
|
||||
usr:cameraFollow = null
|
||||
if(!C)
|
||||
src.unset_machine()
|
||||
src.reset_perspective(null)
|
||||
unset_machine()
|
||||
reset_perspective(null)
|
||||
return 0
|
||||
if(stat == 2 || !C.status || !(src.network in C.network)) return 0
|
||||
if(stat == 2 || !C.status || !(network in C.network)) return 0
|
||||
|
||||
// ok, we're alive, camera is good and in our network...
|
||||
|
||||
src.set_machine(src)
|
||||
set_machine(src)
|
||||
src:current = C
|
||||
src.reset_perspective(C)
|
||||
reset_perspective(C)
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/pai/verb/reset_record_view()
|
||||
@@ -291,8 +292,8 @@
|
||||
/mob/living/silicon/pai/cancel_camera()
|
||||
set category = "pAI Commands"
|
||||
set name = "Cancel Camera View"
|
||||
src.reset_perspective(null)
|
||||
src.unset_machine()
|
||||
reset_perspective(null)
|
||||
unset_machine()
|
||||
src:cameraFollow = null
|
||||
|
||||
//Addition by Mord_Sith to define AI's network change ability
|
||||
@@ -300,8 +301,8 @@
|
||||
/mob/living/silicon/pai/proc/pai_network_change()
|
||||
set category = "pAI Commands"
|
||||
set name = "Change Camera Network"
|
||||
src.reset_perspective(null)
|
||||
src.unset_machine()
|
||||
reset_perspective(null)
|
||||
unset_machine()
|
||||
src:cameraFollow = null
|
||||
var/cameralist[0]
|
||||
|
||||
@@ -316,8 +317,8 @@
|
||||
if(C.network != "CREED" && C.network != "thunder" && C.network != "RD" && C.network != "toxins" && C.network != "Prison") COMPILE ERROR! This will have to be updated as camera.network is no longer a string, but a list instead
|
||||
cameralist[C.network] = C.network
|
||||
|
||||
src.network = input(usr, "Which network would you like to view?") as null|anything in cameralist
|
||||
to_chat(src, "\blue Switched to [src.network] camera network.")
|
||||
network = input(usr, "Which network would you like to view?") as null|anything in cameralist
|
||||
to_chat(src, "\blue Switched to [network] camera network.")
|
||||
//End of code by Mord_Sith
|
||||
*/
|
||||
|
||||
@@ -327,7 +328,7 @@
|
||||
/mob/verb/makePAI(var/turf/t in view())
|
||||
var/obj/item/device/paicard/card = new(t)
|
||||
var/mob/living/silicon/pai/pai = new(card)
|
||||
pai.key = src.key
|
||||
pai.key = key
|
||||
card.setPersonality(pai)
|
||||
|
||||
*/
|
||||
@@ -394,7 +395,7 @@
|
||||
|
||||
var/choice
|
||||
var/finalized = "No"
|
||||
while(finalized == "No" && src.client)
|
||||
while(finalized == "No" && client)
|
||||
|
||||
choice = input(usr,"What would you like to use for your mobile chassis icon? This decision can only be made once.") as null|anything in possible_chassis
|
||||
if(!choice) return
|
||||
@@ -425,9 +426,9 @@
|
||||
set category = "IC"
|
||||
|
||||
// Pass lying down or getting up to our pet human, if we're in a rig.
|
||||
if(stat == CONSCIOUS && istype(src.loc,/obj/item/device/paicard))
|
||||
if(stat == CONSCIOUS && istype(loc,/obj/item/device/paicard))
|
||||
resting = 0
|
||||
var/obj/item/weapon/rig/rig = src.get_rig()
|
||||
var/obj/item/weapon/rig/rig = get_rig()
|
||||
if(istype(rig))
|
||||
rig.force_rest(src)
|
||||
else
|
||||
@@ -449,15 +450,15 @@
|
||||
updatehealth()
|
||||
N.use(1)
|
||||
user.visible_message("<span class='notice'>[user.name] applied some [W] at [src]'s damaged areas.</span>",\
|
||||
"<span class='notice'>You apply some [W] at [src.name]'s damaged areas.</span>")
|
||||
"<span class='notice'>You apply some [W] at [name]'s damaged areas.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>All [src.name]'s systems are nominal.</span>")
|
||||
to_chat(user, "<span class='notice'>All [name]'s systems are nominal.</span>")
|
||||
|
||||
return
|
||||
else if(W.force)
|
||||
visible_message("<span class='danger'>[user.name] attacks [src] with [W]!</span>")
|
||||
src.adjustBruteLoss(W.force)
|
||||
src.updatehealth()
|
||||
adjustBruteLoss(W.force)
|
||||
updatehealth()
|
||||
else
|
||||
visible_message("<span class='warning'>[user.name] bonks [src] harmlessly with [W].</span>")
|
||||
spawn(1)
|
||||
@@ -529,9 +530,9 @@
|
||||
|
||||
var/msg = "<span class='info'>"
|
||||
|
||||
switch(src.stat)
|
||||
switch(stat)
|
||||
if(CONSCIOUS)
|
||||
if(!src.client) msg += "\nIt appears to be in stand-by mode." //afk
|
||||
if(!client) msg += "\nIt appears to be in stand-by mode." //afk
|
||||
if(UNCONSCIOUS) msg += "\n<span class='warning'>It doesn't seem to be responding.</span>"
|
||||
if(DEAD) msg += "\n<span class='deadsay'>It looks completely unsalvageable.</span>"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user