mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 06:22:26 +01:00
More pAI Stuff (#10647)
This commit is contained in:
@@ -548,7 +548,10 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
|
||||
var/datum/progressbar/progbar
|
||||
if (display_progress && user.client && (user.client.prefs.toggles_secondary & PROGRESS_BARS))
|
||||
progbar = new(user, delay, target)
|
||||
var/atom/loc_check = target
|
||||
for(var/i = 0; !isturf(loc_check.loc) && i < 5; i++)
|
||||
loc_check = target.loc
|
||||
progbar = new(user, delay, loc_check)
|
||||
|
||||
var/endtime = world.time + delay
|
||||
var/starttime = world.time
|
||||
|
||||
@@ -259,9 +259,8 @@
|
||||
return
|
||||
|
||||
/atom/proc/ShiftClick(var/mob/user)
|
||||
if(user.client && user.client.eye == user)
|
||||
if(user.can_examine())
|
||||
user.examinate(src)
|
||||
return
|
||||
|
||||
/*
|
||||
Ctrl click
|
||||
|
||||
@@ -223,6 +223,6 @@
|
||||
/mob/living/silicon/robot/RangedAttack(atom/A)
|
||||
A.attack_robot(src)
|
||||
|
||||
/atom/proc/attack_robot(mob/user as mob)
|
||||
/atom/proc/attack_robot(mob/user)
|
||||
attack_ai(user)
|
||||
return
|
||||
return
|
||||
@@ -2,6 +2,10 @@
|
||||
/atom/proc/attack_generic(mob/user as mob)
|
||||
return 0
|
||||
|
||||
// generic click on for pai
|
||||
/atom/proc/attack_pai(mob/user)
|
||||
return
|
||||
|
||||
/*
|
||||
Humans:
|
||||
Adds an exception for gloves, to allow special glove types like the ninja ones.
|
||||
|
||||
@@ -1521,9 +1521,14 @@ About the new airlock wires panel:
|
||||
if(AM.blocks_airlock())
|
||||
close_door_in(6)
|
||||
return
|
||||
var/has_opened_hatch = FALSE
|
||||
for(var/turf/turf in locs)
|
||||
for(var/atom/movable/AM in turf)
|
||||
if(AM.airlock_crush(DOOR_CRUSH_DAMAGE))
|
||||
if(hashatch && AM.checkpass(PASSDOORHATCH))
|
||||
if(!has_opened_hatch)
|
||||
open_hatch(AM)
|
||||
has_opened_hatch = TRUE
|
||||
else if(AM.airlock_crush(DOOR_CRUSH_DAMAGE))
|
||||
take_damage(DOOR_CRUSH_DAMAGE)
|
||||
use_power(360) //360 W seems much more appropriate for an actuator moving an industrial door capable of crushing people
|
||||
if(arePowerSystemsOn())
|
||||
|
||||
@@ -45,9 +45,10 @@
|
||||
pai.death(0)
|
||||
return ..()
|
||||
|
||||
/obj/item/device/paicard/attackby(obj/item/C as obj, mob/user as mob)
|
||||
/obj/item/device/paicard/attackby(obj/item/C, mob/user)
|
||||
if(istype(C, /obj/item/card/id))
|
||||
scan_ID(C, user)
|
||||
return
|
||||
else if(istype(C, /obj/item/device/encryptionkey))
|
||||
if(length(installed_encryptionkeys) > 2)
|
||||
to_chat(user, SPAN_WARNING("\The [src] already has the full number of possible encryption keys installed!"))
|
||||
@@ -67,6 +68,7 @@
|
||||
to_chat(pai, SPAN_NOTICE("You now have access to these radio channels: [english_list(radio.channels)]."))
|
||||
else
|
||||
to_chat(user, SPAN_WARNING("\The [src] would not gain any new channels from \the [EK]."))
|
||||
return
|
||||
else if(C.isscrewdriver())
|
||||
if(!length(installed_encryptionkeys))
|
||||
to_chat(user, SPAN_WARNING("There are no installed encryption keys to remove!"))
|
||||
@@ -77,6 +79,12 @@
|
||||
EK.forceMove(get_turf(src))
|
||||
installed_encryptionkeys -= EK
|
||||
recalculateChannels()
|
||||
return
|
||||
else if(istype(C, /obj/item/stack/nanopaste))
|
||||
if(!pai)
|
||||
to_chat(user, SPAN_WARNING("You cannot repair a pAI device if there's no active pAI personality installed."))
|
||||
return
|
||||
pai.attackby(C, user)
|
||||
|
||||
/obj/item/device/paicard/proc/recalculateChannels()
|
||||
radio.channels = list("Common" = radio.FREQ_LISTENING, "Entertainment" = radio.FREQ_LISTENING)
|
||||
|
||||
@@ -22,12 +22,13 @@
|
||||
else
|
||||
icon_state = "[initial(icon_state)]-empty"
|
||||
|
||||
/obj/item/stack/nanopaste/attack(mob/living/M as mob, mob/user as mob, var/target_zone)
|
||||
if (!istype(M) || !istype(user))
|
||||
/obj/item/stack/nanopaste/attack(atom/M, mob/user, var/target_zone)
|
||||
if(!ismob(M) || !istype(user))
|
||||
return 0
|
||||
if (!can_use(1, user))
|
||||
return 0
|
||||
if (istype(M,/mob/living/silicon/robot)) //Repairing cyborgs
|
||||
|
||||
if (isrobot(M)) //Repairing cyborgs
|
||||
var/mob/living/silicon/robot/R = M
|
||||
if (R.getBruteLoss() || R.getFireLoss() )
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
@@ -41,7 +42,7 @@
|
||||
else
|
||||
to_chat(user, "<span class='notice'>All [R]'s systems are nominal.</span>")
|
||||
|
||||
if (istype(M,/mob/living/carbon/human)) //Repairing robolimbs
|
||||
else if(ishuman(M)) //Repairing robolimbs
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/obj/item/organ/external/S = H.get_organ(target_zone)
|
||||
|
||||
|
||||
@@ -82,3 +82,15 @@
|
||||
var/is_cult = mind?.special_role == "Cultist" || isobserver(src)
|
||||
if(client)
|
||||
client.update_description_holders(A, is_antag, is_cult)
|
||||
|
||||
/mob/proc/can_examine()
|
||||
if(client?.eye == src)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/living/silicon/pai/can_examine()
|
||||
. = ..()
|
||||
if(!.)
|
||||
var/atom/our_holder = recursive_loc_turf_check(src, 5)
|
||||
if(isturf(our_holder.loc)) // are we folded in on the ground
|
||||
return TRUE
|
||||
@@ -66,6 +66,9 @@
|
||||
set name = "Access Local Computer"
|
||||
set category = "Subsystems"
|
||||
|
||||
if(!parent_computer)
|
||||
to_chat(usr, SPAN_WARNING("You don't have a local computer to interface with!"))
|
||||
return
|
||||
parent_computer.attack_self(src)
|
||||
|
||||
/********************
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
mob_size = 1//As a holographic projection, a pAI is massless except for its card device
|
||||
can_pull_size = 2 //max size for an object the pAI can pull
|
||||
|
||||
|
||||
var/network = "SS13"
|
||||
var/obj/machinery/camera/current = null
|
||||
var/ram = 100 // Used as currency to purchase different abilities
|
||||
@@ -181,6 +180,7 @@
|
||||
verbs += /mob/living/silicon/pai/proc/choose_chassis
|
||||
verbs += /mob/living/silicon/pai/proc/choose_verbs
|
||||
verbs += /mob/living/silicon/proc/computer_interact
|
||||
verbs += /mob/living/silicon/pai/proc/personal_computer_interact
|
||||
verbs += /mob/living/silicon/proc/silicon_mimic_accent
|
||||
|
||||
. = ..()
|
||||
@@ -429,7 +429,21 @@
|
||||
canmove = !resting
|
||||
|
||||
//Overriding this will stop a number of headaches down the track.
|
||||
/mob/living/silicon/pai/attackby(obj/item/W as obj, mob/user as mob)
|
||||
/mob/living/silicon/pai/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/stack/nanopaste))
|
||||
var/obj/item/stack/nanopaste/N = W
|
||||
if(getBruteLoss() || getFireLoss())
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
if(do_mob(user, src, 1 SECOND))
|
||||
adjustBruteLoss(-50) // these numbers are so high to make it so that people don't have to waste nanopaste on basic pAI
|
||||
adjustFireLoss(-50)
|
||||
updatehealth()
|
||||
N.use(1)
|
||||
user.visible_message("<b>[user]</b> applies some [N] at [src]'s damaged areas.", SPAN_NOTICE("You apply some [N] at [src]'s damaged areas."))
|
||||
else
|
||||
to_chat(user, SPAN_NOTICE("All [src]'s systems are nominal."))
|
||||
return
|
||||
|
||||
if(W.force)
|
||||
visible_message("<span class='danger'>[user.name] attacks [src] with [W]!</span>")
|
||||
src.adjustBruteLoss(W.force)
|
||||
@@ -437,8 +451,6 @@
|
||||
else
|
||||
visible_message("<span class='warning'>[user.name] bonks [src] harmlessly with [W].</span>")
|
||||
|
||||
return
|
||||
|
||||
/mob/living/silicon/pai/AltClick(mob/user as mob)
|
||||
if(!user || user.stat || user.lying || user.restrained() || !Adjacent(user)) return
|
||||
visible_message("<span class='danger'>[user.name] boops [src] on the head.</span>")
|
||||
@@ -514,6 +526,8 @@
|
||||
to_chat(src, "<span class='warning'>You are too small to pull that.</span>")
|
||||
return
|
||||
|
||||
/mob/living/silicon/pai/UnarmedAttack(atom/A, proximity)
|
||||
A.attack_pai(src)
|
||||
|
||||
/mob/living/silicon/pai/verb/select_card_icon()
|
||||
set category = "pAI Commands"
|
||||
|
||||
@@ -69,7 +69,6 @@
|
||||
to_chat(user, SPAN_NOTICE("You install \the [H] into \the [src]."))
|
||||
verbs += /obj/item/modular_computer/proc/eject_personal_ai
|
||||
personal_ai.pai.parent_computer = src
|
||||
personal_ai.pai.verbs += /mob/living/silicon/pai/proc/personal_computer_interact
|
||||
to_chat(personal_ai.pai, SPAN_NOTICE("You gain access to \the [src]'s computronics."))
|
||||
user.drop_from_inventory(H, src)
|
||||
update_icon()
|
||||
@@ -119,7 +118,6 @@
|
||||
H.forceMove(get_turf(src))
|
||||
if(put_in_hands)
|
||||
user.put_in_hands(H)
|
||||
personal_ai.pai.verbs -= /mob/living/silicon/pai/proc/personal_computer_interact
|
||||
to_chat(personal_ai.pai, SPAN_NOTICE("You lose access to \the [src]'s computronics."))
|
||||
personal_ai.pai.parent_computer = null
|
||||
update_icon()
|
||||
|
||||
@@ -188,6 +188,10 @@
|
||||
return attack_self(user)
|
||||
return ..()
|
||||
|
||||
// pai can take a look, but they cannot interact with the UI
|
||||
/obj/item/modular_computer/attack_pai(mob/user)
|
||||
return attack_self(user)
|
||||
|
||||
// On-click handling. Turns on the computer if it's off and opens the GUI.
|
||||
/obj/item/modular_computer/attack_self(mob/user)
|
||||
if(enabled && screen_on)
|
||||
|
||||
Reference in New Issue
Block a user