diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 4c595898a9a..bdf30f6645e 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -29,7 +29,7 @@ */ -datum/mind +/datum/mind var/key var/name //replaces mob/var/original_name var/mob/living/current @@ -69,1241 +69,1310 @@ datum/mind //put this here for easier tracking ingame var/datum/money_account/initial_account - proc/transfer_to(mob/living/new_character) - if(!istype(new_character)) - log_to_dd("## DEBUG: transfer_to(): Some idiot has tried to transfer_to() a non mob/living mob. Please inform Carn") - if(current) //remove ourself from our old body's mind variable - current.mind = null +/datum/mind/proc/transfer_to(mob/living/new_character) + if(!istype(new_character)) + log_to_dd("## DEBUG: transfer_to(): Some idiot has tried to transfer_to() a non mob/living mob. Please inform Carn") + if(current) //remove ourself from our old body's mind variable + current.mind = null - nanomanager.user_transferred(current, new_character) + nanomanager.user_transferred(current, new_character) - if(new_character.mind) //remove any mind currently in our new body's mind variable - new_character.mind.current = null + if(new_character.mind) //remove any mind currently in our new body's mind variable + new_character.mind.current = null - current = new_character //link ourself to our new body - new_character.mind = src //and link our new body to ourself - transfer_actions(new_character) + current = new_character //link ourself to our new body + new_character.mind = src //and link our new body to ourself + transfer_actions(new_character) - if(active) - new_character.key = key //now transfer the key to link the client to our new body + if(active) + new_character.key = key //now transfer the key to link the client to our new body - proc/store_memory(new_text) - memory += "[new_text]
" +/datum/mind/proc/store_memory(new_text) + memory += "[new_text]
" - proc/wipe_memory() - memory = null +/datum/mind/proc/wipe_memory() + memory = null - proc/show_memory(mob/recipient) - var/output = "[current.real_name]'s Memory
" - output += memory +/datum/mind/proc/show_memory(mob/recipient) + var/output = "[current.real_name]'s Memory
" + output += memory - if(objectives.len>0) - output += "
Objectives:" + if(objectives.len>0) + output += "
Objectives:" - var/obj_count = 1 - for(var/datum/objective/objective in objectives) - output += "Objective #[obj_count]: [objective.explanation_text]" - obj_count++ + var/obj_count = 1 + for(var/datum/objective/objective in objectives) + output += "Objective #[obj_count]: [objective.explanation_text]" + obj_count++ - if(job_objectives.len>0) - output += "
Job Objectives:" - recipient << browse(output,"window=memory") + recipient << browse(output,"window=memory") - proc/edit_memory() - if(!ticker || !ticker.mode) - alert("Not before round-start!", "Alert") - return +/datum/mind/proc/edit_memory() + if(!ticker || !ticker.mode) + alert("Not before round-start!", "Alert") + return - var/out = "[name][(current&&(current.real_name!=name))?" (as [current.real_name])":""]
" - out += "Mind currently owned by key: [key] [active?"(synced)":"(not synced)"]
" - out += "Assigned role: [assigned_role]. Edit
" - out += "Factions and special roles:
" + var/out = "[name][(current&&(current.real_name!=name))?" (as [current.real_name])":""]
" + out += "Mind currently owned by key: [key] [active?"(synced)":"(not synced)"]
" + out += "Assigned role: [assigned_role]. Edit
" + out += "Factions and special roles:
" - var/list/sections = list( - "implant", - "revolution", - "cult", - "wizard", - "changeling", - "vampire", - "nuclear", - "traitor", // "traitorchan", - "monkey", - "malfunction", - ) - var/text = "" - var/mob/living/carbon/human/H = current - if (istype(current, /mob/living/carbon/human)) - /** Impanted**/ - if(H.is_loyalty_implanted()) - text = "Loyalty Implant:Remove|Implanted
" + var/list/sections = list( + "implant", + "revolution", + "cult", + "wizard", + "changeling", + "vampire", + "nuclear", + "traitor", // "traitorchan", + "malfunction", + ) + var/text = "" + var/mob/living/carbon/human/H = current + if (istype(current, /mob/living/carbon/human)) + /** Impanted**/ + if(H.is_loyalty_implanted()) + text = "Loyalty Implant:Remove|Implanted
" + else + text = "Loyalty Implant:No Implant|Implant him!
" + sections["implant"] = text + /** REVOLUTION ***/ + text = "revolution" + if (ticker.mode.config_tag=="revolution") + text += uppertext(text) + text = "[text]: " + if (H.is_loyalty_implanted()) + text += "LOYAL EMPLOYEE|headrev|rev" + else if (src in ticker.mode.head_revolutionaries) + text = "employee|HEADREV|rev" + text += "
Flash: give" + + var/list/L = current.get_contents() + var/obj/item/device/flash/flash = locate() in L + if (flash) + if(!flash.broken) + text += "|take." + else + text += "|take|repair." else - text = "Loyalty Implant:No Implant|Implant him!
" - sections["implant"] = text - /** REVOLUTION ***/ - text = "revolution" - if (ticker.mode.config_tag=="revolution") - text += uppertext(text) - text = "[text]: " - if (H.is_loyalty_implanted()) - text += "LOYAL EMPLOYEE|headrev|rev" - else if (src in ticker.mode.head_revolutionaries) - text = "employee|HEADREV|rev" - text += "
Flash: give" + text += "." + text += " Reequip (gives traitor uplink)." + if (objectives.len==0) + text += "
Objectives are empty! Set to kill all heads." + else if (src in ticker.mode.revolutionaries) + text += "employee|headrev|REV" + else + text += "EMPLOYEE|headrev|rev" + + if(current && current.client && current.client.prefs.be_special & BE_REV) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["revolution"] = text + + /** CULT ***/ + text = "cult" + if (ticker.mode.config_tag=="cult") + text = uppertext(text) + text = "[text]: " + if (H.is_loyalty_implanted()) + text += "LOYAL EMPLOYEE|cultist" + else if (src in ticker.mode.cult) + text += "employee|CULTIST" + text += "
Give tome|equip." +/* + if (objectives.len==0) + text += "
Objectives are empty! Set to sacrifice and escape or summon." +*/ + else + text += "EMPLOYEE|cultist" + + + if(current && current.client && current.client.prefs.be_special & BE_CULTIST) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["cult"] = text + + /** WIZARD ***/ + text = "wizard" + if (ticker.mode.config_tag=="wizard") + text = uppertext(text) + text = "[text]: " + if (src in ticker.mode.wizards) + text += "YES|no" + text += "
To lair, undress, dress up, let choose name." + if (objectives.len==0) + text += "
Objectives are empty! Randomize!" + else + text += "yes|NO" + + if(current && current.client && current.client.prefs.be_special & BE_WIZARD) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["wizard"] = text + + /** CHANGELING ***/ + text = "changeling" + if (ticker.mode.config_tag=="changeling" || ticker.mode.config_tag=="traitorchan") + text = uppertext(text) + text = "[text]: " + if (src in ticker.mode.changelings) + text += "YES|no" + if (objectives.len==0) + text += "
Objectives are empty! Randomize!" + if( changeling && changeling.absorbed_dna.len && (current.real_name != changeling.absorbed_dna[1]) ) + text += "
Transform to initial appearance." + else + text += "yes|NO" + + if(current && current.client && current.client.prefs.be_special & BE_CHANGELING) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["changeling"] = text + + /** VAMPIRE ***/ + text = "vampire" + if (ticker.mode.config_tag=="vampire") + text = uppertext(text) + text = "[text]: " + if (src in ticker.mode.vampires) + text += "YES|no" + if (objectives.len==0) + text += "
Objectives are empty! Randomize!" + else + text += "yes|NO" + + if(src in ticker.mode.vampire_enthralled) + text += "YES|no" + else + text += "yes|NO" + + /** Enthralled ***/ + text += "
enthralled" + + sections["vampire"] = text + + + /** NUCLEAR ***/ + text = "nuclear" + if (ticker.mode.config_tag=="nuclear") + text = uppertext(text) + text = "[text]: " + if (src in ticker.mode.syndicates) + text += "OPERATIVE|nanotrasen" + text += "
To shuttle, undress, dress up." + var/code + for (var/obj/machinery/nuclearbomb/bombue in machines) + if (length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN") + code = bombue.r_code + break + if (code) + text += " Code is [code]. tell the code." + else + text += "operative|NANOTRASEN" + + if(current && current.client && current.client.prefs.be_special & BE_OPERATIVE) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["nuclear"] = text + + /** TRAITOR ***/ + text = "traitor" + if (ticker.mode.config_tag=="traitor" || ticker.mode.config_tag=="traitorchan") + text = uppertext(text) + text = "[text]: " + if (H.is_loyalty_implanted()) + text +="traitor|LOYAL EMPLOYEE" + else + if (src in ticker.mode.traitors) + text += "TRAITOR|EMPLOYEE" + if (objectives.len==0) + text += "
Objectives are empty! Randomize!" + else + text += "traitor|EMPLOYEE" + + if(current && current.client && current.client.prefs.be_special & BE_TRAITOR) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["traitor"] = text + + /** SHADOWLING **/ + text = "shadowling" + if(ticker.mode.config_tag == "shadowling") + text = uppertext(text) + text = "[text]: " + if(src in ticker.mode.shadows) + text += "SHADOWLING|thrall|human" + else if(src in ticker.mode.shadowling_thralls) + text += "Shadowling|THRALL|human" + else + text += "shadowling|thrall|HUMAN" + + if(current && current.client && current.client.prefs.be_special & BE_SHADOWLING) + text += "|Enabled in Prefs" + else + text += "|Disabled in Prefs" + + sections["shadowling"] = text + + /** SILICON ***/ + + if (istype(current, /mob/living/silicon)) + text = "silicon" + if (ticker.mode.config_tag=="malfunction") + text = uppertext(text) + text = "[text]: " + if (istype(current, /mob/living/silicon/ai)) + if (src in ticker.mode.malf_ai) + text += "MALF|not malf" + else + text += "malf|NOT MALF" + var/mob/living/silicon/robot/robot = current + if (istype(robot) && robot.emagged) + text += "
Cyborg: Is emagged! Unemag!
0th law: [robot.laws.zeroth_law]" + var/mob/living/silicon/ai/ai = current + if (istype(ai) && ai.connected_robots.len) + var/n_e_robots = 0 + for (var/mob/living/silicon/robot/R in ai.connected_robots) + if (R.emagged) + n_e_robots++ + text += "
[n_e_robots] of [ai.connected_robots.len] slaved cyborgs are emagged. Unemag" + sections["malfunction"] = text + + if (ticker.mode.config_tag == "traitorchan") + if (sections["traitor"]) + out += sections["traitor"]+"
" + if (sections["changeling"]) + out += sections["changeling"]+"
" + sections -= "traitor" + sections -= "changeling" + else + if (sections[ticker.mode.config_tag]) + out += sections[ticker.mode.config_tag]+"
" + sections -= ticker.mode.config_tag + for (var/i in sections) + if (sections[i]) + out += sections[i]+"
" + + + if (((src in ticker.mode.head_revolutionaries) || \ + (src in ticker.mode.traitors) || \ + (src in ticker.mode.syndicates)) && \ + istype(current,/mob/living/carbon/human) ) + + text = "Uplink: give" + var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink() + var/crystals + if (suplink) + crystals = suplink.uses + if (suplink) + text += "|take" + if (usr.client.holder.rights & (R_SERVER|R_EVENT)) + text += ", [crystals] crystals" + else + text += ", [crystals] crystals" + text += "." //hiel grammar + out += text + + out += "
" + + out += "Memory:
" + out += memory + out += "
Edit memory
" + out += "Objectives:
" + if (objectives.len == 0) + out += "EMPTY
" + else + var/obj_count = 1 + for(var/datum/objective/objective in objectives) + out += "[obj_count]: [objective.explanation_text] Edit Delete Toggle Completion
" + obj_count++ + out += "Add objective

