Removed the last few references to MODE, fixed some oversights with player_is_antag().

This commit is contained in:
Zuhayr
2015-07-14 04:58:18 +09:30
parent 965ab355e2
commit cd380aba24
10 changed files with 15 additions and 69 deletions

View File

@@ -37,7 +37,7 @@
if(PDA_Manifest.len) if(PDA_Manifest.len)
PDA_Manifest.Cut() PDA_Manifest.Cut()
if(H.mind && !player_is_antag(H.mind)) if(H.mind && !player_is_antag(H.mind, only_offstation_roles = 1))
var/assignment var/assignment
if(H.mind.role_alt_title) if(H.mind.role_alt_title)
assignment = H.mind.role_alt_title assignment = H.mind.role_alt_title

View File

@@ -213,7 +213,8 @@
if (!new_target) return if (!new_target) return
var/objective_path = text2path("/datum/objective/[new_obj_type]") var/objective_path = text2path("/datum/objective/[new_obj_type]")
if (new_target == "Free objective") var/mob/living/M = new_target
if (!istype(M) || !M.mind || new_target == "Free objective")
new_objective = new objective_path new_objective = new objective_path
new_objective.owner = src new_objective.owner = src
new_objective:target = null new_objective:target = null
@@ -221,9 +222,8 @@
else else
new_objective = new objective_path new_objective = new objective_path
new_objective.owner = src new_objective.owner = src
new_objective:target = new_target:mind new_objective:target = M.mind
//Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops. new_objective.explanation_text = "[objective_type] [M.real_name], the [M.mind.special_role ? M.mind:special_role : M.mind:assigned_role]."
new_objective.explanation_text = "[objective_type] [new_target:real_name], the [player_is_antag(new_target:mind) ? (new_target:mind:special_role) : (new_target:mind:assigned_role)]."
if ("prevent") if ("prevent")
new_objective = new /datum/objective/block new_objective = new /datum/objective/block

View File

@@ -71,9 +71,11 @@ var/global/list/antag_names_to_ids = list()
return antag.current_antagonists return antag.current_antagonists
return list() return list()
/proc/player_is_antag(var/datum/mind/player) /proc/player_is_antag(var/datum/mind/player, var/only_offstation_roles = 0)
for(var/antag_type in all_antag_types) for(var/antag_type in all_antag_types)
var/datum/antagonist/antag = all_antag_types[antag_type] var/datum/antagonist/antag = all_antag_types[antag_type]
if(only_offstation_roles && !(antag.flags & ANTAG_OVERRIDE_JOB))
continue
if(player in antag.current_antagonists) if(player in antag.current_antagonists)
return 1 return 1
if(player in antag.pending_antagonists) if(player in antag.pending_antagonists)

View File

@@ -10,7 +10,8 @@
current_antagonists |= player current_antagonists |= player
if(flags & ANTAG_OVERRIDE_JOB) if(flags & ANTAG_OVERRIDE_JOB)
player.assigned_role = "MODE" player.assigned_role = role_text
player.special_role = role_text
if(istype(player.current, /mob/dead)) if(istype(player.current, /mob/dead))
create_default(player.current) create_default(player.current)

View File

@@ -470,7 +470,7 @@ var/global/list/additional_antag_types = list()
suspects += man suspects += man
for(var/mob/M in suspects) for(var/mob/M in suspects)
if(player_is_antag(M.mind)) if(player_is_antag(M.mind, only_offstation_roles = 1))
continue continue
switch(rand(1, 100)) switch(rand(1, 100))
if(1 to 50) if(1 to 50)

View File

@@ -288,7 +288,7 @@ var/global/datum/controller/gameticker/ticker
if(player && player.mind && player.mind.assigned_role) if(player && player.mind && player.mind.assigned_role)
if(player.mind.assigned_role == "Captain") if(player.mind.assigned_role == "Captain")
captainless=0 captainless=0
if(!player_is_antag(player.mind)) if(!player_is_antag(player.mind, only_offstation_roles = 1))
job_master.EquipRank(player, player.mind.assigned_role, 0) job_master.EquipRank(player, player.mind.assigned_role, 0)
UpdateFactionList(player) UpdateFactionList(player)
equip_custom_items(player) equip_custom_items(player)

View File

