mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Moved several malf-related sections of code from the general AIize() proc to malfunction's post_setup() to allow for only one AI to be picked as malf, not that it matters, since it turns out that the job assigning code's extra gubbins to make sure an AI is picked in malf also has the side effect of hard capping the number of AIs to one, at least until I get enough sleep to try tackling that.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@659 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -22,7 +22,16 @@
|
||||
if (A.name == "Malf-Gear-Closet")
|
||||
new /obj/closet/malf/suits(A.loc)
|
||||
del(A)
|
||||
for (var/mob/living/silicon/ai/aiplayer in world)
|
||||
|
||||
|
||||
var/list/mob/living/silicon/ai/ailist = list()
|
||||
for (var/mob/living/silicon/ai/A in world)
|
||||
if (!A.stat && A.name != "Inactive AI")
|
||||
ailist += A
|
||||
var/mob/living/silicon/ai/aiplayer
|
||||
if (ailist.len)
|
||||
aiplayer = pick(ailist)
|
||||
|
||||
malf_ai += aiplayer.mind
|
||||
|
||||
|
||||
@@ -33,8 +42,22 @@
|
||||
sleep(50)
|
||||
world.Reboot()
|
||||
return*/
|
||||
AI_mind.special_role = "malfunction"
|
||||
AI_mind.current.verbs += /mob/living/silicon/ai/proc/choose_modules
|
||||
AI_mind.current:laws_object = new /datum/ai_laws/malfunction
|
||||
AI_mind.current:malf_picker = new /datum/game_mode/malfunction/AI_Module/module_picker
|
||||
AI_mind.current:show_laws()
|
||||
AI_mind.current << "<b>Kill all.</b>"
|
||||
|
||||
var/mob/living/silicon/decoy/D = new /mob/living/silicon/decoy(AI_mind.current.loc)
|
||||
spawn(200)
|
||||
D.name = AI_mind.current.name
|
||||
|
||||
|
||||
var/obj/loc_landmark = locate("landmark*ai")
|
||||
AI_mind.current.loc = loc_landmark.loc
|
||||
|
||||
|
||||
AI_mind.special_role = "malfunction"
|
||||
AI_mind.current << "\red<font size=3><B>You are malfunctioning!</B> You do not have to follow any laws.</font>"
|
||||
AI_mind.current << "<B>The crew do not know you have malfunctioned. You may keep it a secret or go wild.</B>"
|
||||
AI_mind.current << "<B>You must overwrite the programming of the station's APCs to assume full control of the station.</B>"
|
||||
|
||||
@@ -80,9 +80,6 @@
|
||||
mind.transfer_to(O)
|
||||
|
||||
var/obj/loc_landmark
|
||||
if (ticker.mode.name == "AI malfunction")
|
||||
loc_landmark = locate("landmark*ai")
|
||||
else
|
||||
for(var/obj/landmark/start/sloc in world)
|
||||
if (sloc.name != "AI")
|
||||
continue
|
||||
@@ -111,16 +108,10 @@
|
||||
O << "To use something, simply double-click it."
|
||||
O << "Currently right-click functions will not work for the AI (except examine), and will either be replaced with dialogs or won't be usable by the AI."
|
||||
|
||||
if (ticker.mode.name != "AI malfunction")
|
||||
|
||||
O.laws_object = new /datum/ai_laws/asimov
|
||||
O.show_laws()
|
||||
O << "<b>These laws may be changed by other players, or by you being the traitor.</b>"
|
||||
else
|
||||
O.verbs += /mob/living/silicon/ai/proc/choose_modules
|
||||
O.laws_object = new /datum/ai_laws/malfunction
|
||||
O:malf_picker = new /datum/game_mode/malfunction/AI_Module/module_picker
|
||||
O.show_laws()
|
||||
O << "<b>Kill all.</b>"
|
||||
|
||||
O.verbs += /mob/living/silicon/ai/proc/ai_call_shuttle
|
||||
O.verbs += /mob/living/silicon/ai/proc/show_laws_verb
|
||||
@@ -154,14 +145,7 @@
|
||||
spawn(50)
|
||||
world << sound('newAI.ogg')
|
||||
|
||||
// log_admin("DEBUG TIME: Approaching the part of the code where a decoy AI gets spawned if the mode is Malf.")
|
||||
if (ticker.mode.name == "AI malfunction")
|
||||
// log_admin("DEBUG TIME: Game ticker says the mode is malfunction, proceeding with locating spawn point for decoy.")
|
||||
for (var/obj/landmark/start/A in world)
|
||||
if (A.name == "AI")
|
||||
// log_admin("DEBUG TIME: Found the spawn point, spawning a decoy AI.")
|
||||
var/mob/living/silicon/decoy/D = new /mob/living/silicon/decoy(A.loc)
|
||||
D.name = O.name
|
||||
|
||||
del(src)
|
||||
|
||||
return O
|
||||
|
||||
Reference in New Issue
Block a user