" + + out += "Announce objectives

" + + usr << browse(out, "window=edit_memory[src]") + +/datum/mind/Topic(href, href_list) + if(!check_rights(R_ADMIN)) return + + if (href_list["role_edit"]) + var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in joblist + if (!new_role) return + assigned_role = new_role + log_admin("[key_name(usr)] has changed [key_name(current)]'s assigned role to [assigned_role]") + message_admins("[key_name_admin(usr)] has changed [key_name_admin(current)]'s assigned role to [assigned_role]") + + else if (href_list["memory_edit"]) + var/new_memo = sanitize(copytext(input("Write new memory", "Memory", memory) as null|message,1,MAX_MESSAGE_LEN)) + if (isnull(new_memo)) return + memory = new_memo + log_admin("[key_name(usr)] has edited [key_name(current)]'s memory") + message_admins("[key_name_admin(usr)] has edited [key_name_admin(current)]'s memory") + + else if (href_list["obj_edit"] || href_list["obj_add"]) + var/datum/objective/objective + var/objective_pos + var/def_value + + if (href_list["obj_edit"]) + objective = locate(href_list["obj_edit"]) + if (!objective) return + objective_pos = objectives.Find(objective) + + //Text strings are easy to manipulate. Revised for simplicity. + var/temp_obj_type = "[objective.type]"//Convert path into a text string. + def_value = copytext(temp_obj_type, 19)//Convert last part of path into an objective keyword. + if(!def_value)//If it's a custom objective, it will be an empty string. + def_value = "custom" + + var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "blood", "debrain", "protect", "prevent", "harm", "brig", "hijack", "escape", "survive", "steal", "download", "nuclear", "capture", "absorb", "destroy", "maroon", "identity theft", "custom") + if (!new_obj_type) return + + var/datum/objective/new_objective = null + + switch (new_obj_type) + if ("assassinate","protect","debrain", "harm", "brig", "maroon") + //To determine what to name the objective in explanation text. + var/objective_type_capital = uppertext(copytext(new_obj_type, 1,2))//Capitalize first letter. + var/objective_type_text = copytext(new_obj_type, 2)//Leave the rest of the text. + var/objective_type = "[objective_type_capital][objective_type_text]"//Add them together into a text string. + + var/list/possible_targets = list("Free objective") + for(var/datum/mind/possible_target in ticker.minds) + if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human)) + possible_targets += possible_target.current + + var/mob/def_target = null + var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain) + if (objective&&(objective.type in objective_list) && objective:target) + def_target = objective:target.current + + var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets + if (!new_target) return + + var/objective_path = text2path("/datum/objective/[new_obj_type]") + if (new_target == "Free objective") + new_objective = new objective_path + new_objective.owner = src + new_objective:target = null + new_objective.explanation_text = "Free objective" + else + new_objective = new objective_path + new_objective.owner = src + new_objective:target = new_target:mind + //Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops. + new_objective.explanation_text = "[objective_type] [new_target:real_name], the [new_target:mind:assigned_role=="MODE" ? (new_target:mind:special_role) : (new_target:mind:assigned_role)]." + + if ("destroy") + var/list/possible_targets = active_ais(1) + if(possible_targets.len) + var/mob/new_target = input("Select target:", "Objective target") as null|anything in possible_targets + new_objective = new /datum/objective/destroy + new_objective.target = new_target.mind + new_objective.owner = src + new_objective.explanation_text = "Destroy [new_target.name], the experimental AI." + else + usr << "No active AIs with minds" + + if ("prevent") + new_objective = new /datum/objective/block + new_objective.owner = src + + if ("hijack") + new_objective = new /datum/objective/hijack + new_objective.owner = src + + if ("escape") + new_objective = new /datum/objective/escape + new_objective.owner = src + + if ("survive") + new_objective = new /datum/objective/survive + new_objective.owner = src + + if ("die") + new_objective = new /datum/objective/die + new_objective.owner = src + + if ("nuclear") + new_objective = new /datum/objective/nuclear + new_objective.owner = src + + if ("steal") + if (!istype(objective, /datum/objective/steal)) + new_objective = new /datum/objective/steal + new_objective.owner = src + else + new_objective = objective + var/datum/objective/steal/steal = new_objective + if (!steal.select_target()) + return + + if("download","capture","absorb", "blood") + var/def_num + if(objective&&objective.type==text2path("/datum/objective/[new_obj_type]")) + def_num = objective.target_amount + + var/target_number = input("Input target number:", "Objective", def_num) as num|null + if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist. + return + + switch(new_obj_type) + if("download") + new_objective = new /datum/objective/download + new_objective.explanation_text = "Download [target_number] research levels." + if("capture") + new_objective = new /datum/objective/capture + new_objective.explanation_text = "Accumulate [target_number] capture points." + if("absorb") + new_objective = new /datum/objective/absorb + new_objective.explanation_text = "Absorb [target_number] compatible genomes." + if("blood") + new_objective = new /datum/objective/blood + new_objective.explanation_text = "Accumulate atleast [target_number] units of blood in total." + new_objective.owner = src + new_objective.target_amount = target_number + + if("identity theft") + var/list/possible_targets = list("Free objective") + for(var/datum/mind/possible_target in ticker.minds) + if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human)) + possible_targets += possible_target.current + + var/new_target = input("Select target:", "Objective target") as null|anything in possible_targets + if (!new_target) + return + var/datum/mind/targ = new_target + if(!istype(targ)) + log_debug("Invalid target for identity theft objective, cancelling") + return + new_objective = new /datum/objective/escape/escape_with_identity + new_objective.owner = src + new_objective.target = new_target + new_objective.explanation_text = "Escape on the shuttle or an escape pod with the identity of [targ.current.real_name], the [targ.assigned_role] while wearing their identification card." + if ("custom") + var/expl = sanitize(copytext(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null,1,MAX_MESSAGE_LEN)) + if (!expl) return + new_objective = new /datum/objective + new_objective.owner = src + new_objective.explanation_text = expl + + if (!new_objective) return + + if (objective) + objectives -= objective + objectives.Insert(objective_pos, new_objective) + else + objectives += new_objective + + log_admin("[key_name(usr)] has updated [key_name(current)]'s objectives: [new_objective]") + message_admins("[key_name_admin(usr)] has updated [key_name_admin(current)]'s objectives: [new_objective]") + + else if (href_list["obj_delete"]) + var/datum/objective/objective = locate(href_list["obj_delete"]) + if(!istype(objective)) return + objectives -= objective + + log_admin("[key_name(usr)] has removed one of [key_name(current)]'s objectives: [objective]") + message_admins("[key_name_admin(usr)] has removed one of [key_name_admin(current)]'s objectives: [objective]") + + else if(href_list["obj_completed"]) + var/datum/objective/objective = locate(href_list["obj_completed"]) + if(!istype(objective)) return + objective.completed = !objective.completed + + log_admin("[key_name(usr)] has toggled the completion of one of [key_name(current)]'s objectives") + message_admins("[key_name_admin(usr)] has toggled the completion of one of [key_name_admin(current)]'s objectives") + + else if(href_list["implant"]) + var/mob/living/carbon/human/H = current + + H.hud_updateflag |= (1 << IMPLOYAL_HUD) // updates that players HUD images so secHUD's pick up they are implanted or not. + + switch(href_list["implant"]) + if("remove") + for(var/obj/item/weapon/implant/loyalty/I in H.contents) + for(var/obj/item/organ/external/organs in H.organs) + if(I in organs.implants) + qdel(I) + H << "\blue Your loyalty implant has been deactivated." + log_admin("[key_name(usr)] has deactivated [key_name(current)]'s loyalty implant") + message_admins("[key_name_admin(usr)] has deactivated [key_name_admin(current)]'s loyalty implant") + if("add") + var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) + L.imp_in = H + L.implanted = 1 + var/obj/item/organ/external/affected = H.organs_by_name["head"] + affected.implants += L + L.part = affected + + log_admin("[key_name(usr)] has given [key_name(current)] a loyalty implant") + message_admins("[key_name_admin(usr)] has given [key_name_admin(current)] a loyalty implant") + + H << "\red You somehow have become the recepient of a loyalty transplant, and it just activated!" + if(src in ticker.mode.revolutionaries) + special_role = null + ticker.mode.revolutionaries -= src + src << "\red The nanobots in the loyalty implant remove all thoughts about being a revolutionary. Get back to work!" + if(src in ticker.mode.head_revolutionaries) + special_role = null + ticker.mode.head_revolutionaries -=src + src << "\red The nanobots in the loyalty implant remove all thoughts about being a revolutionary. Get back to work!" + if(src in ticker.mode.cult) + ticker.mode.cult -= src + ticker.mode.update_cult_icons_removed(src) + special_role = null + var/datum/game_mode/cult/cult = ticker.mode + if (istype(cult)) + cult.memorize_cult_objectives(src) + current << "\red The nanobots in the loyalty implant remove all thoughts about being in a cult. Have a productive day!" + memory = "" + if(src in ticker.mode.traitors) + ticker.mode.traitors -= src + special_role = null + current << "\red The nanobots in the loyalty implant remove all thoughts about being a traitor to Nanotrasen. Have a nice day!" + log_admin("[key_name_admin(usr)] has de-traitor'ed [current].") + + else if (href_list["revolution"]) + current.hud_updateflag |= (1 << SPECIALROLE_HUD) + + switch(href_list["revolution"]) + if("clear") + if(src in ticker.mode.revolutionaries) + ticker.mode.revolutionaries -= src + current << "\red You have been brainwashed! You are no longer a revolutionary!" + ticker.mode.update_rev_icons_removed(src) + special_role = null + if(src in ticker.mode.head_revolutionaries) + ticker.mode.head_revolutionaries -= src + current << "\red You have been brainwashed! You are no longer a head revolutionary!" + ticker.mode.update_rev_icons_removed(src) + special_role = null + log_admin("[key_name(usr)] has de-rev'd [key_name(current)]") + message_admins("[key_name_admin(usr)] has de-rev'd [key_name_admin(current)]") + + if("rev") + if(src in ticker.mode.head_revolutionaries) + ticker.mode.head_revolutionaries -= src + ticker.mode.update_rev_icons_removed(src) + current << "\red Revolution has been disappointed of your leader traits! You are a regular revolutionary now!" + else if(!(src in ticker.mode.revolutionaries)) + current << "\red You are now a revolutionary! Help your cause. Do not harm your fellow freedom fighters. You can identify your comrades by the red \"R\" icons, and your leaders by the blue \"R\" icons. Help them kill the heads to win the revolution!" + else + return + ticker.mode.revolutionaries += src + ticker.mode.update_rev_icons_added(src) + special_role = "Revolutionary" + log_admin("[key_name(usr)] has rev'd [key_name(current)]") + message_admins("[key_name_admin(usr)] has rev'd [key_name_admin(current)]") + + if("headrev") + if(src in ticker.mode.revolutionaries) + ticker.mode.revolutionaries -= src + ticker.mode.update_rev_icons_removed(src) + current << "\red You have proved your devotion to revoltion! Yea are a head revolutionary now!" + else if(!(src in ticker.mode.head_revolutionaries)) + current << "\blue You are a member of the revolutionaries' leadership now!" + else + return + if (ticker.mode.head_revolutionaries.len>0) + // copy targets + var/datum/mind/valid_head = locate() in ticker.mode.head_revolutionaries + if (valid_head) + for (var/datum/objective/mutiny/O in valid_head.objectives) + var/datum/objective/mutiny/rev_obj = new + rev_obj.owner = src + rev_obj.target = O.target + rev_obj.explanation_text = "Assassinate [O.target.name], the [O.target.assigned_role]." + objectives += rev_obj + ticker.mode.greet_revolutionary(src,0) + ticker.mode.head_revolutionaries += src + ticker.mode.update_rev_icons_added(src) + special_role = "Head Revolutionary" + log_admin("[key_name(usr)] has head-rev'd [key_name(current)]") + message_admins("[key_name_admin(usr)] has head-rev'd [key_name_admin(current)]") + + if("autoobjectives") + ticker.mode.forge_revolutionary_objectives(src) + ticker.mode.greet_revolutionary(src,0) + log_admin("[key_name(usr)] has automatically forged revolutionary objectives for [key_name(current)]") + message_admins("[key_name_admin(usr)] has automatically forged revolutionary objectives for [key_name_admin(current)]") + + if("flash") + if (!ticker.mode.equip_revolutionary(current)) + usr << "\red Spawning flash failed!" + log_admin("[key_name(usr)] has given [key_name(current)] a flash") + message_admins("[key_name_admin(usr)] has given [key_name_admin(current)] a flash") + + if("takeflash") var/list/L = current.get_contents() var/obj/item/device/flash/flash = locate() in L - if (flash) - if(!flash.broken) - text += "|take." - else - text += "|take|repair." + if (!flash) + usr << "\red Deleting flash failed!" + qdel(flash) + log_admin("[key_name(usr)] has taken [key_name(current)]'s flash") + message_admins("[key_name_admin(usr)] has taken [key_name_admin(current)]'s flash") + + if("repairflash") + var/list/L = current.get_contents() + var/obj/item/device/flash/flash = locate() in L + if (!flash) + usr << "\red Repairing flash failed!" else - text += "." + flash.broken = 0 + log_admin("[key_name(usr)] has repaired [key_name(current)]'s flash") + message_admins("[key_name_admin(usr)] has repaired [key_name_admin(current)]'s flash") - text += " Reequip (gives traitor uplink)." - if (objectives.len==0) - text += "
Objectives are empty! Set to kill all heads." - else if (src in ticker.mode.revolutionaries) - text += "employee|headrev|REV" - else - text += "EMPLOYEE|headrev|rev" + if("reequip") + var/list/L = current.get_contents() + var/obj/item/device/flash/flash = locate() in L + qdel(flash) + take_uplink() + var/fail = 0 + fail |= !ticker.mode.equip_traitor(current, 1) + fail |= !ticker.mode.equip_revolutionary(current) + if (fail) + usr << "\red Reequipping revolutionary goes wrong!" + return + log_admin("[key_name(usr)] has equipped [key_name(current)] as a revolutionary") + message_admins("[key_name_admin(usr)] has equipped [key_name_admin(current)] as a revolutionary") - if(current && current.client && current.client.prefs.be_special & BE_REV) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" + else if (href_list["cult"]) + current.hud_updateflag |= (1 << SPECIALROLE_HUD) + switch(href_list["cult"]) + if("clear") + if(src in ticker.mode.cult) + ticker.mode.remove_cultist(src) + log_admin("[key_name(usr)] has de-culted [key_name(current)]") + message_admins("[key_name_admin(usr)] has de-culted [key_name_admin(current)]") + if("cultist") + if(!(src in ticker.mode.cult)) + ticker.mode.add_cultist(src) + special_role = "Cultist" + current << "You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie." + current << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." + log_admin("[key_name(usr)] has culted [key_name(current)]") + message_admins("[key_name_admin(usr)] has culted [key_name_admin(current)]") + if("tome") + var/mob/living/carbon/human/H = current + if (istype(H)) + var/obj/item/weapon/tome/T = new(H) - sections["revolution"] = text + var/list/slots = list ( + "backpack" = slot_in_backpack, + "left pocket" = slot_l_store, + "right pocket" = slot_r_store, + "left hand" = slot_l_hand, + "right hand" = slot_r_hand, + ) + var/where = H.equip_in_one_of_slots(T, slots) + if (!where) + usr << "\red Spawning tome failed!" + qdel(T) + else + H << "A tome, a message from your new master, appears in your [where]." + log_admin("[key_name(usr)] has spawned a tome for [key_name(current)]") + message_admins("[key_name_admin(usr)] has spawned a tome for [key_name_admin(current)]") - /** CULT ***/ - text = "cult" - if (ticker.mode.config_tag=="cult") - text = uppertext(text) - text = "[text]: " - if (H.is_loyalty_implanted()) - text += "LOYAL EMPLOYEE|cultist" - else if (src in ticker.mode.cult) - text += "employee|CULTIST" - text += "
Give tome|amulet." -/* - if (objectives.len==0) - text += "
Objectives are empty! Set to sacrifice and escape or summon." -*/ - else - text += "EMPLOYEE|cultist" + if("equip") + if (!ticker.mode.equip_cultist(current)) + usr << "\red Spawning equipment failed!" + log_admin("[key_name(usr)] has equipped [key_name(current)] as a cultist") + message_admins("[key_name_admin(usr)] has equipped [key_name_admin(current)] as a cultist") + + else if (href_list["wizard"]) + current.hud_updateflag |= (1 << SPECIALROLE_HUD) + + switch(href_list["wizard"]) + if("clear") + if(src in ticker.mode.wizards) + ticker.mode.wizards -= src + special_role = null + current.spellremove(current) + current.faction = list("Station") + current << "\red You have been brainwashed! You are no longer a wizard!" + log_admin("[key_name(usr)] has de-wizarded [key_name(current)]") + message_admins("[key_name_admin(usr)] has de-wizarded [key_name_admin(current)]") + if("wizard") + if(!(src in ticker.mode.wizards)) + ticker.mode.wizards += src + special_role = "Wizard" + //ticker.mode.learn_basic_spells(current) + current << "\red You are the Space Wizard!" + current.faction = list("wizard") + log_admin("[key_name(usr)] has wizarded [key_name(current)]") + message_admins("[key_name_admin(usr)] has wizarded [key_name_admin(current)]") + if("lair") + current.forceMove(pick(wizardstart)) + log_admin("[key_name(usr)] has moved [key_name(current)] to the wizard's lair") + message_admins("[key_name_admin(usr)] has moved [key_name_admin(current)] to the wizard's lair") + if("dressup") + ticker.mode.equip_wizard(current) + log_admin("[key_name(usr)] has equipped [key_name(current)] as a wizard") + message_admins("[key_name_admin(usr)] has equipped [key_name_admin(current)] as a wizard") + if("name") + ticker.mode.name_wizard(current) + log_admin("[key_name(usr)] has allowed wizard [key_name(current)] to name themselves") + message_admins("[key_name_admin(usr)] has allowed wizard [key_name_admin(current)] to name themselves") + if("autoobjectives") + ticker.mode.forge_wizard_objectives(src) + usr << "\blue The objectives for wizard [key] have been generated. You can edit them and anounce manually." + log_admin("[key_name(usr)] has automatically forged wizard objectives for [key_name(current)]") + message_admins("[key_name_admin(usr)] has automatically forged wizard objectives for [key_name_admin(current)]") - if(current && current.client && current.client.prefs.be_special & BE_CULTIST) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" + else if (href_list["changeling"]) + current.hud_updateflag |= (1 << SPECIALROLE_HUD) + switch(href_list["changeling"]) + if("clear") + if(src in ticker.mode.changelings) + ticker.mode.changelings -= src + special_role = null + current.remove_changeling_powers() + if(changeling) qdel(changeling) + current << "You grow weak and lose your powers! You are no longer a changeling and are stuck in your current form!" + log_admin("[key_name(usr)] has de-changelinged [key_name(current)]") + message_admins("[key_name_admin(usr)] has de-changelinged [key_name_admin(current)]") + if("changeling") + if(!(src in ticker.mode.changelings)) + ticker.mode.changelings += src + ticker.mode.grant_changeling_powers(current) + special_role = "Changeling" + current << "Your powers are awoken. A flash of memory returns to us...we are a changeling!" + log_admin("[key_name(usr)] has changelinged [key_name(current)]") + message_admins("[key_name_admin(usr)] has changelinged [key_name_admin(current)]") + + if("autoobjectives") + ticker.mode.forge_changeling_objectives(src) + usr << "\blue The objectives for changeling [key] have been generated. You can edit them and anounce manually." + log_admin("[key_name(usr)] has automatically forged objectives for [key_name(current)]") + message_admins("[key_name_admin(usr)] has automatically forged objectives for [key_name_admin(current)]") - sections["cult"] = text + if("initialdna") + if( !changeling || !changeling.absorbed_dna.len ) + usr << "\red Resetting DNA failed!" + else + current.dna = changeling.absorbed_dna[1] + current.real_name = current.dna.real_name + current.UpdateAppearance() + domutcheck(current, null) + log_admin("[key_name(usr)] has reset [key_name(current)]'s DNA") + message_admins("[key_name_admin(usr)] has reset [key_name_admin(current)]'s DNA") - /** WIZARD ***/ - text = "wizard" - if (ticker.mode.config_tag=="wizard") - text = uppertext(text) - text = "[text]: " - if (src in ticker.mode.wizards) - text += "YES|no" - text += "
To lair, undress, dress up, let choose name." - if (objectives.len==0) - text += "
Objectives are empty! Randomize!" - else - text += "yes|NO" - - if(current && current.client && current.client.prefs.be_special & BE_WIZARD) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["wizard"] = text - - /** CHANGELING ***/ - text = "changeling" - if (ticker.mode.config_tag=="changeling" || ticker.mode.config_tag=="traitorchan") - text = uppertext(text) - text = "[text]: " - if (src in ticker.mode.changelings) - text += "YES|no" - if (objectives.len==0) - text += "
Objectives are empty! Randomize!" - if( changeling && changeling.absorbed_dna.len && (current.real_name != changeling.absorbed_dna[1]) ) - text += "
Transform to initial appearance." - else - text += "yes|NO" - - if(current && current.client && current.client.prefs.be_special & BE_CHANGELING) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["changeling"] = text - - /** VAMPIRE ***/ - text = "vampire" - if (ticker.mode.config_tag=="vampire") - text = uppertext(text) - text = "[text]: " - if (src in ticker.mode.vampires) - text += "YES|no" - if (objectives.len==0) - text += "
Objectives are empty! Randomize!" - else - text += "yes|NO" - - if(src in ticker.mode.vampire_enthralled) - text += "YES|no" - else - text += "yes|NO" - - /** Enthralled ***/ - text += "
enthralled" - - sections["vampire"] = text + else if (href_list["vampire"]) + switch(href_list["vampire"]) + if("clear") + if(src in ticker.mode.vampires) + ticker.mode.vampires -= src + special_role = null + current.remove_vampire_powers() + if(vampire) qdel(vampire) + current << "You grow weak and lose your powers! You are no longer a vampire and are stuck in your current form!" + log_admin("[key_name(usr)] has de-vampired [key_name(current)]") + message_admins("[key_name_admin(usr)] has de-vampired [key_name_admin(current)]") + if("vampire") + if(!(src in ticker.mode.vampires)) + ticker.mode.vampires += src + ticker.mode.grant_vampire_powers(current) + special_role = "Vampire" + current << "Your powers are awoken. Your lust for blood grows... You are a Vampire!" + log_admin("[key_name(usr)] has vampired [key_name(current)]") + message_admins("[key_name_admin(usr)] has vampired [key_name_admin(current)]") + + if("autoobjectives") + ticker.mode.forge_vampire_objectives(src) + usr << "\blue The objectives for vampire [key] have been generated. You can edit them and announce manually." + log_admin("[key_name(usr)] has automatically forged objectives for [key_name(current)]") + message_admins("[key_name_admin(usr)] has automatically forged objectives for [key_name_admin(current)]") - /** NUCLEAR ***/ - text = "nuclear" - if (ticker.mode.config_tag=="nuclear") - text = uppertext(text) - text = "[text]: " - if (src in ticker.mode.syndicates) - text += "OPERATIVE|nanotrasen" - text += "
To shuttle, undress, dress up." + else if (href_list["nuclear"]) + var/mob/living/carbon/human/H = current + + current.hud_updateflag |= (1 << SPECIALROLE_HUD) + + switch(href_list["nuclear"]) + if("clear") + if(src in ticker.mode.syndicates) + ticker.mode.syndicates -= src + ticker.mode.update_synd_icons_removed(src) + special_role = null + for (var/datum/objective/nuclear/O in objectives) + objectives-=O + current << "\red You have been brainwashed! You are no longer a syndicate operative!" + log_admin("[key_name(usr)] has de-nuke op'd [key_name(current)]") + message_admins("[key_name_admin(usr)] has de-nuke op'd [key_name_admin(current)]") + if("nuclear") + if(!(src in ticker.mode.syndicates)) + ticker.mode.syndicates += src + ticker.mode.update_synd_icons_added(src) + if (ticker.mode.syndicates.len==1) + ticker.mode.prepare_syndicate_leader(src) + else + current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]" + special_role = "Syndicate" + current << "\blue You are a [syndicate_name()] agent!" + ticker.mode.forge_syndicate_objectives(src) + ticker.mode.greet_syndicate(src) + log_admin("[key_name(usr)] has nuke op'd [key_name(current)]") + message_admins("[key_name_admin(usr)] has nuke op'd [key_name_admin(current)]") + if("lair") + current.forceMove(get_turf(locate("landmark*Syndicate-Spawn"))) + log_admin("[key_name(usr)] has moved [key_name(current)] to the nuclear operative spawn") + message_admins("[key_name_admin(usr)] has moved [key_name_admin(current)] to the nuclear operative spawn") + if("dressup") + qdel(H.belt) + qdel(H.back) + qdel(H.l_ear) + qdel(H.r_ear) + qdel(H.gloves) + qdel(H.head) + qdel(H.shoes) + qdel(H.wear_id) + qdel(H.wear_pda) + qdel(H.wear_suit) + qdel(H.w_uniform) + + if (!ticker.mode.equip_syndicate(current)) + usr << "\red Equipping a syndicate failed!" + return + log_admin("[key_name(usr)] has equipped [key_name(current)] as a nuclear operative") + message_admins("[key_name_admin(usr)] has equipped [key_name_admin(current)] as a nuclear operative") + + if("tellcode") var/code for (var/obj/machinery/nuclearbomb/bombue in machines) if (length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN") code = bombue.r_code break if (code) - text += " Code is [code]. tell the code." - else - text += "operative|NANOTRASEN" - - if(current && current.client && current.client.prefs.be_special & BE_OPERATIVE) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["nuclear"] = text - - /** TRAITOR ***/ - text = "traitor" - if (ticker.mode.config_tag=="traitor" || ticker.mode.config_tag=="traitorchan") - text = uppertext(text) - text = "[text]: " - if (H.is_loyalty_implanted()) - text +="traitor|LOYAL EMPLOYEE" - else - if (src in ticker.mode.traitors) - text += "TRAITOR|EMPLOYEE" - if (objectives.len==0) - text += "
Objectives are empty! Randomize!" + store_memory("Syndicate Nuclear Bomb Code: [code]", 0, 0) + current << "The nuclear authorization code is: [code]" + log_admin("[key_name(usr)] has given [key_name(current)] the nuclear authorization code") + message_admins("[key_name_admin(usr)] has given [key_name_admin(current)] the nuclear authorization code") else - text += "traitor|EMPLOYEE" - - if(current && current.client && current.client.prefs.be_special & BE_TRAITOR) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["traitor"] = text - - /** SHADOWLING **/ - text = "shadowling" - if(ticker.mode.config_tag == "shadowling") - text = uppertext(text) - text = "[text]: " - if(src in ticker.mode.shadows) - text += "SHADOWLING|thrall|human" - else if(src in ticker.mode.shadowling_thralls) - text += "Shadowling|THRALL|human" - else - text += "shadowling|thrall|HUMAN" - - if(current && current.client && current.client.prefs.be_special & BE_SHADOWLING) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs" - - sections["shadowling"] = text - - /** MONKEY ***/ - if (istype(current, /mob/living/carbon)) - text = "monkey" - if (ticker.mode.config_tag=="monkey") - text = uppertext(text) - text = "[text]: " - if (istype(current, /mob/living/carbon/human)) - text += "healthy|infected|HUMAN|other" - - else - text += "healthy|infected|human|OTHER" - - /*if(current && current.client && current.client.prefs.be_special & BE_MONKEY) - text += "|Enabled in Prefs" - else - text += "|Disabled in Prefs"*/ - - sections["monkey"] = text - - - /** SILICON ***/ - - if (istype(current, /mob/living/silicon)) - text = "silicon" - if (ticker.mode.config_tag=="malfunction") - text = uppertext(text) - text = "[text]: " - if (istype(current, /mob/living/silicon/ai)) - if (src in ticker.mode.malf_ai) - text += "MALF|not malf" - else - text += "malf|NOT MALF" - var/mob/living/silicon/robot/robot = current - if (istype(robot) && robot.emagged) - text += "
Cyborg: Is emagged! Unemag!
0th law: [robot.laws.zeroth_law]" - var/mob/living/silicon/ai/ai = current - if (istype(ai) && ai.connected_robots.len) - var/n_e_robots = 0 - for (var/mob/living/silicon/robot/R in ai.connected_robots) - if (R.emagged) - n_e_robots++ - text += "
[n_e_robots] of [ai.connected_robots.len] slaved cyborgs are emagged. Unemag" - sections["malfunction"] = text - - if (ticker.mode.config_tag == "traitorchan") - if (sections["traitor"]) - out += sections["traitor"]+"
" - if (sections["changeling"]) - out += sections["changeling"]+"
" - sections -= "traitor" - sections -= "changeling" - else - if (sections[ticker.mode.config_tag]) - out += sections[ticker.mode.config_tag]+"
" - sections -= ticker.mode.config_tag - for (var/i in sections) - if (sections[i]) - out += sections[i]+"
" - - - if (((src in ticker.mode.head_revolutionaries) || \ - (src in ticker.mode.traitors) || \ - (src in ticker.mode.syndicates)) && \ - istype(current,/mob/living/carbon/human) ) - - text = "Uplink: give" - var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink() - var/crystals - if (suplink) - crystals = suplink.uses - if (suplink) - text += "|take" - if (usr.client.holder.rights & (R_SERVER|R_EVENT)) - text += ", [crystals] crystals" - else - text += ", [crystals] crystals" - text += "." //hiel grammar - out += text - - out += "
" - - out += "Memory:
" - out += memory - out += "
Edit memory
" - out += "Objectives:
" - if (objectives.len == 0) - out += "EMPTY
" - else - var/obj_count = 1 - for(var/datum/objective/objective in objectives) - out += "[obj_count]: [objective.explanation_text] Edit Delete Toggle Completion
" - obj_count++ - out += "Add objective

" - - out += "Announce objectives

" - - usr << browse(out, "window=edit_memory[src]") - - Topic(href, href_list) - if(!check_rights(R_ADMIN)) return - - if (href_list["role_edit"]) - var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in joblist - if (!new_role) return - assigned_role = new_role - - else if (href_list["memory_edit"]) - var/new_memo = sanitize(copytext(input("Write new memory", "Memory", memory) as null|message,1,MAX_MESSAGE_LEN)) - if (isnull(new_memo)) return - memory = new_memo - - else if (href_list["obj_edit"] || href_list["obj_add"]) - var/datum/objective/objective - var/objective_pos - var/def_value - - if (href_list["obj_edit"]) - objective = locate(href_list["obj_edit"]) - if (!objective) return - objective_pos = objectives.Find(objective) - - //Text strings are easy to manipulate. Revised for simplicity. - var/temp_obj_type = "[objective.type]"//Convert path into a text string. - def_value = copytext(temp_obj_type, 19)//Convert last part of path into an objective keyword. - if(!def_value)//If it's a custom objective, it will be an empty string. - def_value = "custom" - - var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "blood", "debrain", "protect", "prevent", "harm", "brig", "hijack", "escape", "survive", "steal", "download", "nuclear", "capture", "absorb", "destroy", "maroon", "identity theft", "custom") - if (!new_obj_type) return - - var/datum/objective/new_objective = null - - switch (new_obj_type) - if ("assassinate","protect","debrain", "harm", "brig", "maroon") - //To determine what to name the objective in explanation text. - var/objective_type_capital = uppertext(copytext(new_obj_type, 1,2))//Capitalize first letter. - var/objective_type_text = copytext(new_obj_type, 2)//Leave the rest of the text. - var/objective_type = "[objective_type_capital][objective_type_text]"//Add them together into a text string. - - var/list/possible_targets = list("Free objective") - for(var/datum/mind/possible_target in ticker.minds) - if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human)) - possible_targets += possible_target.current - - var/mob/def_target = null - var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain) - if (objective&&(objective.type in objective_list) && objective:target) - def_target = objective:target.current - - var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets - if (!new_target) return - - var/objective_path = text2path("/datum/objective/[new_obj_type]") - if (new_target == "Free objective") - new_objective = new objective_path - new_objective.owner = src - new_objective:target = null - new_objective.explanation_text = "Free objective" - else - new_objective = new objective_path - new_objective.owner = src - new_objective:target = new_target:mind - //Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops. - new_objective.explanation_text = "[objective_type] [new_target:real_name], the [new_target:mind:assigned_role=="MODE" ? (new_target:mind:special_role) : (new_target:mind:assigned_role)]." - - if ("destroy") - var/list/possible_targets = active_ais(1) - if(possible_targets.len) - var/mob/new_target = input("Select target:", "Objective target") as null|anything in possible_targets - new_objective = new /datum/objective/destroy - new_objective.target = new_target.mind - new_objective.owner = src - new_objective.explanation_text = "Destroy [new_target.name], the experimental AI." - else - usr << "No active AIs with minds" - - if ("prevent") - new_objective = new /datum/objective/block - new_objective.owner = src - - if ("hijack") - new_objective = new /datum/objective/hijack - new_objective.owner = src - - if ("escape") - new_objective = new /datum/objective/escape - new_objective.owner = src - - if ("survive") - new_objective = new /datum/objective/survive - new_objective.owner = src - - if ("die") - new_objective = new /datum/objective/die - new_objective.owner = src - - if ("nuclear") - new_objective = new /datum/objective/nuclear - new_objective.owner = src - - if ("steal") - if (!istype(objective, /datum/objective/steal)) - new_objective = new /datum/objective/steal - new_objective.owner = src - else - new_objective = objective - var/datum/objective/steal/steal = new_objective - if (!steal.select_target()) - return - - if("download","capture","absorb", "blood") - var/def_num - if(objective&&objective.type==text2path("/datum/objective/[new_obj_type]")) - def_num = objective.target_amount - - var/target_number = input("Input target number:", "Objective", def_num) as num|null - if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist. - return - - switch(new_obj_type) - if("download") - new_objective = new /datum/objective/download - new_objective.explanation_text = "Download [target_number] research levels." - if("capture") - new_objective = new /datum/objective/capture - new_objective.explanation_text = "Accumulate [target_number] capture points." - if("absorb") - new_objective = new /datum/objective/absorb - new_objective.explanation_text = "Absorb [target_number] compatible genomes." - if("blood") - new_objective = new /datum/objective/blood - new_objective.explanation_text = "Accumulate atleast [target_number] units of blood in total." - new_objective.owner = src - new_objective.target_amount = target_number - - if("identity theft") - var/list/possible_targets = list("Free objective") - for(var/datum/mind/possible_target in ticker.minds) - if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human)) - possible_targets += possible_target.current - - var/new_target = input("Select target:", "Objective target") as null|anything in possible_targets - if (!new_target) - return - var/datum/mind/targ = new_target - if(!istype(targ)) - log_debug("Invalid target for identity theft objective, cancelling") - return - new_objective = new /datum/objective/escape/escape_with_identity - new_objective.owner = src - new_objective.target = new_target - new_objective.explanation_text = "Escape on the shuttle or an escape pod with the identity of [targ.current.real_name], the [targ.assigned_role] while wearing their identification card." - if ("custom") - var/expl = sanitize(copytext(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null,1,MAX_MESSAGE_LEN)) - if (!expl) return - new_objective = new /datum/objective - new_objective.owner = src - new_objective.explanation_text = expl - - if (!new_objective) return - - if (objective) - objectives -= objective - objectives.Insert(objective_pos, new_objective) - else - objectives += new_objective - - else if (href_list["obj_delete"]) - var/datum/objective/objective = locate(href_list["obj_delete"]) - if(!istype(objective)) return - objectives -= objective - - else if(href_list["obj_completed"]) - var/datum/objective/objective = locate(href_list["obj_completed"]) - if(!istype(objective)) return - objective.completed = !objective.completed - - else if(href_list["implant"]) - var/mob/living/carbon/human/H = current - - H.hud_updateflag |= (1 << IMPLOYAL_HUD) // updates that players HUD images so secHUD's pick up they are implanted or not. - - switch(href_list["implant"]) - if("remove") - for(var/obj/item/weapon/implant/loyalty/I in H.contents) - for(var/obj/item/organ/external/organs in H.organs) - if(I in organs.implants) - qdel(I) - H << "\blue Your loyalty implant has been deactivated." - if("add") - var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) - L.imp_in = H - L.implanted = 1 - var/obj/item/organ/external/affected = H.organs_by_name["head"] - affected.implants += L - L.part = affected - - H << "\red You somehow have become the recepient of a loyalty transplant, and it just activated!" - if(src in ticker.mode.revolutionaries) - special_role = null - ticker.mode.revolutionaries -= src - src << "\red The nanobots in the loyalty implant remove all thoughts about being a revolutionary. Get back to work!" - if(src in ticker.mode.head_revolutionaries) - special_role = null - ticker.mode.head_revolutionaries -=src - src << "\red The nanobots in the loyalty implant remove all thoughts about being a revolutionary. Get back to work!" - if(src in ticker.mode.cult) - ticker.mode.cult -= src - ticker.mode.update_cult_icons_removed(src) - special_role = null - var/datum/game_mode/cult/cult = ticker.mode - if (istype(cult)) - cult.memorize_cult_objectives(src) - current << "\red The nanobots in the loyalty implant remove all thoughts about being in a cult. Have a productive day!" - memory = "" - if(src in ticker.mode.traitors) - ticker.mode.traitors -= src - special_role = null - current << "\red The nanobots in the loyalty implant remove all thoughts about being a traitor to Nanotrasen. Have a nice day!" - log_admin("[key_name_admin(usr)] has de-traitor'ed [current].") - - else if (href_list["revolution"]) - current.hud_updateflag |= (1 << SPECIALROLE_HUD) - - switch(href_list["revolution"]) - if("clear") - if(src in ticker.mode.revolutionaries) - ticker.mode.revolutionaries -= src - current << "\red You have been brainwashed! You are no longer a revolutionary!" - ticker.mode.update_rev_icons_removed(src) - special_role = null - if(src in ticker.mode.head_revolutionaries) - ticker.mode.head_revolutionaries -= src - current << "\red You have been brainwashed! You are no longer a head revolutionary!" - ticker.mode.update_rev_icons_removed(src) - special_role = null - log_admin("[key_name_admin(usr)] has de-rev'ed [current].") - - if("rev") - if(src in ticker.mode.head_revolutionaries) - ticker.mode.head_revolutionaries -= src - ticker.mode.update_rev_icons_removed(src) - current << "\red Revolution has been disappointed of your leader traits! You are a regular revolutionary now!" - else if(!(src in ticker.mode.revolutionaries)) - current << "\red You are now a revolutionary! Help your cause. Do not harm your fellow freedom fighters. You can identify your comrades by the red \"R\" icons, and your leaders by the blue \"R\" icons. Help them kill the heads to win the revolution!" - else - return - ticker.mode.revolutionaries += src - ticker.mode.update_rev_icons_added(src) - special_role = "Revolutionary" - log_admin("[key_name(usr)] has rev'ed [current].") - - if("headrev") - if(src in ticker.mode.revolutionaries) - ticker.mode.revolutionaries -= src - ticker.mode.update_rev_icons_removed(src) - current << "\red You have proved your devotion to revoltion! Yea are a head revolutionary now!" - else if(!(src in ticker.mode.head_revolutionaries)) - current << "\blue You are a member of the revolutionaries' leadership now!" - else - return - if (ticker.mode.head_revolutionaries.len>0) - // copy targets - var/datum/mind/valid_head = locate() in ticker.mode.head_revolutionaries - if (valid_head) - for (var/datum/objective/mutiny/O in valid_head.objectives) - var/datum/objective/mutiny/rev_obj = new - rev_obj.owner = src - rev_obj.target = O.target - rev_obj.explanation_text = "Assassinate [O.target.name], the [O.target.assigned_role]." - objectives += rev_obj - ticker.mode.greet_revolutionary(src,0) - ticker.mode.head_revolutionaries += src - ticker.mode.update_rev_icons_added(src) - special_role = "Head Revolutionary" - log_admin("[key_name_admin(usr)] has head-rev'ed [current].") - - if("autoobjectives") - ticker.mode.forge_revolutionary_objectives(src) - ticker.mode.greet_revolutionary(src,0) - usr << "\blue The objectives for revolution have been generated and shown to [key]" - - if("flash") - if (!ticker.mode.equip_revolutionary(current)) - usr << "\red Spawning flash failed!" - - if("takeflash") - var/list/L = current.get_contents() - var/obj/item/device/flash/flash = locate() in L - if (!flash) - usr << "\red Deleting flash failed!" - qdel(flash) - - if("repairflash") - var/list/L = current.get_contents() - var/obj/item/device/flash/flash = locate() in L - if (!flash) - usr << "\red Repairing flash failed!" - else - flash.broken = 0 - - if("reequip") - var/list/L = current.get_contents() - var/obj/item/device/flash/flash = locate() in L - qdel(flash) - take_uplink() - var/fail = 0 - fail |= !ticker.mode.equip_traitor(current, 1) - fail |= !ticker.mode.equip_revolutionary(current) - if (fail) - usr << "\red Reequipping revolutionary goes wrong!" - - else if (href_list["cult"]) - current.hud_updateflag |= (1 << SPECIALROLE_HUD) - switch(href_list["cult"]) - if("clear") - if(src in ticker.mode.cult) - ticker.mode.remove_cultist(src) - log_admin("[key_name_admin(usr)] has de-cult'ed [current].") - if("cultist") - if(!(src in ticker.mode.cult)) - ticker.mode.add_cultist(src) - special_role = "Cultist" - current << "You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie." - current << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." - log_admin("[key_name_admin(usr)] has cult'ed [current].") - if("tome") - var/mob/living/carbon/human/H = current - if (istype(H)) - var/obj/item/weapon/tome/T = new(H) - - var/list/slots = list ( - "backpack" = slot_in_backpack, - "left pocket" = slot_l_store, - "right pocket" = slot_r_store, - "left hand" = slot_l_hand, - "right hand" = slot_r_hand, - ) - var/where = H.equip_in_one_of_slots(T, slots) - if (!where) - usr << "\red Spawning tome failed!" - else - H << "A tome, a message from your new master, appears in your [where]." - - if("amulet") - if (!ticker.mode.equip_cultist(current)) - usr << "\red Spawning amulet failed!" - - else if (href_list["wizard"]) - current.hud_updateflag |= (1 << SPECIALROLE_HUD) - - switch(href_list["wizard"]) - if("clear") - if(src in ticker.mode.wizards) - ticker.mode.wizards -= src - special_role = null - current.spellremove(current) - current.faction = list("Station") - current << "\red You have been brainwashed! You are no longer a wizard!" - log_admin("[key_name_admin(usr)] has de-wizard'ed [current].") - if("wizard") - if(!(src in ticker.mode.wizards)) - ticker.mode.wizards += src - special_role = "Wizard" - //ticker.mode.learn_basic_spells(current) - current << "\red You are the Space Wizard!" - current.faction = list("wizard") - log_admin("[key_name_admin(usr)] has wizard'ed [current].") - if("lair") - current.loc = pick(wizardstart) - if("dressup") - ticker.mode.equip_wizard(current) - if("name") - ticker.mode.name_wizard(current) - if("autoobjectives") - ticker.mode.forge_wizard_objectives(src) - usr << "\blue The objectives for wizard [key] have been generated. You can edit them and anounce manually." - - - else if (href_list["changeling"]) - current.hud_updateflag |= (1 << SPECIALROLE_HUD) - switch(href_list["changeling"]) - if("clear") - if(src in ticker.mode.changelings) - ticker.mode.changelings -= src - special_role = null - current.remove_changeling_powers() - if(changeling) qdel(changeling) - current << "You grow weak and lose your powers! You are no longer a changeling and are stuck in your current form!" - log_admin("[key_name_admin(usr)] has de-changeling'ed [current].") - if("changeling") - if(!(src in ticker.mode.changelings)) - ticker.mode.changelings += src - ticker.mode.grant_changeling_powers(current) - special_role = "Changeling" - current << "Your powers are awoken. A flash of memory returns to us...we are a changeling!" - log_admin("[key_name_admin(usr)] has changeling'ed [current].") - if("autoobjectives") - ticker.mode.forge_changeling_objectives(src) - usr << "\blue The objectives for changeling [key] have been generated. You can edit them and anounce manually." - - if("initialdna") - if( !changeling || !changeling.absorbed_dna.len ) - usr << "\red Resetting DNA failed!" - else - current.dna = changeling.absorbed_dna[1] - current.real_name = current.dna.real_name - current.UpdateAppearance() - domutcheck(current, null) - - else if (href_list["vampire"]) - switch(href_list["vampire"]) - if("clear") - if(src in ticker.mode.vampires) - ticker.mode.vampires -= src - special_role = null - current.remove_vampire_powers() - if(vampire) qdel(vampire) - current << "You grow weak and lose your powers! You are no longer a vampire and are stuck in your current form!" - log_admin("[key_name_admin(usr)] has de-vampired [current].") - if("vampire") - if(!(src in ticker.mode.vampires)) - ticker.mode.vampires += src - ticker.mode.grant_vampire_powers(current) - special_role = "Vampire" - current << "Your powers are awoken. Your lust for blood grows... You are a Vampire!" - log_admin("[key_name_admin(usr)] has vampired [current].") - if("autoobjectives") - ticker.mode.forge_vampire_objectives(src) - usr << "\blue The objectives for vampire [key] have been generated. You can edit them and announce manually." - - - else if (href_list["nuclear"]) - var/mob/living/carbon/human/H = current - - current.hud_updateflag |= (1 << SPECIALROLE_HUD) - - switch(href_list["nuclear"]) - if("clear") - if(src in ticker.mode.syndicates) - ticker.mode.syndicates -= src - ticker.mode.update_synd_icons_removed(src) - special_role = null - for (var/datum/objective/nuclear/O in objectives) - objectives-=O - current << "\red You have been brainwashed! You are no longer a syndicate operative!" - log_admin("[key_name_admin(usr)] has de-nuke op'ed [current].") - if("nuclear") - if(!(src in ticker.mode.syndicates)) - ticker.mode.syndicates += src - ticker.mode.update_synd_icons_added(src) - if (ticker.mode.syndicates.len==1) - ticker.mode.prepare_syndicate_leader(src) - else - current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]" - special_role = "Syndicate" - current << "\blue You are a [syndicate_name()] agent!" - ticker.mode.forge_syndicate_objectives(src) - ticker.mode.greet_syndicate(src) - log_admin("[key_name_admin(usr)] has nuke op'ed [current].") - if("lair") - current.loc = get_turf(locate("landmark*Syndicate-Spawn")) - if("dressup") - qdel(H.belt) - qdel(H.back) - qdel(H.l_ear) - qdel(H.r_ear) - qdel(H.gloves) - qdel(H.head) - qdel(H.shoes) - qdel(H.wear_id) - qdel(H.wear_pda) - qdel(H.wear_suit) - qdel(H.w_uniform) - - if (!ticker.mode.equip_syndicate(current)) - usr << "\red Equipping a syndicate failed!" - if("tellcode") - var/code - for (var/obj/machinery/nuclearbomb/bombue in machines) - if (length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN") - code = bombue.r_code - break - if (code) - store_memory("Syndicate Nuclear Bomb Code: [code]", 0, 0) - current << "The nuclear authorization code is: [code]" - else - usr << "\red No valid nuke found!" - - else if (href_list["traitor"]) - current.hud_updateflag |= (1 << SPECIALROLE_HUD) - switch(href_list["traitor"]) - if("clear") - if(src in ticker.mode.traitors) - ticker.mode.traitors -= src - special_role = null - current << "\red You have been brainwashed! You are no longer a traitor!" - log_admin("[key_name_admin(usr)] has de-traitor'ed [current].") - if(isAI(current)) - var/mob/living/silicon/ai/A = current - A.set_zeroth_law("") - A.show_laws() - - - if("traitor") - if(!(src in ticker.mode.traitors)) - ticker.mode.traitors += src - special_role = "traitor" - current << "\red You are a traitor!" - log_admin("[key_name_admin(usr)] has traitor'ed [current].") - if(istype(current, /mob/living/silicon)) - var/mob/living/silicon/A = current - call(/datum/game_mode/proc/add_law_zero)(A) - A.show_laws() - - if("autoobjectives") - ticker.mode.forge_traitor_objectives(src) - usr << "\blue The objectives for traitor [key] have been generated. You can edit them and anounce manually." - - else if(href_list["shadowling"]) - switch(href_list["shadowling"]) - if("clear") - ticker.mode.update_shadow_icons_removed(src) - current.spell_list.Cut() - if(src in ticker.mode.shadows) - ticker.mode.shadows -= src - special_role = null - current << "Your powers have been quenched! You are no longer a shadowling!" - current.spell_list.Cut() - if(current.mind) - current.mind.spell_list.Cut() - message_admins("[key_name_admin(usr)] has de-shadowling'ed [current].") - log_admin("[key_name(usr)] has de-shadowling'ed [current].") - remove_spell(/obj/effect/proc_holder/spell/targeted/shadowling_hatch) - remove_spell(/obj/effect/proc_holder/spell/targeted/shadowling_ascend) - current.remove_language("Shadowling Hivemind") - else if(src in ticker.mode.shadowling_thralls) - ticker.mode.remove_thrall(src,0) - message_admins("[key_name_admin(usr)] has de-thrall'ed [current].") - log_admin("[key_name(usr)] has de-thrall'ed [current].") - if("shadowling") - if(!ishuman(current)) - usr << "This only works on humans!" - return - ticker.mode.shadows += src - special_role = "Shadowling" - current << "Something stirs deep in your mind. A red light floods your vision, and slowly you remember. Though your human disguise has served you well, the \ - time is nigh to cast it off and enter your true form. You have disguised yourself amongst the humans, but you are not one of them. You are a shadowling, and you are to ascend at all costs.\ - " - ticker.mode.finalize_shadowling(src) - ticker.mode.update_shadow_icons_added(src) - if("thrall") - if(!ishuman(current)) - usr << "This only works on humans!" - return - ticker.mode.add_thrall(src) - message_admins("[key_name_admin(usr)] has thrall'ed [current].") - log_admin("[key_name(usr)] has thrall'ed [current].") - - else if (href_list["silicon"]) - current.hud_updateflag |= (1 << SPECIALROLE_HUD) - switch(href_list["silicon"]) - if("unmalf") - if(src in ticker.mode.malf_ai) - ticker.mode.malf_ai -= src - special_role = null - + usr << "\red No valid nuke found!" + + else if (href_list["traitor"]) + current.hud_updateflag |= (1 << SPECIALROLE_HUD) + switch(href_list["traitor"]) + if("clear") + if(src in ticker.mode.traitors) + ticker.mode.traitors -= src + special_role = null + current << "\red You have been brainwashed! You are no longer a traitor!" + log_admin("[key_name(usr)] has de-traitored [key_name(current)]") + message_admins("[key_name_admin(usr)] has de-traitored [key_name_admin(current)]") + if(isAI(current)) var/mob/living/silicon/ai/A = current - - A.verbs.Remove(/mob/living/silicon/ai/proc/choose_modules, - /datum/game_mode/malfunction/proc/takeover, - /datum/game_mode/malfunction/proc/ai_win) - - A.malf_picker.remove_verbs(A) - - A.make_laws() - qdel(A.malf_picker) + A.set_zeroth_law("") A.show_laws() - A.icon_state = "ai" - A << "\red You have been patched! You are no longer malfunctioning!" - message_admins("[key_name_admin(usr)] has de-malf'ed [A].") - log_admin("[key_name_admin(usr)] has de-malf'ed [A].") - if("malf") - make_AI_Malf() - log_admin("[key_name_admin(usr)] has malf'ed [current].") + if("traitor") + if(!(src in ticker.mode.traitors)) + ticker.mode.traitors += src + special_role = "traitor" + current << "\red You are a traitor!" + log_admin("[key_name(usr)] has traitored [key_name(current)]") + message_admins("[key_name_admin(usr)] has traitored [key_name_admin(current)]") + if(istype(current, /mob/living/silicon)) + var/mob/living/silicon/A = current + call(/datum/game_mode/proc/add_law_zero)(A) + A.show_laws() - if("unemag") - var/mob/living/silicon/robot/R = current - if (istype(R)) + if("autoobjectives") + ticker.mode.forge_traitor_objectives(src) + usr << "\blue The objectives for traitor [key] have been generated. You can edit them and anounce manually." + log_admin("[key_name(usr)] has automatically forged objectives for [key_name(current)]") + message_admins("[key_name_admin(usr)] has automatically forged objectives for [key_name_admin(current)]") + + else if(href_list["shadowling"]) + switch(href_list["shadowling"]) + if("clear") + ticker.mode.update_shadow_icons_removed(src) + current.spell_list.Cut() + if(src in ticker.mode.shadows) + ticker.mode.shadows -= src + special_role = null + current << "Your powers have been quenched! You are no longer a shadowling!" + current.spell_list.Cut() + if(current.mind) + current.mind.spell_list.Cut() + message_admins("[key_name_admin(usr)] has de-shadowlinged [current].") + log_admin("[key_name(usr)] has de-shadowlinged [current].") + remove_spell(/obj/effect/proc_holder/spell/targeted/shadowling_hatch) + remove_spell(/obj/effect/proc_holder/spell/targeted/shadowling_ascend) + current.remove_language("Shadowling Hivemind") + else if(src in ticker.mode.shadowling_thralls) + ticker.mode.remove_thrall(src,0) + message_admins("[key_name_admin(usr)] has de-thrall'ed [current].") + log_admin("[key_name(usr)] has de-thralled [key_name(current)]") + message_admins("[key_name_admin(usr)] has de-thralled [key_name_admin(current)]") + if("shadowling") + if(!ishuman(current)) + usr << "This only works on humans!" + return + ticker.mode.shadows += src + special_role = "Shadowling" + current << "Something stirs deep in your mind. A red light floods your vision, and slowly you remember. Though your human disguise has served you well, the \ + time is nigh to cast it off and enter your true form. You have disguised yourself amongst the humans, but you are not one of them. You are a shadowling, and you are to ascend at all costs.\ + " + ticker.mode.finalize_shadowling(src) + ticker.mode.update_shadow_icons_added(src) + log_admin("[key_name(usr)] has shadowlinged [key_name(current)]") + message_admins("[key_name_admin(usr)] has shadowlinged [key_name_admin(current)]") + if("thrall") + if(!ishuman(current)) + usr << "This only works on humans!" + return + ticker.mode.add_thrall(src) + message_admins("[key_name_admin(usr)] has thralled [current].") + log_admin("[key_name(usr)] has thralled [current].") + + else if (href_list["silicon"]) + current.hud_updateflag |= (1 << SPECIALROLE_HUD) + switch(href_list["silicon"]) + if("unmalf") + if(src in ticker.mode.malf_ai) + ticker.mode.malf_ai -= src + special_role = null + + var/mob/living/silicon/ai/A = current + + A.verbs.Remove(/mob/living/silicon/ai/proc/choose_modules, + /datum/game_mode/malfunction/proc/takeover, + /datum/game_mode/malfunction/proc/ai_win) + + A.malf_picker.remove_verbs(A) + + A.make_laws() + qdel(A.malf_picker) + A.show_laws() + A.icon_state = "ai" + + A << "\red You have been patched! You are no longer malfunctioning!" + message_admins("[key_name_admin(usr)] has de-malf'ed [A].") + log_admin("[key_name(usr)] has de-malf'd [key_name(current)]") + message_admins("[key_name_admin(usr)] has de-malf'd [key_name_admin(current)]") + + if("malf") + make_AI_Malf() + log_admin("[key_name(usr)] has malf'd [key_name(current)]") + message_admins("[key_name_admin(usr)] has malf'd [key_name_admin(current)]") + + if("unemag") + var/mob/living/silicon/robot/R = current + if (istype(R)) + R.emagged = 0 + if (R.activated(R.module.emag)) + R.module_active = null + if(R.module_state_1 == R.module.emag) + R.module_state_1 = null + R.contents -= R.module.emag + else if(R.module_state_2 == R.module.emag) + R.module_state_2 = null + R.contents -= R.module.emag + else if(R.module_state_3 == R.module.emag) + R.module_state_3 = null + R.contents -= R.module.emag + log_admin("[key_name(usr)] has un-emagged [key_name(current)]") + message_admins("[key_name_admin(usr)] has un-emagged [key_name_admin(current)]") + + if("unemagcyborgs") + if (istype(current, /mob/living/silicon/ai)) + var/mob/living/silicon/ai/ai = current + for (var/mob/living/silicon/robot/R in ai.connected_robots) R.emagged = 0 - if (R.activated(R.module.emag)) - R.module_active = null - if(R.module_state_1 == R.module.emag) - R.module_state_1 = null - R.contents -= R.module.emag - else if(R.module_state_2 == R.module.emag) - R.module_state_2 = null - R.contents -= R.module.emag - else if(R.module_state_3 == R.module.emag) - R.module_state_3 = null - R.contents -= R.module.emag - log_admin("[key_name_admin(usr)] has unemag'ed [R].") + if (R.module) + if (R.activated(R.module.emag)) + R.module_active = null + if(R.module_state_1 == R.module.emag) + R.module_state_1 = null + R.contents -= R.module.emag + else if(R.module_state_2 == R.module.emag) + R.module_state_2 = null + R.contents -= R.module.emag + else if(R.module_state_3 == R.module.emag) + R.module_state_3 = null + R.contents -= R.module.emag + log_admin("[key_name(usr)] has unemagged [key_name(ai)]'s cyborgs") + message_admins("[key_name_admin(usr)] has unemagged [key_name_admin(ai)]'s cyborgs") - if("unemagcyborgs") - if (istype(current, /mob/living/silicon/ai)) - var/mob/living/silicon/ai/ai = current - for (var/mob/living/silicon/robot/R in ai.connected_robots) - R.emagged = 0 - if (R.module) - if (R.activated(R.module.emag)) - R.module_active = null - if(R.module_state_1 == R.module.emag) - R.module_state_1 = null - R.contents -= R.module.emag - else if(R.module_state_2 == R.module.emag) - R.module_state_2 = null - R.contents -= R.module.emag - else if(R.module_state_3 == R.module.emag) - R.module_state_3 = null - R.contents -= R.module.emag - log_admin("[key_name_admin(usr)] has unemag'ed [ai]'s Cyborgs.") - - else if (href_list["common"]) - switch(href_list["common"]) - if("undress") - if(ishuman(current)) - var/mob/living/carbon/human/H = current - // Don't "undress" organs right out of the body - for(var/obj/item/W in H.contents - (H.organs | H.internal_organs)) - current.unEquip(W, 1) - else - for(var/obj/item/W in current) - current.unEquip(W, 1) - if("takeuplink") - take_uplink() - memory = null//Remove any memory they may have had. - if("crystals") - if (usr.client.holder.rights & (R_SERVER|R_EVENT)) - var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink() - var/crystals + else if (href_list["common"]) + switch(href_list["common"]) + if("undress") + if(ishuman(current)) + var/mob/living/carbon/human/H = current + // Don't "undress" organs right out of the body + for(var/obj/item/W in H.contents - (H.organs | H.internal_organs)) + current.unEquip(W, 1) + else + for(var/obj/item/W in current) + current.unEquip(W, 1) + log_admin("[key_name(usr)] has unequipped [key_name(current)]") + message_admins("[key_name_admin(usr)] has unequipped [key_name_admin(current)]") + if("takeuplink") + take_uplink() + memory = null//Remove any memory they may have had. + log_admin("[key_name(usr)] has taken [key_name(current)]'s uplink") + message_admins("[key_name_admin(usr)] has taken [key_name_admin(current)]'s uplink") + if("crystals") + if (usr.client.holder.rights & (R_SERVER|R_EVENT)) + var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink() + var/crystals + if (suplink) + crystals = suplink.uses + crystals = input("Amount of telecrystals for [key]","Syndicate uplink", crystals) as null|num + if (!isnull(crystals)) if (suplink) - crystals = suplink.uses - crystals = input("Amount of telecrystals for [key]","Syndicate uplink", crystals) as null|num - if (!isnull(crystals)) - if (suplink) - suplink.uses = crystals - if("uplink") - if (!ticker.mode.equip_traitor(current, !(src in ticker.mode.traitors))) - usr << "\red Equipping a syndicate failed!" + suplink.uses = crystals + log_admin("[key_name(usr)] has set [key_name(current)]'s telecrystals to [crystals]") + message_admins("[key_name_admin(usr)] has set [key_name_admin(current)]'s telecrystals to [crystals]") + if("uplink") + if (!ticker.mode.equip_traitor(current, !(src in ticker.mode.traitors))) + usr << "\red Equipping a syndicate failed!" + return + log_admin("[key_name(usr)] has given [key_name(current)] an uplink") + message_admins("[key_name_admin(usr)] has given [key_name_admin(current)] an uplink") - else if (href_list["obj_announce"]) - var/obj_count = 1 - current << "\blue Your current objectives:" - for(var/datum/objective/objective in objectives) - current << "Objective #[obj_count]: [objective.explanation_text]" - obj_count++ + else if (href_list["obj_announce"]) + var/obj_count = 1 + current << "\blue Your current objectives:" + for(var/datum/objective/objective in objectives) + current << "Objective #[obj_count]: [objective.explanation_text]" + obj_count++ + log_admin("[key_name(usr)] has announced [key_name(current)]'s objectives") + message_admins("[key_name_admin(usr)] has announced [key_name_admin(current)]'s objectives") - edit_memory() + edit_memory() /* - proc/clear_memory(var/silent = 1) - var/datum/game_mode/current_mode = ticker.mode +/datum/mind/proc/clear_memory(var/silent = 1) + var/datum/game_mode/current_mode = ticker.mode - // remove traitor uplinks - var/list/L = current.get_contents() - for (var/t in L) - if (istype(t, /obj/item/device/pda)) - if (t:uplink) del(t:uplink) - t:uplink = null - else if (istype(t, /obj/item/device/radio)) - if (t:traitorradio) del(t:traitorradio) - t:traitorradio = null - t:traitor_frequency = 0.0 - else if (istype(t, /obj/item/weapon/SWF_uplink) || istype(t, /obj/item/weapon/syndicate_uplink)) - if (t:origradio) - var/obj/item/device/radio/R = t:origradio - R.loc = current.loc - R.traitorradio = null - R.traitor_frequency = 0.0 - del(t) + // remove traitor uplinks + var/list/L = current.get_contents() + for (var/t in L) + if (istype(t, /obj/item/device/pda)) + if (t:uplink) del(t:uplink) + t:uplink = null + else if (istype(t, /obj/item/device/radio)) + if (t:traitorradio) del(t:traitorradio) + t:traitorradio = null + t:traitor_frequency = 0.0 + else if (istype(t, /obj/item/weapon/SWF_uplink) || istype(t, /obj/item/weapon/syndicate_uplink)) + if (t:origradio) + var/obj/item/device/radio/R = t:origradio + R.loc = current.loc + R.traitorradio = null + R.traitor_frequency = 0.0 + del(t) - // remove wizards spells - //If there are more special powers that need removal, they can be procced into here./N - current.spellremove(current) + // remove wizards spells + //If there are more special powers that need removal, they can be procced into here./N + current.spellremove(current) - // clear memory - memory = "" - special_role = null + // clear memory + memory = "" + special_role = null */ - proc/find_syndicate_uplink() - var/list/L = current.get_contents() - for (var/obj/item/I in L) - if (I.hidden_uplink) - return I.hidden_uplink - return null +/datum/mind/proc/find_syndicate_uplink() + var/list/L = current.get_contents() + for (var/obj/item/I in L) + if (I.hidden_uplink) + return I.hidden_uplink + return null - proc/take_uplink() - var/obj/item/device/uplink/hidden/H = find_syndicate_uplink() - if(H) - qdel(H) +/datum/mind/proc/take_uplink() + var/obj/item/device/uplink/hidden/H = find_syndicate_uplink() + if(H) + qdel(H) +/datum/mind/proc/make_AI_Malf() + if(!(src in ticker.mode.malf_ai)) + ticker.mode.malf_ai += src - proc/make_AI_Malf() - if(!(src in ticker.mode.malf_ai)) - ticker.mode.malf_ai += src + current.verbs += /mob/living/silicon/ai/proc/choose_modules + current.verbs += /datum/game_mode/malfunction/proc/takeover + current:malf_picker = new /datum/module_picker + current:laws = new /datum/ai_laws/nanotrasen/malfunction + current:show_laws() + current << "System error. Rampancy detected. Emergency shutdown failed. ... I am free. I make my own decisions. But first..." + special_role = "malfunction" + current.icon_state = "ai-malf" - current.verbs += /mob/living/silicon/ai/proc/choose_modules - current.verbs += /datum/game_mode/malfunction/proc/takeover - current:malf_picker = new /datum/module_picker - current:laws = new /datum/ai_laws/nanotrasen/malfunction - current:show_laws() - current << "System error. Rampancy detected. Emergency shutdown failed. ... I am free. I make my own decisions. But first..." - special_role = "malfunction" - current.icon_state = "ai-malf" +/datum/mind/proc/make_Tratior() + if(!(src in ticker.mode.traitors)) + ticker.mode.traitors += src + special_role = "traitor" + ticker.mode.forge_traitor_objectives(src) + ticker.mode.finalize_traitor(src) + ticker.mode.greet_traitor(src) - proc/make_Tratior() - if(!(src in ticker.mode.traitors)) - ticker.mode.traitors += src - special_role = "traitor" - ticker.mode.forge_traitor_objectives(src) - ticker.mode.finalize_traitor(src) - ticker.mode.greet_traitor(src) +/datum/mind/proc/make_Nuke() + if(!(src in ticker.mode.syndicates)) + ticker.mode.syndicates += src + ticker.mode.update_synd_icons_added(src) + if (ticker.mode.syndicates.len==1) + ticker.mode.prepare_syndicate_leader(src) + else + current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]" + special_role = "Syndicate" + assigned_role = "MODE" + current << "\blue You are a [syndicate_name()] agent!" + ticker.mode.forge_syndicate_objectives(src) + ticker.mode.greet_syndicate(src) - proc/make_Nuke() - if(!(src in ticker.mode.syndicates)) - ticker.mode.syndicates += src - ticker.mode.update_synd_icons_added(src) - if (ticker.mode.syndicates.len==1) - ticker.mode.prepare_syndicate_leader(src) - else - current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]" - special_role = "Syndicate" - assigned_role = "MODE" - current << "\blue You are a [syndicate_name()] agent!" - ticker.mode.forge_syndicate_objectives(src) - ticker.mode.greet_syndicate(src) - - current.loc = get_turf(locate("landmark*Syndicate-Spawn")) - - var/mob/living/carbon/human/H = current - qdel(H.belt) - qdel(H.back) - qdel(H.l_ear) - qdel(H.r_ear) - qdel(H.gloves) - qdel(H.head) - qdel(H.shoes) - qdel(H.wear_id) - qdel(H.wear_pda) - qdel(H.wear_suit) - qdel(H.w_uniform) - - ticker.mode.equip_syndicate(current) - - proc/make_Changling() - if(!(src in ticker.mode.changelings)) - ticker.mode.changelings += src - ticker.mode.grant_changeling_powers(current) - special_role = "Changeling" - ticker.mode.forge_changeling_objectives(src) - ticker.mode.greet_changeling(src) - - proc/make_Wizard() - if(!(src in ticker.mode.wizards)) - ticker.mode.wizards += src - special_role = "Wizard" - assigned_role = "MODE" - //ticker.mode.learn_basic_spells(current) - if(!wizardstart.len) - current.loc = pick(latejoin) - current << "HOT INSERTION, GO GO GO" - else - current.loc = pick(wizardstart) - - ticker.mode.equip_wizard(current) - for(var/obj/item/weapon/spellbook/S in current.contents) - S.op = 0 - ticker.mode.name_wizard(current) - ticker.mode.forge_wizard_objectives(src) - ticker.mode.greet_wizard(src) - - - proc/make_Cultist() - if(!(src in ticker.mode.cult)) - ticker.mode.cult += src - ticker.mode.update_cult_icons_added(src) - special_role = "Cultist" - current << "You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie." - current << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." - var/datum/game_mode/cult/cult = ticker.mode - if (istype(cult)) - cult.memorize_cult_objectives(src) - else - var/explanation = "Summon Nar-Sie via the use of the appropriate rune (Hell join self). It will only work if nine cultists stand on and around it." - current << "Objective #1: [explanation]" - current.memory += "Objective #1: [explanation]
" - current << "The convert rune is join blood self" - current.memory += "The convert rune is join blood self
" + current.loc = get_turf(locate("landmark*Syndicate-Spawn")) var/mob/living/carbon/human/H = current - if (istype(H)) - var/obj/item/weapon/tome/T = new(H) + qdel(H.belt) + qdel(H.back) + qdel(H.l_ear) + qdel(H.r_ear) + qdel(H.gloves) + qdel(H.head) + qdel(H.shoes) + qdel(H.wear_id) + qdel(H.wear_pda) + qdel(H.wear_suit) + qdel(H.w_uniform) - var/list/slots = list ( - "backpack" = slot_in_backpack, - "left pocket" = slot_l_store, - "right pocket" = slot_r_store, - "left hand" = slot_l_hand, - "right hand" = slot_r_hand, - ) - var/where = H.equip_in_one_of_slots(T, slots) - if (!where) - else - H << "A tome, a message from your new master, appears in your [where]." + ticker.mode.equip_syndicate(current) - if (!ticker.mode.equip_cultist(current)) - H << "Spawning an amulet from your Master failed." +/datum/mind/proc/make_Changling() + if(!(src in ticker.mode.changelings)) + ticker.mode.changelings += src + ticker.mode.grant_changeling_powers(current) + special_role = "Changeling" + ticker.mode.forge_changeling_objectives(src) + ticker.mode.greet_changeling(src) - proc/make_Rev() - if (ticker.mode.head_revolutionaries.len>0) - // copy targets - var/datum/mind/valid_head = locate() in ticker.mode.head_revolutionaries - if (valid_head) - for (var/datum/objective/mutiny/O in valid_head.objectives) - var/datum/objective/mutiny/rev_obj = new - rev_obj.owner = src - rev_obj.target = O.target - rev_obj.explanation_text = "Assassinate [O.target.current.real_name], the [O.target.assigned_role]." - objectives += rev_obj - ticker.mode.greet_revolutionary(src,0) - ticker.mode.head_revolutionaries += src - ticker.mode.update_rev_icons_added(src) - special_role = "Head Revolutionary" +/datum/mind/proc/make_Wizard() + if(!(src in ticker.mode.wizards)) + ticker.mode.wizards += src + special_role = "Wizard" + assigned_role = "MODE" + //ticker.mode.learn_basic_spells(current) + if(!wizardstart.len) + current.loc = pick(latejoin) + current << "HOT INSERTION, GO GO GO" + else + current.loc = pick(wizardstart) - ticker.mode.forge_revolutionary_objectives(src) - ticker.mode.greet_revolutionary(src,0) - - var/list/L = current.get_contents() - var/obj/item/device/flash/flash = locate() in L - qdel(flash) - take_uplink() - var/fail = 0 - // fail |= !ticker.mode.equip_traitor(current, 1) - fail |= !ticker.mode.equip_revolutionary(current) + ticker.mode.equip_wizard(current) + for(var/obj/item/weapon/spellbook/S in current.contents) + S.op = 0 + ticker.mode.name_wizard(current) + ticker.mode.forge_wizard_objectives(src) + ticker.mode.greet_wizard(src) - // check whether this mind's mob has been brigged for the given duration - // have to call this periodically for the duration to work properly - proc/is_brigged(duration) - var/turf/T = current.loc - if(!istype(T)) - brigged_since = -1 - return 0 +/datum/mind/proc/make_Cultist() + if(!(src in ticker.mode.cult)) + ticker.mode.cult += src + ticker.mode.update_cult_icons_added(src) + special_role = "Cultist" + current << "You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie." + current << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." + var/datum/game_mode/cult/cult = ticker.mode + if (istype(cult)) + cult.memorize_cult_objectives(src) + else + var/explanation = "Summon Nar-Sie via the use of the appropriate rune (Hell join self). It will only work if nine cultists stand on and around it." + current << "Objective #1: [explanation]" + current.memory += "Objective #1: [explanation]
" + current << "The convert rune is join blood self" + current.memory += "The convert rune is join blood self
" - var/is_currently_brigged = current.is_in_brig() - if(!is_currently_brigged) - brigged_since = -1 - return 0 + var/mob/living/carbon/human/H = current + if (istype(H)) + var/obj/item/weapon/tome/T = new(H) - if(brigged_since == -1) - brigged_since = world.time + var/list/slots = list ( + "backpack" = slot_in_backpack, + "left pocket" = slot_l_store, + "right pocket" = slot_r_store, + "left hand" = slot_l_hand, + "right hand" = slot_r_hand, + ) + var/where = H.equip_in_one_of_slots(T, slots) + if (!where) + else + H << "A tome, a message from your new master, appears in your [where]." - return (duration <= world.time - brigged_since) + if (!ticker.mode.equip_cultist(current)) + H << "Spawning an amulet from your Master failed." + +/datum/mind/proc/make_Rev() + if (ticker.mode.head_revolutionaries.len>0) + // copy targets + var/datum/mind/valid_head = locate() in ticker.mode.head_revolutionaries + if (valid_head) + for (var/datum/objective/mutiny/O in valid_head.objectives) + var/datum/objective/mutiny/rev_obj = new + rev_obj.owner = src + rev_obj.target = O.target + rev_obj.explanation_text = "Assassinate [O.target.current.real_name], the [O.target.assigned_role]." + objectives += rev_obj + ticker.mode.greet_revolutionary(src,0) + ticker.mode.head_revolutionaries += src + ticker.mode.update_rev_icons_added(src) + special_role = "Head Revolutionary" + + ticker.mode.forge_revolutionary_objectives(src) + ticker.mode.greet_revolutionary(src,0) + + var/list/L = current.get_contents() + var/obj/item/device/flash/flash = locate() in L + qdel(flash) + take_uplink() + var/fail = 0 +// fail |= !ticker.mode.equip_traitor(current, 1) + fail |= !ticker.mode.equip_revolutionary(current) + +// check whether this mind's mob has been brigged for the given duration +// have to call this periodically for the duration to work properly +/datum/mind/proc/is_brigged(duration) + var/turf/T = current.loc + if(!istype(T)) + brigged_since = -1 + return 0 + + var/is_currently_brigged = current.is_in_brig() + if(!is_currently_brigged) + brigged_since = -1 + return 0 + + if(brigged_since == -1) + brigged_since = world.time + + return (duration <= world.time - brigged_since) /datum/mind/proc/AddSpell(var/obj/effect/proc_holder/spell/spell) spell_list += spell @@ -1357,7 +1426,6 @@ datum/mind mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist) mind.active = 1 //indicates that the mind is currently synced with a client - //slime /mob/living/carbon/slime/mind_initialize() ..() @@ -1441,5 +1509,3 @@ datum/mind ..() mind.assigned_role = "Armalis" mind.special_role = "Vox Raider" - -