mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 20:47:10 +01:00
@@ -591,6 +591,7 @@ proc/get_nt_opposed()
|
||||
if(BE_TRAITOR) roletext="traitor"
|
||||
if(BE_OPERATIVE) roletext="operative"
|
||||
if(BE_WIZARD) roletext="wizard"
|
||||
if(BE_MALF) roletext="malf AI"
|
||||
if(BE_REV) roletext="revolutionary"
|
||||
if(BE_CULTIST) roletext="cultist"
|
||||
if(BE_NINJA) roletext="ninja"
|
||||
|
||||
@@ -350,7 +350,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
proc/create_characters()
|
||||
for(var/mob/new_player/player in player_list)
|
||||
if(player.ready && player.mind)
|
||||
if(player.mind.assigned_role=="AI")
|
||||
if(player.mind.assigned_role == "AI" || player.mind.special_role == "malfunctioning AI")
|
||||
player.close_spawn_windows()
|
||||
player.AIize()
|
||||
else if(!player.mind.assigned_role)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
var/station_captured = 0
|
||||
var/to_nuke_or_not_to_nuke = 0
|
||||
var/apcs = 0 //Adding dis to track how many APCs the AI hacks. --NeoFite
|
||||
var/list/datum/mind/antag_candidates = list() // List of possible starting antags goes here
|
||||
|
||||
|
||||
/datum/game_mode/malfunction/announce()
|
||||
@@ -27,15 +28,36 @@
|
||||
<B>The AI on the satellite has malfunctioned and must be destroyed.</B><br />
|
||||
The AI satellite is deep in space and can only be accessed with the use of a teleporter! You have [AI_win_timeleft/60] minutes to disable it."}
|
||||
|
||||
/datum/game_mode/malfunction/get_players_for_role(var/role = BE_MALF)
|
||||
var/roletext = get_roletext(role)
|
||||
|
||||
var/datum/job/ai/DummyAIjob = new
|
||||
for(var/mob/new_player/player in player_list)
|
||||
if(player.client && player.ready)
|
||||
if(player.client.prefs.be_special & BE_MALF)
|
||||
if(!jobban_isbanned(player, "Syndicate") && !jobban_isbanned(player, "AI") && !jobban_isbanned(player, roletext) && DummyAIjob.player_old_enough(player.client))
|
||||
if(player_old_enough_antag(player.client,role))
|
||||
antag_candidates += player.mind
|
||||
antag_candidates = shuffle(antag_candidates)
|
||||
return antag_candidates
|
||||
|
||||
/datum/game_mode/malfunction/pre_setup()
|
||||
for(var/mob/new_player/player in player_list)
|
||||
if(player.mind && player.mind.assigned_role == "AI" && (player.client.prefs.be_special & BE_MALF))
|
||||
malf_ai+=player.mind
|
||||
if(malf_ai.len)
|
||||
return 1
|
||||
return 0
|
||||
get_players_for_role(BE_MALF)
|
||||
|
||||
var/datum/mind/chosen_ai
|
||||
if(!antag_candidates.len)
|
||||
return 0
|
||||
for(var/i = required_enemies, i > 0, i--)
|
||||
chosen_ai=pick(antag_candidates)
|
||||
malf_ai += chosen_ai
|
||||
antag_candidates -= malf_ai
|
||||
if (malf_ai.len < required_enemies)
|
||||
return 0
|
||||
for(var/datum/mind/ai_mind in malf_ai)
|
||||
ai_mind.assigned_role = "MODE"
|
||||
ai_mind.special_role = "malfunctioning AI"//So they actually have a special role/N
|
||||
log_game("[ai_mind.key] (ckey) has been selected as a malf AI")
|
||||
return 1
|
||||
|
||||
/datum/game_mode/malfunction/post_setup()
|
||||
for(var/datum/mind/AI_mind in malf_ai)
|
||||
|
||||
@@ -226,26 +226,22 @@ var/global/datum/controller/occupations/job_master
|
||||
if(!job) return 0
|
||||
if((job.title == "AI") && (config) && (!config.allow_ai)) return 0
|
||||
|
||||
if(ticker.mode.name == "AI malfunction") // malf. AIs are pre-selected before jobs
|
||||
for (var/datum/mind/mAI in ticker.mode.malf_ai)
|
||||
AssignRole(mAI.current, "AI")
|
||||
ai_selected++
|
||||
if(ai_selected) return 1
|
||||
return 0
|
||||
|
||||
for(var/i = job.total_positions, i > 0, i--)
|
||||
for(var/level = 1 to 3)
|
||||
var/list/candidates = list()
|
||||
if(ticker.mode.name == "AI malfunction")//Make sure they want to malf if its malf
|
||||
candidates = FindOccupationCandidates(job, level, BE_MALF)
|
||||
else
|
||||
candidates = FindOccupationCandidates(job, level)
|
||||
candidates = FindOccupationCandidates(job, level)
|
||||
if(candidates.len)
|
||||
var/mob/new_player/candidate = pick(candidates)
|
||||
if(AssignRole(candidate, "AI"))
|
||||
ai_selected++
|
||||
break
|
||||
//Malf NEEDS an AI so force one if we didn't get a player who wanted it
|
||||
if((ticker.mode.name == "AI malfunction")&&(!ai_selected))
|
||||
unassigned = shuffle(unassigned)
|
||||
for(var/mob/new_player/player in unassigned)
|
||||
if(jobban_isbanned(player, "AI")) continue
|
||||
if(AssignRole(player, "AI"))
|
||||
ai_selected++
|
||||
break
|
||||
if(ai_selected) return 1
|
||||
return 0
|
||||
|
||||
|
||||
@@ -668,12 +668,11 @@
|
||||
|
||||
jobs += "</tr><tr align='center'>" //Breaking it up so it fits nicer on the screen every 5 entries
|
||||
|
||||
/* //Malfunctioning AI //Removed Malf-bans because they're a pain to impliment
|
||||
//Malfunctioning AI
|
||||
if(jobban_isbanned(M, "malf AI") || isbanned_dept)
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=malf AI;jobban4=\ref[M]'><font color=red>[replacetext("Malf AI", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=malf AI;jobban4=\ref[M]'>[replacetext("Malf AI", " ", " ")]</a></td>"
|
||||
*/
|
||||
|
||||
//Alien
|
||||
if(jobban_isbanned(M, "alien") || isbanned_dept)
|
||||
|
||||
Reference in New Issue
Block a user