@@ -88,29 +88,6 @@
else else
return null return null
// NOTE: Commentted out was the code which showed the chance of someone being an antag. If you want to re-add it, just uncomment the code.
/*
/datum/intercept_text/proc/pick_mob()
var/list/dudes = list()
for(var/mob/living/carbon/human/man in player_list)
if (!man.mind) continue
if (man.mind.assigned_role=="MODE") continue
dudes += man
if(dudes.len==0)
return null
return pick(dudes)
/datum/intercept_text/proc/pick_fingerprints()
var/mob/living/carbon/human/dude = src.pick_mob()
//if (!dude) return pick_fingerprints() //who coded that is totally crasy or just a traitor. -- rastaf0
if(dude)
return num2text(md5(dude.dna.uni_identity))
else
return num2text(md5(num2text(rand(1,10000))))
*/
/datum/intercept_text/proc/get_suspect() /datum/intercept_text/proc/get_suspect()
var/list/dudes = list() var/list/dudes = list()
for(var/mob/living/carbon/human/man in player_list) if(man.client && man.client.prefs.nanotrasen_relation == "Opposed") for(var/mob/living/carbon/human/man in player_list) if(man.client && man.client.prefs.nanotrasen_relation == "Opposed")
@@ -205,32 +182,6 @@
var/cname = pick(src.changeling_names) var/cname = pick(src.changeling_names)
var/orgname1 = pick(src.org_names_1) var/orgname1 = pick(src.org_names_1)
var/orgname2 = pick(src.org_names_2) var/orgname2 = pick(src.org_names_2)
/*
var/changeling_name
var/changeling_job
var/prob_right_dude = rand(prob_correct_person_lower, prob_correct_person_higher)
var/prob_right_job = rand(prob_correct_job_lower, prob_correct_job_higher)
if(prob(prob_right_job))
if(correct_person)
if(correct_person:assigned_role=="MODE")
changeling_job = pick(joblist)
else
changeling_job = correct_person:assigned_role
else
changeling_job = pick(joblist)
if(prob(prob_right_dude) && ticker.mode == "changeling")
if(correct_person:assigned_role=="MODE")
changeling_name = correct_person:current
else
changeling_name = src.pick_mob()
else
changeling_name = src.pick_mob()
*/
src.text += "<BR><BR>We have received a report that a dangerous alien lifeform known only as \"[cname]\" may have infiltrated your crew. " src.text += "<BR><BR>We have received a report that a dangerous alien lifeform known only as \"[cname]\" may have infiltrated your crew. "
/*
src.text += "Our intelligence suggests a [prob_right_job]% chance that a [changeling_job] on board your station has been replaced by the alien. "
src.text += "Additionally, the report indicates a [prob_right_dude]% chance that [changeling_name] may have been in contact with the lifeform at a recent social gathering. "
*/
src.text += "These lifeforms are assosciated with the [orgname1] [orgname2] and may be attempting to acquire sensitive materials on their behalf. " src.text += "These lifeforms are assosciated with the [orgname1] [orgname2] and may be attempting to acquire sensitive materials on their behalf. "
src.text += "Please take care not to alarm the crew, as [cname] may take advantage of a panic situation. Remember, they can be anybody, suspect everybody!" src.text += "Please take care not to alarm the crew, as [cname] may take advantage of a panic situation. Remember, they can be anybody, suspect everybody!"

View File

@@ -11,15 +11,7 @@
src << "You can't commit suicide before the game starts!" src << "You can't commit suicide before the game starts!"
return return
if(!player_is_antag(mind))
var/permitted = 0
var/list/allowed = list("Syndicate","traitor","Wizard","Head Revolutionary","Cultist","Changeling")
for(var/T in allowed)
if(mind.special_role == T)
permitted = 1
break
if(!permitted)
message_admins("[ckey] has tried to suicide, but they were not permitted due to not being antagonist as human.", 1) message_admins("[ckey] has tried to suicide, but they were not permitted due to not being antagonist as human.", 1)
src << "No. Adminhelp if there is a legitimate reason." src << "No. Adminhelp if there is a legitimate reason."
return return

View File

@@ -441,7 +441,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
//Announces the character on all the systems, based on the record. //Announces the character on all the systems, based on the record.
if(!issilicon(new_character))//If they are not a cyborg/AI. if(!issilicon(new_character))//If they are not a cyborg/AI.
if(!record_found && !player_is_antag(new_character.mind)) //If there are no records for them. If they have a record, this info is already in there. MODE people are not announced anyway. if(!record_found && !player_is_antag(new_character.mind, only_offstation_roles = 1)) //If there are no records for them. If they have a record, this info is already in there. MODE people are not announced anyway.
//Power to the user! //Power to the user!
if(alert(new_character,"Warning: No data core entry detected. Would you like to announce the arrival of this character by adding them to various databases, such as medical records?",,"No","Yes")=="Yes") if(alert(new_character,"Warning: No data core entry detected. Would you like to announce the arrival of this character by adding them to various databases, such as medical records?",,"No","Yes")=="Yes")
data_core.manifest_inject(new_character) data_core.manifest_inject(new_character)

View File

@@ -8,7 +8,7 @@
endWhen = rand(500, 1500) endWhen = rand(500, 1500)
// command_alert("The station has entered an ion storm. Monitor all electronic equipment for malfunctions", "Anomaly Alert") // command_alert("The station has entered an ion storm. Monitor all electronic equipment for malfunctions", "Anomaly Alert")
for (var/mob/living/carbon/human/player in player_list) for (var/mob/living/carbon/human/player in player_list)
if( !player.mind || player_is_antag(player.mind) || player.client.inactivity > MinutesToTicks(10)) if( !player.mind || player_is_antag(player.mind, only_offstation_roles = 1) || player.client.inactivity > MinutesToTicks(10))
continue continue
players += player.real_name players += player.real_name