Makes all special role entries use unique ids now that it is possible.

This commit is contained in:
PsiOmegaDelta
2016-01-30 17:22:17 +01:00
parent bee18a16db
commit 654f2ccaa0
23 changed files with 46 additions and 59 deletions
+3 -3
View File
@@ -971,8 +971,8 @@
#include "code\modules\client\preferences_toggles.dm"
#include "code\modules\client\ui_style.dm"
#include "code\modules\client\preference_setup\preference_setup.dm"
#include "code\modules\client\preference_setup\antagonism\01_basic.dm"
#include "code\modules\client\preference_setup\antagonism\02_candidacy.dm"
#include "code\modules\client\preference_setup\antagonism\01_candidacy.dm"
#include "code\modules\client\preference_setup\antagonism\02_setup.dm"
#include "code\modules\client\preference_setup\general\01_basic.dm"
#include "code\modules\client\preference_setup\general\02_language.dm"
#include "code\modules\client\preference_setup\general\03_body.dm"
@@ -1882,10 +1882,10 @@
#include "code\modules\xgm\xgm_gas_data.dm"
#include "code\modules\xgm\xgm_gas_mixture.dm"
#include "code\unit_tests\equipment_tests.dm"
#include "code\unit_tests\map_tests.dm"
#include "code\unit_tests\mob_tests.dm"
#include "code\unit_tests\unit_test.dm"
#include "code\unit_tests\zas_tests.dm"
#include "code\unit_tests\map_tests.dm"
#include "code\ZAS\_docs.dm"
#include "code\ZAS\Airflow.dm"
#include "code\ZAS\Atom.dm"
+3 -19
View File
@@ -9,25 +9,9 @@
#define SEC_LEVEL_RED 2
#define SEC_LEVEL_DELTA 3
#define BE_TRAITOR 0x1
#define BE_OPERATIVE 0x2
#define BE_CHANGELING 0x4
#define BE_WIZARD 0x8
#define BE_MALF 0x10
#define BE_REV 0x20
#define BE_ALIEN 0x40
#define BE_AI 0x80
#define BE_CULTIST 0x100
#define BE_MONKEY 0x200
#define BE_NINJA 0x400
#define BE_RAIDER 0x800
#define BE_PLANT 0x1000
#define BE_MUTINEER 0x2000
#define BE_PAI 0x4000
#define BE_LOYALIST 0x8000
#define IS_MODE_COMPILED(MODE) (ispath(text2path("/datum/game_mode/"+(MODE))))
#define BE_PLANT "BE_PLANT"
#define BE_SYNTH "BE_SYNTH"
#define BE_PAI "BE_PAI"
// Antagonist datum flags.
#define ANTAG_OVERRIDE_JOB 0x1 // Assigned job is set to MODE when spawning.
+1 -1
View File
@@ -334,7 +334,7 @@ proc/isInSight(var/atom/A, var/atom/B)
var/i = 0
while(candidates.len <= 0 && i < 5)
for(var/mob/dead/observer/G in player_list)
if(BE_ALIEN in G.client.prefs.be_special_role)
if(MODE_XENOMORPH in G.client.prefs.be_special_role)
if(((G.client.inactivity/10)/60) <= ALIEN_SELECT_AFK_BUFFER + i) // the most active players are more likely to become an alien
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
-1
View File
@@ -2,7 +2,6 @@ var/datum/antagonist/xenos/xenomorphs
/datum/antagonist/xenos
id = MODE_XENOMORPH
role_type = BE_ALIEN
role_text = "Xenomorph"
role_text_plural = "Xenomorphs"
mob_path = /mob/living/carbon/alien/larva
+4 -1
View File
@@ -14,7 +14,7 @@
// Role data.
var/id = "traitor" // Unique datum identifier.
var/role_type = BE_TRAITOR // Preferences option for this role.
var/role_type // Preferences option for this role. Defaults to the id if unset
var/role_text = "Traitor" // special_role text.
var/role_text_plural = "Traitors" // As above but plural.
@@ -72,6 +72,9 @@
/datum/antagonist/New()
..()
if(!role_type)
role_type = id
cur_max = hard_cap
get_starting_locations()
if(!role_text_plural)
+1 -2
View File
@@ -2,8 +2,7 @@ var/datum/antagonist/actor/actor
/datum/antagonist/actor
id = MODE_ACTOR
bantype = "operative"
role_type = BE_OPERATIVE
bantype = "actor"
role_text = "NanoTrasen Actor"
role_text_plural = "NanoTrasen Actors"
welcome_text = "You've been hired to entertain people through the power of television!"
@@ -2,7 +2,6 @@ var/datum/antagonist/deathsquad/deathsquad
/datum/antagonist/deathsquad
id = MODE_DEATHSQUAD
role_type = BE_OPERATIVE
role_text = "Death Commando"
role_text_plural = "Death Commandos"
welcome_text = "You work in the service of corporate Asset Protection, answering directly to the Board of Directors."
+1 -2
View File
@@ -3,7 +3,6 @@ var/datum/antagonist/ert/ert
/datum/antagonist/ert
id = MODE_ERT
bantype = "Emergency Response Team"
role_type = BE_OPERATIVE
role_text = "Emergency Responder"
role_text_plural = "Emergency Responders"
welcome_text = "As member of the Emergency Response Team, you answer only to your leader and company officials."
@@ -41,6 +40,6 @@ var/datum/antagonist/ert/ert
player.equip_to_slot_or_del(new /obj/item/clothing/shoes/swat(src), slot_shoes)
player.equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(src), slot_gloves)
player.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(src), slot_glasses)
create_id(role_text, player)
return 1
@@ -2,7 +2,6 @@ var/datum/antagonist/mercenary/mercs
/datum/antagonist/mercenary
id = MODE_MERCENARY
role_type = BE_OPERATIVE
role_text = "Mercenary"
bantype = "operative"
antag_indicator = "synd"
-1
View File
@@ -2,7 +2,6 @@ var/datum/antagonist/ninja/ninjas
/datum/antagonist/ninja
id = MODE_NINJA
role_type = BE_NINJA
role_text = "Ninja"
role_text_plural = "Ninja"
bantype = "ninja"
-1
View File
@@ -2,7 +2,6 @@ var/datum/antagonist/raider/raiders
/datum/antagonist/raider
id = MODE_RAIDER
role_type = BE_RAIDER
role_text = "Raider"
role_text_plural = "Raiders"
bantype = "raider"
-1
View File
@@ -2,7 +2,6 @@ var/datum/antagonist/wizard/wizards
/datum/antagonist/wizard
id = MODE_WIZARD
role_type = BE_WIZARD
role_text = "Space Wizard"
role_text_plural = "Space Wizards"
bantype = "wizard"
@@ -1,6 +1,5 @@
/datum/antagonist/changeling
id = MODE_CHANGELING
role_type = BE_CHANGELING
role_text = "Changeling"
role_text_plural = "Changelings"
bantype = "changeling"
-1
View File
@@ -13,7 +13,6 @@ var/datum/antagonist/cultist/cult
bantype = "cultist"
restricted_jobs = list("Chaplain","AI", "Cyborg", "Internal Affairs Agent", "Head of Security", "Captain")
protected_jobs = list("Security Officer", "Warden", "Detective")
role_type = BE_CULTIST
feedback_tag = "cult_objective"
antag_indicator = "cult"
welcome_text = "You have a talisman in your possession; one that will help you start the cult on this station. Use it well and remember - there are others."
-1
View File
@@ -2,7 +2,6 @@ var/datum/antagonist/loyalists/loyalists
/datum/antagonist/loyalists
id = MODE_LOYALIST
role_type = BE_LOYALIST
role_text = "Head Loyalist"
role_text_plural = "Loyalists"
bantype = "loyalist"
@@ -2,7 +2,6 @@ var/datum/antagonist/revolutionary/revs
/datum/antagonist/revolutionary
id = MODE_REVOLUTIONARY
role_type = BE_REV
role_text = "Head Revolutionary"
role_text_plural = "Revolutionaries"
bantype = "revolutionary"
-1
View File
@@ -2,7 +2,6 @@ var/datum/antagonist/rogue_ai/malf
/datum/antagonist/rogue_ai
id = MODE_MALFUNCTION
role_type = BE_MALF
role_text = "Rampant AI"
role_text_plural = "Rampant AIs"
mob_path = /mob/living/silicon/ai
+2
View File
@@ -52,6 +52,8 @@ var/list/whitelist = list()
//todo: admin aliens
/proc/is_alien_whitelisted(mob/M, var/species)
if(!M || !species)
return 0
if(!config.usealienwhitelist)
return 1
if(istype(species,/datum/species) || istype(species,/datum/language))
+1 -1
View File
@@ -30,7 +30,7 @@
progress++
if(progress >= MAX_PROGRESS)
for(var/mob/M in dead_mob_list)
if(istype(M,/mob/dead) && M.client && M.client.prefs && (BE_ALIEN in M.client.prefs.be_special_role))
if(istype(M,/mob/dead) && M.client && M.client.prefs && (MODE_XENOMORPH in M.client.prefs.be_special_role))
M << "<span class='notice'>An alien is ready to hatch! ([ghost_follow_link(src, M)]) (<a href='byond://?src=\ref[src];spawn=1'>spawn</a>)</span>"
processing_objects -= src
update_icon()
@@ -2,7 +2,7 @@ var/list/private_valid_special_roles
/datum/category_item/player_setup_item/antagonism/candidacy
name = "Candidacy"
sort_order = 2
sort_order = 1
/datum/category_item/player_setup_item/antagonism/candidacy/load_character(var/savefile/S)
S["be_special"] >> pref.be_special_role
@@ -20,14 +20,17 @@ var/list/private_valid_special_roles
/datum/category_item/player_setup_item/antagonism/candidacy/content(var/mob/user)
. += "<b>Special Role Availability:</b><br>"
for(var/datum/antagonist/antag in all_antag_types)
. += "[antag.role_text]: "
. += "<table>"
for(var/antag_type in all_antag_types)
var/datum/antagonist/antag = all_antag_types[antag_type]
. += "<tr><td>[antag.role_text]: </td><td>"
if(jobban_isbanned(preference_mob(), antag.bantype))
. += "<span class='danger'>\[BANNED\]</span><br>"
else if(antag.role_type in pref.be_special_role)
. += "<b>Yes</b> / <a href='?src=\ref[src];del_special=[antag.role_type]'>No</a></br>"
else
. += "<a href='?src=\ref[src];add_special=[antag.role_type]'>Yes</a> / <b>No</b></br>"
. += "</td></tr>"
var/list/ghost_traps = get_ghost_traps()
for(var/ghost_trap_key in ghost_traps)
@@ -35,15 +38,21 @@ var/list/private_valid_special_roles
if(!ghost_trap.list_as_special_role)
continue
. += "[(ghost_trap.ghost_trap_role)]: "
for(var/ban_type in ghost_trap.ban_checks)
if(jobban_isbanned(preference_mob(), ban_type))
. += "<span class='danger'>\[BANNED\]</span><br>"
continue
if(ghost_trap.pref_check in pref.be_special_role)
. += "<tr><td>[(ghost_trap.ghost_trap_role)]: </td><td>"
if(banned_from_ghost_role(preference_mob(), ghost_trap))
. += "<span class='danger'>\[BANNED\]</span><br>"
else if(ghost_trap.pref_check in pref.be_special_role)
. += "<b>Yes</b> / <a href='?src=\ref[src];del_special=[ghost_trap.pref_check]'>No</a></br>"
else
. += "<a href='?src=\ref[src];add_special=[ghost_trap.pref_check]'>Yes</a> / <b>No</b></br>"
. += "</td></tr>"
. += "</table>"
/datum/category_item/player_setup_item/proc/banned_from_ghost_role(var/mob, var/datum/ghosttrap/ghost_trap)
for(var/ban_type in ghost_trap.ban_checks)
if(jobban_isbanned(mob, ban_type))
return 1
return 0
/datum/category_item/player_setup_item/antagonism/candidacy/OnTopic(var/href,var/list/href_list, var/mob/user)
if(href_list["add_special"])
@@ -59,11 +68,13 @@ var/list/private_valid_special_roles
return ..()
/datum/category_item/player_setup_item/antagonism/candidacy/proc/valid_special_roles()
if(!private_valid_special_roles)
if(!(private_valid_special_roles && private_valid_special_roles.len))
private_valid_special_roles = list()
for(var/datum/antagonist/antag in all_antag_types)
for(var/antag_type in all_antag_types)
var/datum/antagonist/antag = all_antag_types[antag_type]
private_valid_special_roles += antag.role_type
var/list/ghost_traps = get_ghost_traps()
for(var/ghost_trap_key in ghost_traps)
var/datum/ghosttrap/ghost_trap = ghost_traps[ghost_trap_key]
if(!ghost_trap.list_as_special_role)
@@ -1,8 +1,8 @@
var/global/list/uplink_locations = list("PDA", "Headset", "None")
/datum/category_item/player_setup_item/antagonism/basic
name = "Basic"
sort_order = 1
name = "Setup"
sort_order = 2
/datum/category_item/player_setup_item/antagonism/basic/load_character(var/savefile/S)
S["uplinklocation"] >> pref.uplinklocation
@@ -16,9 +16,9 @@ var/global/list/uplink_locations = list("PDA", "Headset", "None")
pref.uplinklocation = sanitize_inlist(pref.uplinklocation, uplink_locations, initial(pref.uplinklocation))
/datum/category_item/player_setup_item/antagonism/basic/content(var/mob/user)
. +="<b>Uplink Type : <a href='?src=\ref[src];antagtask=1'>[pref.uplinklocation]</a></b>"
. +="<br>"
. +="<b>Exploitable information:</b><br>"
. +="<b>Antag Setup:</b><br>"
. +="Uplink Type: <a href='?src=\ref[src];antagtask=1'>[pref.uplinklocation]</a><br>"
. +="Exploitable information:<br>"
if(jobban_isbanned(user, "Records"))
. += "<b>You are banned from using character records.</b><br>"
else
@@ -19,7 +19,7 @@
category_item_type = /datum/category_item/player_setup_item/occupation
/datum/category_group/player_setup_category/appearance_preferences
name = "Antagonism"
name = "Roles"
sort_order = 4
category_item_type = /datum/category_item/player_setup_item/antagonism
+2 -2
View File
@@ -23,7 +23,7 @@ var/list/ghost_traps
var/object = "positronic brain"
var/minutes_since_death = 0 // If non-zero the ghost must have been dead for this many minutes to be allowed to spawn
var/list/ban_checks = list("AI","Cyborg")
var/pref_check = BE_AI
var/pref_check = BE_SYNTH
var/ghost_trap_message = "They are occupying a positronic brain now."
var/ghost_trap_role = "Positronic Brain"
var/can_set_own_name = TRUE
@@ -150,7 +150,7 @@ var/list/ghost_traps
/datum/ghosttrap/borer
object = "cortical borer"
ban_checks = list("Borer")
pref_check = BE_ALIEN
pref_check = MODE_BORER
ghost_trap_message = "They are occupying a borer now."
ghost_trap_role = "Cortical Borer"
can_set_own_name = FALSE