mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 23:48:28 +01:00
Add AI latejoining, fix Ofitser again, blob damages pods
This commit is contained in:
@@ -115,4 +115,7 @@
|
||||
H.l_store.add_fingerprint(H,1)
|
||||
if(H.r_store)
|
||||
H.r_store.add_fingerprint(H,1)
|
||||
return 1
|
||||
return 1
|
||||
|
||||
/datum/job/proc/is_position_available()
|
||||
return (current_positions < total_positions) || (total_positions == -1)
|
||||
@@ -2,7 +2,7 @@
|
||||
title = "AI"
|
||||
flag = AI
|
||||
department_flag = ENGSEC
|
||||
total_positions = 0
|
||||
total_positions = 0 // Not used for AI, see is_position_available below and modules/mob/living/silicon/ai/latejoin.dm
|
||||
spawn_positions = 1
|
||||
selection_color = "#ccffcc"
|
||||
supervisors = "your laws"
|
||||
@@ -13,7 +13,9 @@
|
||||
if(!H) return 0
|
||||
return 1
|
||||
|
||||
|
||||
/datum/job/ai/is_position_available()
|
||||
return (empty_playable_ai_cores.len != 0)
|
||||
|
||||
|
||||
/datum/job/cyborg
|
||||
title = "Cyborg"
|
||||
|
||||
@@ -443,7 +443,9 @@ var/global/datum/controller/occupations/job_master
|
||||
switch(rank)
|
||||
if("Cyborg")
|
||||
return H.Robotize()
|
||||
if("AI","Clown") //don't need bag preference stuff!
|
||||
if("AI")
|
||||
return H
|
||||
if("Clown") //don't need bag preference stuff!
|
||||
if(rank=="Clown") // Clowns DO need to breathe, though - N3X
|
||||
H.species.equip(H)
|
||||
else
|
||||
|
||||
@@ -565,7 +565,7 @@ obj/machinery/bot/proc/start_patrol()
|
||||
send_status()
|
||||
if(awaiting_beacon) // awaiting beacon response
|
||||
awaiting_beacon++
|
||||
if(awaiting_beacon > 20) // wait 20 secs for beacon response
|
||||
if(awaiting_beacon > 40) // wait 40 secs for beacon response
|
||||
find_nearest_beacon() // then go to nearest instead
|
||||
return
|
||||
if(next_destination)
|
||||
@@ -583,7 +583,7 @@ obj/machinery/bot/proc/start_patrol()
|
||||
new_destination = "__nearest__"
|
||||
post_signal(beacon_freq, "findbeacon", "patrol")
|
||||
awaiting_beacon = 1
|
||||
spawn(100)
|
||||
spawn(150)
|
||||
awaiting_beacon = 0
|
||||
if(nearest_beacon)
|
||||
set_destination(nearest_beacon)
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
spawn(3)
|
||||
var/datum/job/detective/J = new/datum/job/detective
|
||||
botcard.access = J.get_access()
|
||||
botcard.access += 2
|
||||
prev_access = botcard.access
|
||||
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
|
||||
var/datum/job/detective/J = new/datum/job/detective
|
||||
botcard.access = J.get_access()
|
||||
botcard.access += 2
|
||||
prev_access = botcard.access
|
||||
add_to_beacons(bot_filter)
|
||||
|
||||
|
||||
@@ -156,11 +156,15 @@
|
||||
if(istype(P, /obj/item/weapon/screwdriver))
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "<span class='notice'>You connect the monitor.</span>"
|
||||
if(!laws.inherent.len) //If laws isn't set to null but nobody supplied a board, the AI would normally be created lawless. We don't want that.
|
||||
laws = null
|
||||
var/mob/living/silicon/ai/A = new /mob/living/silicon/ai (loc, laws, brain)
|
||||
if(A) //if there's no brain, the mob is deleted and a structure/AIcore is created
|
||||
A.rename_self("ai", 1)
|
||||
if(!brain)
|
||||
var/open_for_latejoin = alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", "Yes", "Yes", "No") == "Yes"
|
||||
var/obj/structure/AIcore/deactivated/D = new(loc)
|
||||
if(open_for_latejoin)
|
||||
empty_playable_ai_cores += D
|
||||
else
|
||||
var/mob/living/silicon/ai/A = new /mob/living/silicon/ai ( loc, laws, brain )
|
||||
if(A) //if there's no brain, the mob is deleted and a structure/AIcore is created
|
||||
A.rename_self("ai", 1)
|
||||
feedback_inc("cyborg_ais_created",1)
|
||||
del(src)
|
||||
|
||||
@@ -171,10 +175,53 @@
|
||||
anchored = 1
|
||||
state = 20//So it doesn't interact based on the above. Not really necessary.
|
||||
|
||||
attackby(var/obj/item/device/aicard/A as obj, var/mob/user as mob)
|
||||
if(istype(A, /obj/item/device/aicard))//Is it?
|
||||
A.transfer_ai("INACTIVE","AICARD",src,user)
|
||||
return
|
||||
/obj/structure/AIcore/deactivated/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
if(istype(W, /obj/item/device/aicard))//Is it?
|
||||
var/obj/item/device/aicard/card = W
|
||||
card.transfer_ai("INACTIVE","AICARD",src,user)
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
if(anchored)
|
||||
user.visible_message("\blue \The [user] starts to unbolt \the [src] from the plating...")
|
||||
if(!do_after(user,40))
|
||||
user.visible_message("\blue \The [user] decides not to unbolt \the [src].")
|
||||
return
|
||||
user.visible_message("\blue \The [user] finishes unfastening \the [src]!")
|
||||
anchored = 0
|
||||
return
|
||||
else
|
||||
user.visible_message("\blue \The [user] starts to bolt \the [src] to the plating...")
|
||||
if(!do_after(user,40))
|
||||
user.visible_message("\blue \The [user] decides not to bolt \the [src].")
|
||||
return
|
||||
user.visible_message("\blue \The [user] finishes fastening down \the [src]!")
|
||||
anchored = 1
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
/client/proc/empty_ai_core_toggle_latejoin()
|
||||
set name = "Toggle AI Core Latejoin"
|
||||
set category = "Admin"
|
||||
|
||||
var/list/cores = list()
|
||||
for(var/obj/structure/AIcore/deactivated/D in world)
|
||||
cores["[D] ([D.loc.loc])"] = D
|
||||
|
||||
if(!cores.len)
|
||||
src << "No deactivated AI cores were found."
|
||||
|
||||
var/id = input("Which core?", "Toggle AI Core Latejoin", null) as null|anything in cores
|
||||
if(!id) return
|
||||
|
||||
var/obj/structure/AIcore/deactivated/D = cores[id]
|
||||
if(!D) return
|
||||
|
||||
if(D in empty_playable_ai_cores)
|
||||
empty_playable_ai_cores -= D
|
||||
src << "\The [id] is now <font color=\"#ff0000\">not available</font> for latejoining AIs."
|
||||
else
|
||||
empty_playable_ai_cores += D
|
||||
src << "\The [id] is now <font color=\"#008000\">available</font> for latejoining AIs."
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -75,6 +75,10 @@
|
||||
if(P.damage && !P.nodamage)
|
||||
deal_damage(P.damage)
|
||||
|
||||
/obj/spacepod/blob_act()
|
||||
deal_damage(30)
|
||||
return
|
||||
|
||||
/obj/spacepod/attack_animal(mob/living/simple_animal/user as mob)
|
||||
if(user.melee_damage_upper == 0)
|
||||
user.emote("[user.friendly] [src]")
|
||||
|
||||
+4
-1
@@ -332,4 +332,7 @@ var/recall_time_limit=72000
|
||||
var/global/list/alphabet_uppercase = list("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")
|
||||
|
||||
// AI controlled bots
|
||||
var/global/list/aibots = list()
|
||||
var/global/list/aibots = list()
|
||||
|
||||
// Announcer intercom, because too much stuff creates an intercom for one message then hard del()s it.
|
||||
var/global/obj/item/device/radio/intercom/global_announcer = new(null)
|
||||
@@ -64,7 +64,8 @@ var/list/admin_verbs_admin = list(
|
||||
/client/proc/man_up,
|
||||
/client/proc/global_man_up,
|
||||
/client/proc/delbook,
|
||||
/client/proc/event_manager_panel
|
||||
/client/proc/event_manager_panel,
|
||||
/client/proc/empty_ai_core_toggle_latejoin
|
||||
)
|
||||
var/list/admin_verbs_ban = list(
|
||||
/client/proc/unban_panel,
|
||||
|
||||
@@ -115,7 +115,7 @@ var/list/ai_list = list()
|
||||
|
||||
if(!safety)//Only used by AIize() to successfully spawn an AI.
|
||||
if (!B)//If there is no player/brain inside.
|
||||
new/obj/structure/AIcore/deactivated(loc)//New empty terminal.
|
||||
empty_playable_ai_cores += new/obj/structure/AIcore/deactivated(loc)//New empty terminal.
|
||||
del(src)//Delete AI.
|
||||
return
|
||||
else
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
proc/IsJobAvailable(rank)
|
||||
var/datum/job/job = job_master.GetJob(rank)
|
||||
if(!job) return 0
|
||||
if((job.current_positions >= job.total_positions) && job.total_positions != -1) return 0
|
||||
if(!job.is_position_available()) return 0
|
||||
if(jobban_isbanned(src,rank)) return 0
|
||||
if(!is_job_whitelisted(src, rank)) return 0
|
||||
if(!job.player_old_enough(src.client)) return 0
|
||||
@@ -309,6 +309,24 @@
|
||||
EquipRacialItems(character)
|
||||
character = job_master.EquipRank(character, rank, 1) //equips the human
|
||||
EquipCustomItems(character)
|
||||
|
||||
// AIs don't need a spawnpoint, they must spawn at an empty core
|
||||
if(character.mind.assigned_role == "AI")
|
||||
|
||||
character = character.AIize(move=0) // AIize the character, but don't move them yet
|
||||
|
||||
// IsJobAvailable for AI checks that there is an empty core available in this list
|
||||
var/obj/structure/AIcore/deactivated/C = empty_playable_ai_cores[1]
|
||||
empty_playable_ai_cores -= C
|
||||
|
||||
character.loc = C.loc
|
||||
|
||||
AnnounceCyborg(character, rank, "has been downloaded to the empty core in \the [character.loc.loc]")
|
||||
ticker.mode.latespawn(character)
|
||||
|
||||
del(C)
|
||||
del(src)
|
||||
return
|
||||
|
||||
//Find our spawning point.
|
||||
var/join_message
|
||||
@@ -364,13 +382,11 @@
|
||||
arrivalmessage = replacetext(arrivalmessage,"$rank",rank ? "[rank]" : "visitor")
|
||||
announcer.say(";[arrivalmessage]")
|
||||
else
|
||||
var/obj/item/device/radio/intercom/a = new /obj/item/device/radio/intercom(null)// BS12 EDIT Arrivals Announcement Computer, rather than the AI.
|
||||
if(character.mind)
|
||||
if((character.mind.assigned_role != "Cyborg") && (character.mind.special_role != "MODE"))
|
||||
if(character.mind.role_alt_title)
|
||||
rank = character.mind.role_alt_title
|
||||
a.autosay("[character.real_name],[rank ? " [rank]," : " visitor," ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer")
|
||||
del(a)
|
||||
global_announcer.autosay("[character.real_name],[rank ? " [rank]," : " visitor," ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer")
|
||||
|
||||
proc/AnnounceCyborg(var/mob/living/character, var/rank, var/join_message)
|
||||
if (ticker.current_state == GAME_STATE_PLAYING)
|
||||
@@ -384,12 +400,10 @@
|
||||
var/arrivalmessage = "A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"]."
|
||||
announcer.say(";[arrivalmessage]")
|
||||
else
|
||||
var/obj/item/device/radio/intercom/a = new /obj/item/device/radio/intercom(null)// BS12 EDIT Arrivals Announcement Computer, rather than the AI.
|
||||
if(character.mind)
|
||||
if((character.mind.special_role != "MODE"))
|
||||
// can't use their name here, since cyborg namepicking is done post-spawn, so we'll just say "A new Cyborg has arrived"/"A new Android has arrived"/etc.
|
||||
a.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer")
|
||||
del(a)
|
||||
global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer")
|
||||
|
||||
proc/LateChoices()
|
||||
var/mills = world.time // 1/10 of a second, not real milliseconds but whatever
|
||||
|
||||
@@ -61,13 +61,13 @@
|
||||
spawning = 1
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/AIize()
|
||||
/mob/living/carbon/human/AIize(move=1) // 'move' argument needs defining here too because BYOND is dumb
|
||||
if (monkeyizing)
|
||||
return
|
||||
for(var/t in organs)
|
||||
del(t)
|
||||
|
||||
return ..()
|
||||
return ..(move)
|
||||
|
||||
/mob/living/carbon/AIize()
|
||||
if (monkeyizing)
|
||||
@@ -80,7 +80,7 @@
|
||||
invisibility = 101
|
||||
return ..()
|
||||
|
||||
/mob/proc/AIize()
|
||||
/mob/proc/AIize(move=1)
|
||||
if(client)
|
||||
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // stop the jams for AIs
|
||||
var/mob/living/silicon/ai/O = new (loc,,,1)//No MMI but safety is in effect.
|
||||
@@ -93,28 +93,29 @@
|
||||
else
|
||||
O.key = key
|
||||
|
||||
var/obj/loc_landmark
|
||||
for(var/obj/effect/landmark/start/sloc in landmarks_list)
|
||||
if (sloc.name != "AI")
|
||||
continue
|
||||
if (locate(/mob/living) in sloc.loc)
|
||||
continue
|
||||
loc_landmark = sloc
|
||||
if (!loc_landmark)
|
||||
for(var/obj/effect/landmark/tripai in landmarks_list)
|
||||
if (tripai.name == "tripai")
|
||||
if(locate(/mob/living) in tripai.loc)
|
||||
continue
|
||||
loc_landmark = tripai
|
||||
if (!loc_landmark)
|
||||
O << "Oh god sorry we can't find an unoccupied AI spawn location, so we're spawning you on top of someone."
|
||||
if(move)
|
||||
var/obj/loc_landmark
|
||||
for(var/obj/effect/landmark/start/sloc in landmarks_list)
|
||||
if (sloc.name == "AI")
|
||||
loc_landmark = sloc
|
||||
if (sloc.name != "AI")
|
||||
continue
|
||||
if ((locate(/mob/living) in sloc.loc) || (locate(/obj/structure/AIcore) in sloc.loc))
|
||||
continue
|
||||
loc_landmark = sloc
|
||||
if (!loc_landmark)
|
||||
for(var/obj/effect/landmark/tripai in landmarks_list)
|
||||
if (tripai.name == "tripai")
|
||||
if((locate(/mob/living) in tripai.loc) || (locate(/obj/structure/AIcore) in tripai.loc))
|
||||
continue
|
||||
loc_landmark = tripai
|
||||
if (!loc_landmark)
|
||||
O << "Oh god sorry we can't find an unoccupied AI spawn location, so we're spawning you on top of someone."
|
||||
for(var/obj/effect/landmark/start/sloc in landmarks_list)
|
||||
if (sloc.name == "AI")
|
||||
loc_landmark = sloc
|
||||
|
||||
O.loc = loc_landmark.loc
|
||||
for (var/obj/item/device/radio/intercom/comm in O.loc)
|
||||
comm.ai += O
|
||||
O.loc = loc_landmark.loc
|
||||
for (var/obj/item/device/radio/intercom/comm in O.loc)
|
||||
comm.ai += O
|
||||
|
||||
O << "<B>You are playing the station's AI. The AI cannot move, but can interact with many objects while viewing them (through cameras).</B>"
|
||||
O << "<B>To look at other parts of the station, click on yourself to get a camera menu.</B>"
|
||||
@@ -131,9 +132,9 @@
|
||||
O.job = "AI"
|
||||
|
||||
O.rename_self("ai",1)
|
||||
. = O
|
||||
del(src)
|
||||
|
||||
spawn(0)
|
||||
del(src)
|
||||
return O
|
||||
|
||||
/mob/living/carbon/human/make_into_mask(var/should_gib = 0)
|
||||
for(var/t in organs)
|
||||
|
||||
@@ -1255,6 +1255,7 @@
|
||||
#include "code\modules\mob\living\silicon\ai\ai.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\death.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\examine.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\latejoin.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\laws.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\life.dm"
|
||||
#include "code\modules\mob\living\silicon\ai\login.dm"
|
||||
|
||||
Reference in New Issue
Block a user