Merge branch 'Baystation12/dev' into ofStaffsAndChange

Conflicts:
	code/modules/projectiles/projectile/change.dm
This commit is contained in:
Kelenius
2015-03-28 19:37:50 +03:00
399 changed files with 10330 additions and 18100 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null)
switch(param)
if("reason")
if(!value)
value = input("Insert the new reason for [pckey]'s ban", "New Reason", "[reason]", null) as null|text
value = sanitize(input("Insert the new reason for [pckey]'s ban", "New Reason", "[reason]", null) as null|text)
value = sql_sanitize_text(value)
if(!value)
usr << "Cancelled"
+87 -53
View File
@@ -92,7 +92,7 @@ var/global/floorIsLava = 0
body += "<br>"
//Monkey
if(ismonkey(M))
if(issmall(M))
body += "<B>Monkeyized</B> | "
else
body += "<A href='?src=\ref[src];monkeyone=\ref[M]'>Monkeyize</A> | "
@@ -725,10 +725,10 @@ var/global/floorIsLava = 0
set desc="Announce your desires to the world"
if(!check_rights(0)) return
var/message = input("Global message to send:", "Admin Announce", null, null) as message
var/message = input("Global message to send:", "Admin Announce", null, null) as message//todo: sanitize for all?
if(message)
if(!check_rights(R_SERVER,0))
message = adminscrub(message,500)
message = sanitize(message, 500, extra = 0)
world << "\blue <b>[usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:</b>\n \t [message]"
log_admin("Announce: [key_name(usr)] : [message]")
feedback_add_details("admin_verb","A") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -937,64 +937,22 @@ var/global/floorIsLava = 0
return 0
if (!istype(M))
return 0
if((M.mind in ticker.mode.head_revolutionaries) || (M.mind in ticker.mode.revolutionaries))
if (ticker.mode.config_tag == "revolution")
return 2
return 1
if(M.mind in ticker.mode.cult)
if (ticker.mode.config_tag == "cult")
return 2
return 1
if(M.mind in ticker.mode.malf_ai)
if (ticker.mode.config_tag == "malfunction")
return 2
return 1
if(M.mind in ticker.mode.syndicates)
if (ticker.mode.config_tag == "mercenary")
return 2
return 1
if(M.mind in ticker.mode.wizards)
if (ticker.mode.config_tag == "wizard")
return 2
return 1
if(M.mind in ticker.mode.changelings)
if (ticker.mode.config_tag == "changeling")
return 2
return 1
for(var/datum/disease/D in M.viruses)
if(istype(D, /datum/disease/jungle_fever))
if (ticker.mode.config_tag == "monkey")
return 2
if(M.mind)
if(ticker.mode.antag_templates && ticker.mode.antag_templates.len)
for(var/datum/antagonist/antag in ticker.mode.antag_templates)
if(antag.is_antagonist(M.mind))
return 2
else if(M.mind.special_role)
return 1
if(isrobot(M))
var/mob/living/silicon/robot/R = M
if(R.emagged)
return 1
if(M.mind&&M.mind.special_role)//If they have a mind and special role, they are some type of traitor or antagonist.
return 1
return 0
/*
/datum/admins/proc/get_sab_desc(var/target)
switch(target)
if(1)
return "Destroy at least 70% of the phoron canisters on the station"
if(2)
return "Destroy the AI"
if(3)
var/count = 0
for(var/mob/living/carbon/monkey/Monkey in world)
if(Monkey.z in station_levels)
count++
return "Kill all [count] of the monkeys on the station"
if(4)
return "Cut power to at least 80% of the station"
else
return "Error: Invalid sabotage target: [target]"
*/
/datum/admins/proc/spawn_fruit()
set category = "Debug"
set desc = "Spawn the product of a seed."
@@ -1070,11 +1028,87 @@ var/global/floorIsLava = 0
M.mind.edit_memory()
feedback_add_details("admin_verb","STP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/show_game_mode()
set category = "Admin"
set desc = "Show the current round configuration."
set name = "Show Game Mode"
if(!ticker || !ticker.mode)
alert("Not before roundstart!", "Alert")
return
var/out = "<font size=3><b>Current mode: [ticker.mode.name] (<a href='?src=\ref[ticker.mode];debug_antag=self'>[ticker.mode.config_tag]</a>)</b></font><br/>"
out += "<hr>"
if(ticker.mode.ert_disabled)
out += "<b>Emergency Response Teams:</b> <a href='?src=\ref[ticker.mode];toggle=ert'>disabled</a>"
else
out += "<b>Emergency Response Teams:</b> <a href='?src=\ref[ticker.mode];toggle=ert'>enabled</a>"
out += "<br/>"
if(ticker.mode.deny_respawn)
out += "<b>Respawning:</b> <a href='?src=\ref[ticker.mode];toggle=respawn'>disallowed</a>"
else
out += "<b>Respawning:</b> <a href='?src=\ref[ticker.mode];toggle=respawn'>allowed</a>"
out += "<br/>"
out += "<b>Shuttle delay multiplier:</b> <a href='?src=\ref[ticker.mode];set=shuttle_delay'>[ticker.mode.shuttle_delay]</a><br/>"
if(ticker.mode.auto_recall_shuttle)
out += "<b>Shuttle auto-recall:</b> <a href='?src=\ref[ticker.mode];toggle=shuttle_recall'>enabled</a>"
else
out += "<b>Shuttle auto-recall:</b> <a href='?src=\ref[ticker.mode];toggle=shuttle_recall'>disabled</a>"
out += "<br/><br/>"
if(ticker.mode.event_delay_mod_moderate)
out += "<b>Moderate event time modifier:</b> <a href='?src=\ref[ticker.mode];set=event_modifier_moderate'>[ticker.mode.event_delay_mod_moderate]</a><br/>"
else
out += "<b>Moderate event time modifier:</b> <a href='?src=\ref[ticker.mode];set=event_modifier_moderate'>unset</a><br/>"
if(ticker.mode.event_delay_mod_major)
out += "<b>Major event time modifier:</b> <a href='?src=\ref[ticker.mode];set=event_modifier_severe'>[ticker.mode.event_delay_mod_major]</a><br/>"
else
out += "<b>Major event time modifier:</b> <a href='?src=\ref[ticker.mode];set=event_modifier_severe'>unset</a><br/>"
out += "<hr>"
if(ticker.mode.antag_tag)
out += "<b>Core antag id:</b> <a href='?src=\ref[ticker.mode];debug_antag=[ticker.mode.antag_tag]'>[ticker.mode.antag_tag]</a>.</br>"
if(ticker.mode.round_autoantag)
out += "<b>Autotraitor <a href='?src=\ref[ticker.mode];toggle=autotraitor'>enabled</a></b> ([ticker.mode.antag_prob]% spawn chance)"
if(ticker.mode.antag_scaling_coeff)
out += " (scaling with <a href='?src=\ref[ticker.mode];set=antag_scaling'>[ticker.mode.antag_scaling_coeff]</a>)"
out += "<br/>"
else
out += "<b>Autotraitor <a href='?src=\ref[ticker.mode];toggle=autotraitor'>disabled</a></b>.<br/>"
out += "<b>All antag ids:</b>"
if(ticker.mode.antag_templates && ticker.mode.antag_templates.len).
var/playercount = ticker.mode.num_players()
for(var/datum/antagonist/antag in ticker.mode.antag_templates)
var/cur_max_antags
if(ticker.mode.antag_tag && antag.id == ticker.mode.antag_tag)
cur_max_antags = antag.max_antags_round
else
cur_max_antags = antag.max_antags
if(ticker.mode.antag_scaling_coeff)
cur_max_antags = Clamp((playercount/ticker.mode.antag_scaling_coeff), 1, cur_max_antags)
out += " <a href='?src=\ref[ticker.mode];debug_antag=[antag.id]'>[antag.id]</a>"
out += " ([antag.get_antag_count()]/[cur_max_antags]) "
out += " <a href='?src=\ref[ticker.mode];remove_antag_type=[antag.id]'>\[-\]</a><br/>"
else
out += " None."
out += " <a href='?src=\ref[ticker.mode];add_antag_type=1'>\[+\]</a><br/>"
usr << browse(out, "window=edit_mode[src]")
feedback_add_details("admin_verb","SGM")
/datum/admins/proc/toggletintedweldhelmets()
set category = "Debug"
set desc="Reduces view range when wearing welding helmets"
set name="Toggle tinted welding helmes"
set name="Toggle tinted welding helmets."
config.welder_vision = !( config.welder_vision )
if (config.welder_vision)
world << "<B>Reduced welder vision has been enabled!</B>"
+1 -1
View File
@@ -16,7 +16,7 @@
/client/proc/admin_memo_write()
var/savefile/F = new(MEMOFILE)
if(F)
var/memo = input(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null) as null|message
var/memo = sanitize(input(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null) as null|message, extra = 0)
switch(memo)
if(null)
return
+8 -24
View File
@@ -15,6 +15,7 @@ var/list/admin_verbs_admin = list(
/client/proc/player_panel_new, /*shows an interface for all players, with links to various panels*/
/client/proc/invisimin, /*allows our mob to go invisible/visible*/
// /datum/admins/proc/show_traitor_panel, /*interface which shows a mob's mind*/ -Removed due to rare practical use. Moved to debug verbs ~Errorage
/datum/admins/proc/show_game_mode, /*Configuration window for the current game mode.*/
/datum/admins/proc/toggleenter, /*toggles whether people can join the current game*/
/datum/admins/proc/toggleguests, /*toggles whether guests can join the current game*/
/datum/admins/proc/announce, /*priority announce something to all clients.*/
@@ -101,10 +102,8 @@ var/list/admin_verbs_fun = list(
/client/proc/drop_bomb,
/client/proc/everyone_random,
/client/proc/cinematic,
/client/proc/one_click_antag,
/datum/admins/proc/toggle_aliens,
/datum/admins/proc/toggle_space_ninja,
/client/proc/send_space_ninja,
/client/proc/cmd_admin_add_freeform_ai_law,
/client/proc/cmd_admin_add_random_ai_law,
/client/proc/make_sound,
@@ -152,6 +151,7 @@ var/list/admin_verbs_debug = list(
/client/proc/cmd_debug_make_powernets,
/client/proc/kill_airgroup,
/client/proc/debug_controller,
/client/proc/debug_antagonist_template,
/client/proc/cmd_debug_mob_lists,
/client/proc/cmd_admin_delete,
/client/proc/cmd_debug_del_all,
@@ -219,7 +219,6 @@ var/list/admin_verbs_hideable = list(
/client/proc/cinematic,
/datum/admins/proc/toggle_aliens,
/datum/admins/proc/toggle_space_ninja,
/client/proc/send_space_ninja,
/client/proc/cmd_admin_add_freeform_ai_law,
/client/proc/cmd_admin_add_random_ai_law,
/client/proc/cmd_admin_create_centcom_report,
@@ -566,22 +565,6 @@ var/list/admin_verbs_mentor = list(
message_admins("\blue [ckey] creating an admin explosion at [epicenter.loc].")
feedback_add_details("admin_verb","DB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/give_spell(mob/T as mob in mob_list) // -- Urist
set category = "Fun"
set name = "Give Spell"
set desc = "Gives a spell to a mob."
var/list/spell_names = list()
for(var/v in spells)
// "/obj/effect/proc_holder/spell/" 30 symbols ~Intercross21
spell_names.Add(copytext("[v]", 31, 0))
var/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spell_names
if(!S) return
var/path = text2path("/obj/effect/proc_holder/spell/[S]")
T.spell_list += new path
feedback_add_details("admin_verb","GS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_admin("[key_name(usr)] gave [key_name(T)] the spell [S].")
message_admins("\blue [key_name_admin(usr)] gave [key_name(T)] the spell [S].", 1)
/client/proc/give_disease(mob/T as mob in mob_list) // -- Giacom
set category = "Fun"
set name = "Give Disease (old)"
@@ -619,9 +602,10 @@ var/list/admin_verbs_mentor = list(
var/mob/living/carbon/human/H = T
if (H.species)
D.affected_species = list(H.species.name)
if(istype(T,/mob/living/carbon/monkey))
var/mob/living/carbon/monkey/M = T
D.affected_species = list(M.greaterform)
if(H.species.primitive_form)
D.affected_species |= H.species.primitive_form
if(H.species.greater_form)
D.affected_species |= H.species.greater_form
infect_virus2(T,D,1)
feedback_add_details("admin_verb","GD2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -633,7 +617,7 @@ var/list/admin_verbs_mentor = list(
set name = "Make Sound"
set desc = "Display a message to everyone who can hear the target"
if(O)
var/message = input("What do you want the message to be?", "Make Sound") as text|null
var/message = sanitize(input("What do you want the message to be?", "Make Sound") as text|null)
if(!message)
return
for (var/mob/V in hearers(O))
@@ -725,7 +709,7 @@ var/list/admin_verbs_mentor = list(
return
if(holder)
var/new_name = trim_strip_input(src, "Enter new name. Leave blank or as is to cancel.", "Enter new silicon name", S.real_name)
var/new_name = sanitizeSafe(input(src, "Enter new name. Leave blank or as is to cancel.", "Enter new silicon name", S.real_name))
if(new_name && new_name != S.real_name)
admin_log_and_message_admins("has renamed the silicon '[S.real_name]' to '[new_name]'")
S.SetName(new_name)
+3 -75
View File
@@ -231,7 +231,7 @@
M_job = M.job
else if(isslime(M))
M_job = "slime"
else if(ismonkey(M))
else if(issmall(M))
M_job = "Monkey"
else if(isalien(M))
M_job = "Alien"
@@ -342,7 +342,7 @@
dat += "<td>New Player</td>"
else if(isobserver(M))
dat += "<td>Ghost</td>"
else if(ismonkey(M))
else if(issmall(M))
dat += "<td>Monkey</td>"
else if(isalien(M))
dat += "<td>Alien</td>"
@@ -410,80 +410,8 @@
dat += "Launching now..."
dat += "<a href='?src=\ref[src];delay_round_end=1'>[ticker.delay_end ? "End Round Normally" : "Delay Round End"]</a><br>"
if(ticker.mode.syndicates.len)
dat += "<br><table cellspacing=5><tr><td><B>Mercenaries</B></td><td></td></tr>"
for(var/datum/mind/N in ticker.mode.syndicates)
var/mob/M = N.current
if(M)
dat += "<tr><td><a href='?src=\ref[src];adminplayeropts=\ref[M]'>[M.real_name]</a>[M.client ? "" : " <i>(logged out)</i>"][M.stat == 2 ? " <b><font color=red>(DEAD)</font></b>" : ""]</td>"
dat += "<td><A href='?src=\ref[usr];priv_msg=\ref[M]'>PM</A></td></tr>"
else
dat += "<tr><td><i>Mercenary not found!</i></td></tr>"
dat += "</table><br><table><tr><td><B>Nuclear Disk(s)</B></td></tr>"
for(var/obj/item/weapon/disk/nuclear/N in world)
dat += "<tr><td>[N.name], "
var/atom/disk_loc = N.loc
while(!istype(disk_loc, /turf))
if(istype(disk_loc, /mob))
var/mob/M = disk_loc
dat += "carried by <a href='?src=\ref[src];adminplayeropts=\ref[M]'>[M.real_name]</a> "
if(istype(disk_loc, /obj))
var/obj/O = disk_loc
dat += "in \a [O.name] "
disk_loc = disk_loc.loc
dat += "in [disk_loc.loc] at ([disk_loc.x], [disk_loc.y], [disk_loc.z])</td></tr>"
dat += "</table>"
if(ticker.mode.head_revolutionaries.len || ticker.mode.revolutionaries.len)
dat += "<br><table cellspacing=5><tr><td><B>Revolutionaries</B></td><td></td></tr>"
for(var/datum/mind/N in ticker.mode.head_revolutionaries)
var/mob/M = N.current
if(!M)
dat += "<tr><td><i>Head Revolutionary not found!</i></td></tr>"
else
dat += "<tr><td><a href='?src=\ref[src];adminplayeropts=\ref[M]'>[M.real_name]</a> <b>(Leader)</b>[M.client ? "" : " <i>(logged out)</i>"][M.stat == 2 ? " <b><font color=red>(DEAD)</font></b>" : ""]</td>"
dat += "<td><A href='?src=\ref[usr];priv_msg=\ref[M]'>PM</A></td></tr>"
for(var/datum/mind/N in ticker.mode.revolutionaries)
var/mob/M = N.current
if(M)
dat += "<tr><td><a href='?src=\ref[src];adminplayeropts=\ref[M]'>[M.real_name]</a>[M.client ? "" : " <i>(logged out)</i>"][M.stat == 2 ? " <b><font color=red>(DEAD)</font></b>" : ""]</td>"
dat += "<td><A href='?src=\ref[usr];priv_msg=\ref[M]'>PM</A></td></tr>"
dat += "</table><table cellspacing=5><tr><td><B>Target(s)</B></td><td></td><td><B>Location</B></td></tr>"
for(var/datum/mind/N in ticker.mode.get_living_heads())
var/mob/M = N.current
if(M)
dat += "<tr><td><a href='?src=\ref[src];adminplayeropts=\ref[M]'>[M.real_name]</a>[M.client ? "" : " <i>(logged out)</i>"][M.stat == 2 ? " <b><font color=red>(DEAD)</font></b>" : ""]</td>"
dat += "<td><A href='?src=\ref[usr];priv_msg=\ref[M]'>PM</A></td>"
var/turf/mob_loc = get_turf(M)
dat += "<td>[mob_loc.loc]</td></tr>"
else
dat += "<tr><td><i>Head not found!</i></td></tr>"
dat += "</table>"
if(ticker.mode.changelings.len)
dat += check_role_table("Changelings", ticker.mode.changelings, src)
if(ticker.mode.wizards.len)
dat += check_role_table("Wizards", ticker.mode.wizards, src)
if(ticker.mode.raiders.len)
dat += check_role_table("Raiders", ticker.mode.raiders, src)
if(ticker.mode.ninjas.len)
dat += check_role_table("Ninjas", ticker.mode.ninjas, src)
if(ticker.mode.cult.len)
dat += check_role_table("Cultists", ticker.mode.cult, src, 0)
if(ticker.mode.traitors.len)
dat += check_role_table("Traitors", ticker.mode.traitors, src)
if(ticker.mode.borers.len)
dat += check_role_table("Cortical Borers", ticker.mode.borers, src)
var/datum/game_mode/mutiny/mutiny = get_mutiny_mode()
if(mutiny)
dat += mutiny.check_antagonists_ui(src)
//todo
dat += "</body></html>"
usr << browse(dat, "window=roundstatus;size=400x500")
+34 -224
View File
@@ -10,49 +10,8 @@
check_antagonists()
return
if(href_list["makeAntag"])
switch(href_list["makeAntag"])
if("1")
log_admin("[key_name(usr)] has spawned a traitor.")
if(!src.makeTraitors())
usr << "\red Unfortunately there weren't enough candidates available."
if("2")
log_admin("[key_name(usr)] has spawned a changeling.")
if(!src.makeChanglings())
usr << "\red Unfortunately there weren't enough candidates available."
if("3")
log_admin("[key_name(usr)] has spawned revolutionaries.")
if(!src.makeRevs())
usr << "\red Unfortunately there weren't enough candidates available."
if("4")
log_admin("[key_name(usr)] has spawned a cultists.")
if(!src.makeCult())
usr << "\red Unfortunately there weren't enough candidates available."
if("5")
log_admin("[key_name(usr)] has spawned a malf AI.")
if(!src.makeMalfAImode())
usr << "\red Unfortunately there weren't enough candidates available."
if("6")
log_admin("[key_name(usr)] has spawned a wizard.")
if(!src.makeWizard())
usr << "\red Unfortunately there weren't enough candidates available."
if("7")
log_admin("[key_name(usr)] has spawned a nuke team.")
if(!src.makeNukeTeam())
usr << "\red Unfortunately there weren't enough candidates available."
if("8")
log_admin("[key_name(usr)] has spawned a ninja.")
src.makeSpaceNinja()
if("9")
log_admin("[key_name(usr)] has spawned aliens.")
src.makeAliens()
if("10")
log_admin("[key_name(usr)] has spawned a death squad.")
if("11")
log_admin("[key_name(usr)] has spawned vox raiders.")
if(!src.makeVoxRaiders())
usr << "\red Unfortunately there weren't enough candidates available."
else if(href_list["dbsearchckey"] || href_list["dbsearchadmin"] || href_list["dbsearchip"] || href_list["dbsearchcid"] || href_list["dbsearchbantype"])
if(href_list["dbsearchckey"] || href_list["dbsearchadmin"])
var/adminckey = href_list["dbsearchadmin"]
var/playerckey = href_list["dbsearchckey"]
var/playerip = href_list["dbsearchip"]
@@ -307,7 +266,7 @@
if("nymph") M.change_mob_type( /mob/living/carbon/alien/diona , null, null, delmob )
if("human") M.change_mob_type( /mob/living/carbon/human , null, null, delmob, href_list["species"])
if("slime") M.change_mob_type( /mob/living/carbon/slime , null, null, delmob )
if("monkey") M.change_mob_type( /mob/living/carbon/monkey , null, null, delmob )
if("monkey") M.change_mob_type( /mob/living/carbon/human/monkey , null, null, delmob )
if("robot") M.change_mob_type( /mob/living/silicon/robot , null, null, delmob )
if("cat") M.change_mob_type( /mob/living/simple_animal/cat , null, null, delmob )
if("runtime") M.change_mob_type( /mob/living/simple_animal/cat/fluff/Runtime , null, null, delmob )
@@ -369,12 +328,12 @@
mins = min(525599,mins)
minutes = CMinutes + mins
duration = GetExp(minutes)
reason = input(usr,"Reason?","reason",reason2) as text|null
reason = sanitize(input(usr,"Reason?","reason",reason2) as text|null)
if(!reason) return
if("No")
temp = 0
duration = "Perma"
reason = input(usr,"Reason?","reason",reason2) as text|null
reason = sanitize(input(usr,"Reason?","reason",reason2) as text|null)
if(!reason) return
log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]")
@@ -586,69 +545,15 @@
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
jobs += "<tr bgcolor='ffeeaa'><th colspan='10'><a href='?src=\ref[src];jobban3=Syndicate;jobban4=\ref[M]'>Antagonist Positions</a></th></tr><tr align='center'>"
//Traitor
if(jobban_isbanned(M, "traitor") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=traitor;jobban4=\ref[M]'><font color=red>[replacetext("Traitor", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=traitor;jobban4=\ref[M]'>[replacetext("Traitor", " ", "&nbsp")]</a></td>"
//Changeling
if(jobban_isbanned(M, "changeling") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=changeling;jobban4=\ref[M]'><font color=red>[replacetext("Changeling", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=changeling;jobban4=\ref[M]'>[replacetext("Changeling", " ", "&nbsp")]</a></td>"
//Nuke Operative
if(jobban_isbanned(M, "operative") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=operative;jobban4=\ref[M]'><font color=red>[replacetext("Mercenary", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=operative;jobban4=\ref[M]'>[replacetext("Mercenary", " ", "&nbsp")]</a></td>"
//Revolutionary
if(jobban_isbanned(M, "revolutionary") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=revolutionary;jobban4=\ref[M]'><font color=red>[replacetext("Revolutionary", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=revolutionary;jobban4=\ref[M]'>[replacetext("Revolutionary", " ", "&nbsp")]</a></td>"
jobs += "</tr><tr align='center'>" //Breaking it up so it fits nicer on the screen every 5 entries
//Cultist
if(jobban_isbanned(M, "cultist") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=cultist;jobban4=\ref[M]'><font color=red>[replacetext("Cultist", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=cultist;jobban4=\ref[M]'>[replacetext("Cultist", " ", "&nbsp")]</a></td>"
//Wizard
if(jobban_isbanned(M, "wizard") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=wizard;jobban4=\ref[M]'><font color=red>[replacetext("Wizard", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=wizard;jobban4=\ref[M]'>[replacetext("Wizard", " ", "&nbsp")]</a></td>"
//ERT
if(jobban_isbanned(M, "Emergency Response Team") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=Emergency Response Team;jobban4=\ref[M]'><font color=red>Emergency Response Team</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=Emergency Response Team;jobban4=\ref[M]'>Emergency Response Team</a></td>"
/* //Malfunctioning AI //Removed Malf-bans because they're a pain to impliment
if(jobban_isbanned(M, "malf AI") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=malf AI;jobban4=\ref[M]'><font color=red>[replacetext("Malf AI", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=malf AI;jobban4=\ref[M]'>[replacetext("Malf AI", " ", "&nbsp")]</a></td>"
//Alien
if(jobban_isbanned(M, "alien candidate") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=alien candidate;jobban4=\ref[M]'><font color=red>[replacetext("Alien", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=alien candidate;jobban4=\ref[M]'>[replacetext("Alien", " ", "&nbsp")]</a></td>"
//Infested Monkey
if(jobban_isbanned(M, "infested monkey") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=infested monkey;jobban4=\ref[M]'><font color=red>[replacetext("Infested Monkey", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=infested monkey;jobban4=\ref[M]'>[replacetext("Infested Monkey", " ", "&nbsp")]</a></td>"
*/
// Antagonists.
for(var/antag_type in all_antag_types)
var/datum/antagonist/antag = all_antag_types[antag_type]
if(!antag || !antag.bantype)
continue
if(jobban_isbanned(M, "[antag.bantype]") || isbanned_dept)
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[antag.bantype];jobban4=\ref[M]'><font color=red>[replacetext("[antag.role_text]", " ", "&nbsp")]</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[antag.bantype];jobban4=\ref[M]'>[replacetext("[antag.role_text]", " ", "&nbsp")]</a></td>"
jobs += "</tr></table>"
@@ -660,16 +565,7 @@
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=Dionaea;jobban4=\ref[M]'><font color=red>Dionaea</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=Dionaea;jobban4=\ref[M]'>Dionaea</a></td>"
if(jobban_isbanned(M, "Borer"))
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=Borer;jobban4=\ref[M]'><font color=red>Borer</font></a></td>"
else
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=Borer;jobban4=\ref[M]'>Borer</a></td>"
jobs += "</tr></table>"
body = "<body>[jobs]</body>"
dat = "<tt>[header][body]</tt>"
usr << browse(dat, "window=jobban2;size=800x490")
@@ -759,7 +655,7 @@
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
if(!mins)
return
var/reason = input(usr,"Reason?","Please State Reason","") as text|null
var/reason = sanitize(input(usr,"Reason?","Please State Reason","") as text|null)
if(!reason)
return
@@ -784,7 +680,7 @@
return 1
if("No")
if(!check_rights(R_BAN)) return
var/reason = input(usr,"Reason?","Please State Reason","") as text|null
var/reason = sanitize(input(usr,"Reason?","Please State Reason","") as text|null)
if(reason)
var/msg
for(var/job in notbannedlist)
@@ -841,7 +737,7 @@
if (ismob(M))
if(!check_if_greater_rights_than(M.client))
return
var/reason = input("Please enter reason")
var/reason = sanitize(input("Please enter reason"))
if(!reason)
M << "\red You have been kicked from the server"
else
@@ -898,7 +794,7 @@
if(!mins)
return
if(mins >= 525600) mins = 525599
var/reason = input(usr,"Reason?","reason","Griefer") as text|null
var/reason = sanitize(input(usr,"Reason?","reason","Griefer") as text|null)
if(!reason)
return
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins)
@@ -919,7 +815,7 @@
//del(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends.
if("No")
if(!check_rights(R_BAN)) return
var/reason = input(usr,"Reason?","reason","Griefer") as text|null
var/reason = sanitize(input(usr,"Reason?","reason","Griefer") as text|null)
if(!reason)
return
switch(alert(usr,"IP ban?",,"Yes","No","Cancel"))
@@ -1287,44 +1183,6 @@
show_player_panel(H)
//H.regenerate_icons()
/***************** BEFORE**************
if (href_list["l_players"])
var/dat = "<B>Name/Real Name/Key/IP:</B><HR>"
for(var/mob/M in world)
var/foo = ""
if (ismob(M) && M.client)
if(!M.client.authenticated && !M.client.authenticating)
foo += text("\[ <A HREF='?src=\ref[];adminauth=\ref[]'>Authorize</A> | ", src, M)
else
foo += text("\[ <B>Authorized</B> | ")
if(M.start)
if(!istype(M, /mob/living/carbon/monkey))
foo += text("<A HREF='?src=\ref[];monkeyone=\ref[]'>Monkeyize</A> | ", src, M)
else
foo += text("<B>Monkeyized</B> | ")
if(istype(M, /mob/living/silicon/ai))
foo += text("<B>Is an AI</B> | ")
else
foo += text("<A HREF='?src=\ref[];makeai=\ref[]'>Make AI</A> | ", src, M)
if(isNotAdminLevel(M.z))
foo += text("<A HREF='?src=\ref[];sendtoprison=\ref[]'>Prison</A> | ", src, M)
foo += text("<A HREF='?src=\ref[];sendtomaze=\ref[]'>Maze</A> | ", src, M)
else
foo += text("<B>On Z = [M.z]</B> | ")
else
foo += text("<B>Hasn't Entered Game</B> | ")
foo += text("<A HREF='?src=\ref[];revive=\ref[]'>Heal/Revive</A> | ", src, M)
foo += text("<A HREF='?src=\ref[];forcespeech=\ref[]'>Say</A> \]", src, M)
dat += text("N: [] R: [] (K: []) (IP: []) []<BR>", M.name, M.real_name, (M.client ? M.client : "No client"), M.lastKnownIP, foo)
usr << browse(dat, "window=players;size=900x480")
*****************AFTER******************/
// Now isn't that much better? IT IS NOW A PROC, i.e. kinda like a big panel like unstable
else if(href_list["adminplayeropts"])
var/mob/M = locate(href_list["adminplayeropts"])
show_player_panel(M)
@@ -1483,7 +1341,7 @@
usr << "The person you are trying to contact is not wearing a headset"
return
var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from Centcomm", "")
var/input = sanitize(input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from Centcomm", ""))
if(!input) return
src.owner << "You sent [input] to [H] via a secure channel."
@@ -1500,7 +1358,7 @@
usr << "The person you are trying to contact is not wearing a headset"
return
var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from a shadowy figure...", "")
var/input = sanitize(input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from a shadowy figure...", ""))
if(!input) return
src.owner << "You sent [input] to [H] via a secure channel."
@@ -1547,6 +1405,7 @@
var/mob/sender = locate(href_list["CentcommFaxReply"])
var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["originfax"])
//todo: sanitize
var/input = input(src.owner, "Please enter a message to reply to [key_name(sender)] via secure connection. NOTE: BBCode does not work, but HTML tags do! Use <br> for line breaks.", "Outgoing message from Centcomm", "") as message|null
if(!input) return
@@ -1751,7 +1610,7 @@
where = "onfloor"
if ( where == "inhand" ) //Can only give when human or monkey
if ( !( ishuman(usr) || ismonkey(usr) ) )
if ( !( ishuman(usr) || issmall(usr) ) )
usr << "Can only spawn in hand when you're a human or a monkey."
where = "onfloor"
else if ( usr.get_active_hand() )
@@ -1900,13 +1759,13 @@
feedback_add_details("admin_secrets_fun_used","Aliens")
log_admin("[key_name(usr)] spawned an alien infestation", 1)
message_admins("\blue [key_name_admin(usr)] attempted an alien infestation", 1)
new /datum/event/alien_infestation
xenomorphs.random_spawn()
if("borers")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","Borers")
log_admin("[key_name(usr)] spawned a cortical borer infestation.", 1)
message_admins("\blue [key_name_admin(usr)] spawned a cortical borer infestation.", 1)
new /datum/event/borer_infestation
borers.random_spawn()
if("power")
feedback_inc("admin_secrets_fun_used",1)
@@ -1994,40 +1853,6 @@
//teleport security person
H.loc = pick(prisonsecuritywarp)
prisonwarped += H
if("traitor_all")
if(!ticker)
alert("The game hasn't started yet!")
return
var/objective = sanitize(copytext(input("Enter an objective"),1,MAX_MESSAGE_LEN))
if(!objective)
return
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","TA([objective])")
for(var/mob/living/carbon/human/H in player_list)
if(H.stat == 2 || !H.client || !H.mind) continue
if(is_special_character(H)) continue
//traitorize(H, objective, 0)
ticker.mode.traitors += H.mind
H.mind.special_role = "traitor"
var/datum/objective/new_objective = new
new_objective.owner = H
new_objective.explanation_text = objective
H.mind.objectives += new_objective
ticker.mode.greet_traitor(H.mind)
//ticker.mode.forge_traitor_objectives(H.mind)
ticker.mode.finalize_traitor(H.mind)
for(var/mob/living/silicon/A in player_list)
ticker.mode.traitors += A.mind
A.mind.special_role = "traitor"
var/datum/objective/new_objective = new
new_objective.owner = A
new_objective.explanation_text = objective
A.mind.objectives += new_objective
ticker.mode.greet_traitor(A.mind)
ticker.mode.finalize_traitor(A.mind)
message_admins("\blue [key_name_admin(usr)] used everyone is a traitor secret. Objective is [objective]", 1)
log_admin("[key_name(usr)] used everyone is a traitor secret. Objective is [objective]")
if("launchshuttle")
if(!shuttle_controller) return // Something is very wrong, the shuttle controller has not been created.
@@ -2252,8 +2077,7 @@
if("aliens")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","AL")
if(config.aliens_allowed)
new /datum/event/alien_infestation
if(xenomorphs.random_spawn())
message_admins("[key_name_admin(usr)] has spawned aliens", 1)
if("spiders")
feedback_inc("admin_secrets_fun_used",1)
@@ -2269,12 +2093,6 @@
else
communications_blackout(1)
message_admins("[key_name_admin(usr)] triggered a communications blackout.", 1)
if("spaceninja")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","SN")
if(config.ninjas_allowed)
if(space_ninja_arrival())//If the ninja is actually spawned. They may not be depending on a few factors.
message_admins("[key_name_admin(usr)] has sent in a space ninja", 1)
if("carp")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","C")
@@ -2453,7 +2271,7 @@
if("onlyone")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","OO")
usr.client.only_one()
only_one()
message_admins("[key_name_admin(usr)] has triggered a battle to the death (only one)")
if(usr)
log_admin("[key_name(usr)] used secret [href_list["secretsfun"]]")
@@ -2571,9 +2389,7 @@
src.access_news_network()
else if(href_list["ac_set_channel_name"])
src.admincaster_feed_channel.channel_name = strip_html_simple(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
while (findtext(src.admincaster_feed_channel.channel_name," ") == 1)
src.admincaster_feed_channel.channel_name = copytext(src.admincaster_feed_channel.channel_name,2,lentext(src.admincaster_feed_channel.channel_name)+1)
src.admincaster_feed_channel.channel_name = sanitizeSafe(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
src.access_news_network()
else if(href_list["ac_set_channel_lock"])
@@ -2606,13 +2422,11 @@
var/list/available_channels = list()
for(var/datum/feed_channel/F in news_network.network_channels)
available_channels += F.channel_name
src.admincaster_feed_channel.channel_name = adminscrub(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels )
src.admincaster_feed_channel.channel_name = sanitizeSafe(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels )
src.access_news_network()
else if(href_list["ac_set_new_message"])
src.admincaster_feed_message.body = adminscrub(input(usr, "Write your Feed story", "Network Channel Handler", ""))
while (findtext(src.admincaster_feed_message.body," ") == 1)
src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1)
src.admincaster_feed_message.body = sanitize(input(usr, "Write your Feed story", "Network Channel Handler", ""))
src.access_news_network()
else if(href_list["ac_submit_new_message"])
@@ -2654,15 +2468,11 @@
src.access_news_network()
else if(href_list["ac_set_wanted_name"])
src.admincaster_feed_message.author = adminscrub(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
while (findtext(src.admincaster_feed_message.author," ") == 1)
src.admincaster_feed_message.author = copytext(admincaster_feed_message.author,2,lentext(admincaster_feed_message.author)+1)
src.admincaster_feed_message.author = sanitize(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
src.access_news_network()
else if(href_list["ac_set_wanted_desc"])
src.admincaster_feed_message.body = adminscrub(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
while (findtext(src.admincaster_feed_message.body," ") == 1)
src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1)
src.admincaster_feed_message.body = sanitize(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
src.access_news_network()
else if(href_list["ac_submit_wanted"])
@@ -2767,7 +2577,7 @@
src.access_news_network()
else if(href_list["ac_set_signature"])
src.admincaster_signature = adminscrub(input(usr, "Provide your desired signature", "Network Identity Handler", ""))
src.admincaster_signature = sanitize(input(usr, "Provide your desired signature", "Network Identity Handler", ""))
src.access_news_network()
else if(href_list["populate_inactive_customitems"])
@@ -2805,7 +2615,7 @@
if(href_list["add_player_info"])
var/key = href_list["add_player_info"]
var/add = input("Add Player Info") as null|text
var/add = sanitize(input("Add Player Info") as null|text)
if(!add) return
notes_add(key,add,usr)
+2 -2
View File
@@ -23,7 +23,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
//clean the input msg
if(!msg)
return
msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN))
msg = sanitize(msg)
if(!msg)
return
var/original_msg = msg
@@ -88,7 +88,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
if(ai_found)
ai_cl = " (<A HREF='?_src_=holder;adminchecklaws=\ref[mob]'>CL</A>)"
//Options bar: mob, details ( admin = 2, dev = 3, mentor = 4, character name (0 = just ckey, 1 = ckey and character name), link? (0 no don't make it a link, 1 do so),
//Options bar: mob, details ( admin = 2, dev = 3, mentor = 4, character name (0 = just ckey, 1 = ckey and character name), link? (0 no don't make it a link, 1 do so),
// highlight special roles (0 = everyone has same looking name, 1 = antags / special roles get a golden name)
var/mentor_msg = "\blue <b><font color=red>Request for Help: </font>[get_options_bar(mob, 4, 1, 1, 0)][ai_cl]:</b> [msg]"
+3 -2
View File
@@ -60,8 +60,9 @@
return
//clean the message if it's not sent by a high-rank admin
//todo: sanitize for all???
if(!check_rights(R_SERVER|R_DEBUG,0))
msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN))
msg = sanitize(msg)
if(!msg) return
var/recieve_pm_type = "Player"
@@ -91,7 +92,7 @@
spawn(0) //so we don't hold the caller proc up
var/sender = src
var/sendername = key
var/reply = input(C, msg,"[recieve_pm_type] PM from [sendername]", "") as text|null //show message and await a reply
var/reply = sanitize(input(C, msg,"[recieve_pm_type] PM from [sendername]", "") as text|null) //show message and await a reply
if(C && reply)
if(sender)
C.cmd_admin_pm(sender,reply) //sender is still about, let's reply to them
+2 -2
View File
@@ -4,7 +4,7 @@
set hidden = 1
if(!check_rights(R_ADMIN)) return
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
msg = sanitize(msg)
if(!msg) return
log_admin("[key_name(src)] : [msg]")
@@ -23,7 +23,7 @@
if(!check_rights(R_ADMIN|R_MOD|R_MENTOR)) return
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
msg = sanitize(msg)
log_admin("MOD: [key_name(src)] : [msg]")
if (!msg)
+1 -1
View File
@@ -5,7 +5,7 @@
if(!check_rights(R_ADMIN)) return
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
msg = sanitize(msg)
if(!msg) return
var/display_name = src.key
+3 -3
View File
@@ -7,7 +7,7 @@
src << "Only administrators may use this command."
return
var/input = input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null
var/input = sanitize(input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null, MAX_BOOK_MESSAGE_LEN, extra = 0)
if(!input || input == "")
custom_event_msg = null
log_admin("[usr.key] has cleared the custom event text.")
@@ -21,7 +21,7 @@
world << "<h1 class='alert'>Custom Event</h1>"
world << "<h2 class='alert'>A custom event is starting. OOC Info:</h2>"
world << "<span class='alert'>[html_encode(custom_event_msg)]</span>"
world << "<span class='alert'>[custom_event_msg]</span>"
world << "<br>"
// normal verb for players to view info
@@ -36,5 +36,5 @@
src << "<h1 class='alert'>Custom Event</h1>"
src << "<h2 class='alert'>A custom event is taking place. OOC Info:</h2>"
src << "<span class='alert'>[html_encode(custom_event_msg)]</span>"
src << "<span class='alert'>[custom_event_msg]</span>"
src << "<br>"
+1 -1
View File
@@ -29,7 +29,7 @@
if (src.holder.rights & R_ADMIN)
stafftype = "ADMIN"
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
msg = sanitize(msg)
log_admin("[key_name(src)] : [msg]")
if (!msg)
+3 -3
View File
@@ -205,7 +205,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return 0
var/obj/item/device/paicard/card = new(T)
var/mob/living/silicon/pai/pai = new(card)
pai.name = input(choice, "Enter your pAI name:", "pAI Name", "Personal AI") as text
pai.name = sanitizeSafe(input(choice, "Enter your pAI name:", "pAI Name", "Personal AI") as text)
pai.real_name = pai.name
pai.key = choice.key
card.setPersonality(pai)
@@ -729,10 +729,10 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(W, slot_wear_id)
if("death commando")//Was looking to add this for a while.
M.equip_death_commando()
deathsquad.equip(M)
if("syndicate commando")
M.equip_syndicate_commando()
commandos.equip(M)
if("nanotrasen representative")
M.equip_if_possible(new /obj/item/clothing/under/rank/centcom(M), slot_w_uniform)
+1 -1
View File
@@ -168,7 +168,7 @@
return .(O.vars[variable])
if("text")
var/new_value = input("Enter new text:","Text",O.vars[variable]) as text|null
var/new_value = input("Enter new text:","Text",O.vars[variable]) as text|null//todo: sanitize ???
if(new_value == null) return
O.vars[variable] = new_value
+4 -4
View File
@@ -44,7 +44,7 @@ var/list/forbidden_varedit_object_types = list(
switch(class)
if("text")
var_value = input("Enter new text:","Text") as null|text
var_value = input("Enter new text:","Text") as null|text//todo: sanitize ???
if("num")
var_value = input("Enter new number:","Num") as null|num
@@ -93,7 +93,7 @@ var/list/forbidden_varedit_object_types = list(
switch(class)
if("text")
var_value = input("Enter new text:","Text") as text
var_value = input("Enter new text:","Text") as text//todo: sanitize ???
if("num")
var_value = input("Enter new number:","Num") as num
@@ -243,7 +243,7 @@ var/list/forbidden_varedit_object_types = list(
return
if("text")
L[L.Find(variable)] = input("Enter new text:","Text") as text
L[L.Find(variable)] = input("Enter new text:","Text") as text//todo: sanitize ???
if("num")
L[L.Find(variable)] = input("Enter new number:","Num") as num
@@ -450,7 +450,7 @@ var/list/forbidden_varedit_object_types = list(
return .(O.vars[variable])
if("text")
var/var_new = input("Enter new text:","Text",O.vars[variable]) as null|text
var/var_new = input("Enter new text:","Text",O.vars[variable]) as null|text//todo: sanitize ???
if(var_new==null) return
O.vars[variable] = var_new
-528
View File
@@ -1,528 +0,0 @@
client/proc/one_click_antag()
set name = "Create Antagonist"
set desc = "Auto-create an antagonist of your choice"
set category = "Admin"
if(holder)
holder.one_click_antag()
return
/datum/admins/proc/one_click_antag()
var/dat = {"<B>One-click Antagonist</B><br>
<a href='?src=\ref[src];makeAntag=1'>Make Traitors</a><br>
<a href='?src=\ref[src];makeAntag=2'>Make Changlings</a><br>
<a href='?src=\ref[src];makeAntag=3'>Make Revs</a><br>
<a href='?src=\ref[src];makeAntag=4'>Make Cult</a><br>
<a href='?src=\ref[src];makeAntag=5'>Make Malf AI</a><br>
<a href='?src=\ref[src];makeAntag=6'>Make Wizard (Requires Ghosts)</a><br>
<a href='?src=\ref[src];makeAntag=11'>Make Vox Raiders (Requires Ghosts)</a><br>
"}
/* These dont work just yet
Ninja, aliens and deathsquad I have not looked into yet
Nuke team is getting a null mob returned from makebody() (runtime error: null.mind. Line 272)
<a href='?src=\ref[src];makeAntag=7'>Make Nuke Team (Requires Ghosts)</a><br>
<a href='?src=\ref[src];makeAntag=8'>Make Space Ninja (Requires Ghosts)</a><br>
<a href='?src=\ref[src];makeAntag=9'>Make Aliens (Requires Ghosts)</a><br>
<a href='?src=\ref[src];makeAntag=10'>Make Deathsquad (Syndicate) (Requires Ghosts)</a><br>
"}
*/
usr << browse(dat, "window=oneclickantag;size=400x400")
return
/datum/admins/proc/makeMalfAImode()
var/list/mob/living/silicon/AIs = list()
var/mob/living/silicon/malfAI = null
var/datum/mind/themind = null
for(var/mob/living/silicon/ai/ai in player_list)
if(ai.client)
AIs += ai
if(AIs.len)
malfAI = pick(AIs)
if(malfAI)
themind = malfAI.mind
themind.make_AI_Malf()
return 1
return 0
/datum/admins/proc/makeTraitors()
var/datum/game_mode/traitor/temp = new
if(config.protect_roles_from_antagonist)
temp.restricted_jobs += temp.protected_jobs
var/list/mob/living/carbon/human/candidates = list()
var/mob/living/carbon/human/H = null
for(var/mob/living/carbon/human/applicant in player_list)
if(applicant.client.prefs.be_special & BE_TRAITOR)
if(!applicant.stat)
if(applicant.mind)
if (!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "traitor") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.job in temp.restricted_jobs))
candidates += applicant
if(candidates.len)
var/numTraitors = min(candidates.len, 3)
for(var/i = 0, i<numTraitors, i++)
H = pick(candidates)
H.mind.make_Traitor()
candidates.Remove(H)
return 1
return 0
/datum/admins/proc/makeChanglings()
var/datum/game_mode/changeling/temp = new
if(config.protect_roles_from_antagonist)
temp.restricted_jobs += temp.protected_jobs
var/list/mob/living/carbon/human/candidates = list()
var/mob/living/carbon/human/H = null
for(var/mob/living/carbon/human/applicant in player_list)
if(applicant.client.prefs.be_special & BE_CHANGELING)
if(!applicant.stat)
if(applicant.mind)
if (!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "changeling") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.job in temp.restricted_jobs))
candidates += applicant
if(candidates.len)
var/numChanglings = min(candidates.len, 3)
for(var/i = 0, i<numChanglings, i++)
H = pick(candidates)
H.mind.make_Changling()
candidates.Remove(H)
return 1
return 0
/datum/admins/proc/makeRevs()
var/datum/game_mode/revolution/temp = new
if(config.protect_roles_from_antagonist)
temp.restricted_jobs += temp.protected_jobs
var/list/mob/living/carbon/human/candidates = list()
var/mob/living/carbon/human/H = null
for(var/mob/living/carbon/human/applicant in player_list)
if(applicant.client.prefs.be_special & BE_REV)
if(applicant.stat == CONSCIOUS)
if(applicant.mind)
if(!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "revolutionary") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.job in temp.restricted_jobs))
candidates += applicant
if(candidates.len)
var/numRevs = min(candidates.len, 3)
for(var/i = 0, i<numRevs, i++)
H = pick(candidates)
H.mind.make_Rev()
candidates.Remove(H)
return 1
return 0
/datum/admins/proc/makeWizard()
var/list/mob/dead/observer/candidates = list()
var/mob/dead/observer/theghost = null
var/time_passed = world.time
for(var/mob/dead/observer/G in player_list)
if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate"))
spawn(0)
switch(alert(G, "Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","Yes","No"))
if("Yes")
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
return
candidates += G
if("No")
return
else
return
sleep(300)
if(candidates.len)
shuffle(candidates)
for(var/mob/i in candidates)
if(!i || !i.client) continue //Dont bother removing them from the list since we only grab one wizard
theghost = i
break
if(theghost)
var/mob/living/carbon/human/new_character=makeBody(theghost)
new_character.mind.make_Wizard()
return 1
return 0
/datum/admins/proc/makeCult()
var/datum/game_mode/cult/temp = new
if(config.protect_roles_from_antagonist)
temp.restricted_jobs += temp.protected_jobs
var/list/mob/living/carbon/human/candidates = list()
var/mob/living/carbon/human/H = null
for(var/mob/living/carbon/human/applicant in player_list)
if(applicant.client.prefs.be_special & BE_CULTIST)
if(applicant.stat == CONSCIOUS)
if(applicant.mind)
if(!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "cultist") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.job in temp.restricted_jobs))
candidates += applicant
if(candidates.len)
var/numCultists = min(candidates.len, 4)
for(var/i = 0, i<numCultists, i++)
H = pick(candidates)
H.mind.make_Cultist()
candidates.Remove(H)
temp.grant_runeword(H)
return 1
return 0
/datum/admins/proc/makeNukeTeam()
var/list/mob/dead/observer/candidates = list()
var/mob/dead/observer/theghost = null
var/time_passed = world.time
for(var/mob/dead/observer/G in player_list)
if(!jobban_isbanned(G, "operative") && !jobban_isbanned(G, "Syndicate"))
spawn(0)
switch(alert(G,"Do you wish to be considered for a nuke team being sent in?","Please answer in 30 seconds!","Yes","No"))
if("Yes")
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
return
candidates += G
if("No")
return
else
return
sleep(300)
if(candidates.len)
var/numagents = 5
var/agentcount = 0
for(var/i = 0, i<numagents,i++)
shuffle(candidates) //More shuffles means more randoms
for(var/mob/j in candidates)
if(!j || !j.client)
candidates.Remove(j)
continue
theghost = candidates
candidates.Remove(theghost)
var/mob/living/carbon/human/new_character=makeBody(theghost)
new_character.mind.make_Nuke()
agentcount++
if(agentcount < 1)
return 0
var/obj/effect/landmark/nuke_spawn = locate("landmark*Nuclear-Bomb")
var/obj/effect/landmark/closet_spawn = locate("landmark*Nuclear-Closet")
var/nuke_code = "[rand(10000, 99999)]"
if(nuke_spawn)
var/obj/item/weapon/paper/P = new
P.info = "Sadly, your employers could not get you a nuclear bomb. They have, however, acquired the arming code for the station's onboard nuke. The nuclear authorization code is: <b>[nuke_code]</b>"
P.name = "nuclear bomb code and instructions"
P.loc = nuke_spawn.loc
if(closet_spawn)
new /obj/structure/closet/syndicate/nuclear(closet_spawn.loc)
for (var/obj/effect/landmark/A in /area/syndicate_station/start)//Because that's the only place it can BE -Sieve
if (A.name == "Syndicate-Gear-Closet")
new /obj/structure/closet/syndicate/personal(A.loc)
del(A)
continue
if (A.name == "Syndicate-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(A.loc)
del(A)
continue
for(var/datum/mind/synd_mind in ticker.mode.syndicates)
if(synd_mind.current)
if(synd_mind.current.client)
for(var/image/I in synd_mind.current.client.images)
if(I.icon_state == "synd")
del(I)
for(var/datum/mind/synd_mind in ticker.mode.syndicates)
if(synd_mind.current)
if(synd_mind.current.client)
for(var/datum/mind/synd_mind_1 in ticker.mode.syndicates)
if(synd_mind_1.current)
var/I = image('icons/mob/mob.dmi', loc = synd_mind_1.current, icon_state = "synd")
synd_mind.current.client.images += I
for (var/obj/machinery/nuclearbomb/bomb in world)
bomb.r_code = nuke_code // All the nukes are set to this code.
return 1
/datum/admins/proc/makeAliens()
alien_infestation(3)
return 1
/datum/admins/proc/makeSpaceNinja()
space_ninja_arrival()
return 1
/datum/admins/proc/makeDeathsquad()
var/list/mob/dead/observer/candidates = list()
var/mob/dead/observer/theghost = null
var/time_passed = world.time
var/input = "Purify the station."
if(prob(10))
input = "Save Runtime and any other cute things on the station."
var/syndicate_leader_selected = 0 //when the leader is chosen. The last person spawned.
//Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos.
for(var/mob/dead/observer/G in player_list)
spawn(0)
switch(alert(G,"Do you wish to be considered for an elite mercenary strike team being sent in?","Please answer in 30 seconds!","Yes","No"))
if("Yes")
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
return
candidates += G
if("No")
return
else
return
sleep(300)
for(var/mob/dead/observer/G in candidates)
if(!G.key)
candidates.Remove(G)
if(candidates.len)
var/numagents = 6
//Spawns commandos and equips them.
for (var/obj/effect/landmark/L in /area/syndicate_mothership/elite_squad)
if(numagents<=0)
break
if (L.name == "Syndicate-Commando")
syndicate_leader_selected = numagents == 1?1:0
var/mob/living/carbon/human/new_syndicate_commando = create_syndicate_death_commando(L, syndicate_leader_selected)
while((!theghost || !theghost.client) && candidates.len)
theghost = pick(candidates)
candidates.Remove(theghost)
if(!theghost)
del(new_syndicate_commando)
break
new_syndicate_commando.key = theghost.key
new_syndicate_commando.internal = new_syndicate_commando.s_store
new_syndicate_commando.internals.icon_state = "internal1"
//So they don't forget their code or mission.
new_syndicate_commando << "\blue You are an Elite Mercenary. [!syndicate_leader_selected?"commando":"<B>LEADER</B>"] in the service of criminal elements hostile to NanoTrasen. \nYour current mission is: \red<B> [input]</B>"
numagents--
if(numagents >= 6)
return 0
for (var/obj/effect/landmark/L in /area/shuttle/syndicate_elite)
if (L.name == "Syndicate-Commando-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(L.loc)
return 1
/datum/admins/proc/makeBody(var/mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character
if(!G_found || !G_found.key) return
//First we spawn a dude.
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
new_character.gender = pick(MALE,FEMALE)
var/datum/preferences/A = new()
A.randomize_appearance_for(new_character)
if(new_character.gender == MALE)
new_character.real_name = "[pick(first_names_male)] [pick(last_names)]"
else
new_character.real_name = "[pick(first_names_female)] [pick(last_names)]"
new_character.name = new_character.real_name
new_character.age = rand(17,45)
new_character.dna.ready_dna(new_character)
new_character.key = G_found.key
return new_character
/datum/admins/proc/create_syndicate_death_commando(obj/spawn_location, syndicate_leader_selected = 0)
var/mob/living/carbon/human/new_syndicate_commando = new(spawn_location.loc)
var/syndicate_commando_leader_rank = pick("Lieutenant", "Captain", "Major")
var/syndicate_commando_rank = pick("Corporal", "Sergeant", "Staff Sergeant", "Sergeant 1st Class", "Master Sergeant", "Sergeant Major")
var/syndicate_commando_name = pick(last_names)
new_syndicate_commando.gender = pick(MALE, FEMALE)
var/datum/preferences/A = new()//Randomize appearance for the commando.
A.randomize_appearance_for(new_syndicate_commando)
new_syndicate_commando.real_name = "[!syndicate_leader_selected ? syndicate_commando_rank : syndicate_commando_leader_rank] [syndicate_commando_name]"
new_syndicate_commando.name = new_syndicate_commando.real_name
new_syndicate_commando.age = !syndicate_leader_selected ? rand(23,35) : rand(35,45)
new_syndicate_commando.dna.ready_dna(new_syndicate_commando)//Creates DNA.
//Creates mind stuff.
new_syndicate_commando.mind_initialize()
new_syndicate_commando.mind.assigned_role = "MODE"
new_syndicate_commando.mind.special_role = "Mercenary"
//Adds them to current traitor list. Which is really the extra antagonist list.
ticker.mode.traitors += new_syndicate_commando.mind
new_syndicate_commando.equip_syndicate_commando(syndicate_leader_selected)
return new_syndicate_commando
/datum/admins/proc/makeVoxRaiders()
var/list/mob/dead/observer/candidates = list()
var/mob/dead/observer/theghost = null
var/time_passed = world.time
var/input = "Disregard shinies, acquire hardware."
var/leader_chosen = 0 //when the leader is chosen. The last person spawned.
//Generates a list of candidates from active ghosts.
for(var/mob/dead/observer/G in player_list)
spawn(0)
switch(alert(G,"Do you wish to be considered for a vox raiding party arriving on the station?","Please answer in 30 seconds!","Yes","No"))
if("Yes")
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
return
candidates += G
if("No")
return
else
return
sleep(300) //Debug.
for(var/mob/dead/observer/G in candidates)
if(!G.key)
candidates.Remove(G)
if(candidates.len)
var/max_raiders = 1
var/raiders = max_raiders
//Spawns vox raiders and equips them.
for (var/obj/effect/landmark/L in world)
if(L.name == "voxstart")
if(raiders<=0)
break
var/mob/living/carbon/human/new_vox = create_vox_raider(L, leader_chosen)
while((!theghost || !theghost.client) && candidates.len)
theghost = pick(candidates)
candidates.Remove(theghost)
if(!theghost)
del(new_vox)
break
new_vox.key = theghost.key
new_vox << "\blue You are a Vox Primalis, fresh out of the Shoal. Your ship has arrived at a human-meat system hosting the NSV Exodus... or was it the Luna? NSS? Utopia? Nobody is really sure, who cares about stupid meat-names anyway? Everyone is raring to start pillaging! Your current goal is: \red<B> [input]</B>"
new_vox << "\red Don't forget to turn on your nitrogen internals!"
raiders--
if(raiders > max_raiders)
return 0
else
return 0
return 1
/datum/admins/proc/create_vox_raider(obj/spawn_location, leader_chosen = 0)
var/mob/living/carbon/human/new_vox = new(spawn_location.loc, "Vox")
new_vox.gender = pick(MALE, FEMALE)
new_vox.h_style = "Short Vox Quills"
new_vox.regenerate_icons()
var/sounds = rand(2,10)
var/i = 0
var/newname = ""
while(i<=sounds)
i++
newname += pick(list("ti","hi","ki","ya","ta","ha","ka","ya","chi","cha","kah"))
new_vox.real_name = capitalize(newname)
new_vox.name = new_vox.real_name
new_vox.age = rand(12,20)
new_vox.dna.ready_dna(new_vox) // Creates DNA.
new_vox.mind_initialize()
new_vox.mind.assigned_role = "MODE"
new_vox.mind.special_role = "Vox Raider"
new_vox.mutations |= NOCLONE //Stops the station crew from messing around with their DNA.
if(ticker.mode && ( istype( ticker.mode,/datum/game_mode/heist ) ) )
var/datum/game_mode/heist/M = ticker.mode
if(new_vox.internal_organs_by_name["stack"])
cortical_stacks |= new_vox.internal_organs_by_name["stack"]
M.raiders[new_vox.mind] = new_vox.internal_organs_by_name["stack"]
ticker.mode.traitors += new_vox.mind
new_vox.equip_vox_raider()
return new_vox
-47
View File
@@ -1,47 +0,0 @@
/client/proc/only_one()
if(!ticker)
alert("The game hasn't started yet!")
return
for(var/mob/living/carbon/human/H in player_list)
if(H.stat == 2 || !(H.client)) continue
if(is_special_character(H)) continue
ticker.mode.traitors += H.mind
H.mind.special_role = "traitor"
var/datum/objective/steal/steal_objective = new
steal_objective.owner = H.mind
steal_objective.set_target("nuclear authentication disk")
H.mind.objectives += steal_objective
var/datum/objective/hijack/hijack_objective = new
hijack_objective.owner = H.mind
H.mind.objectives += hijack_objective
H << "<B>You are the traitor.</B>"
show_objectives(H.mind)
for (var/obj/item/I in H)
if (istype(I, /obj/item/weapon/implant))
continue
del(I)
H.equip_to_slot_or_del(new /obj/item/clothing/under/kilt(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(H), slot_l_ear)
H.equip_to_slot_or_del(new /obj/item/clothing/head/beret(H), slot_head)
H.equip_to_slot_or_del(new /obj/item/weapon/claymore(H), slot_l_hand)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/weapon/pinpointer(H.loc), slot_l_store)
var/obj/item/weapon/card/id/W = new(H)
W.name = "[H.real_name]'s ID Card"
W.icon_state = "centcom"
W.access = get_all_accesses()
W.access += get_all_centcom_access()
W.assignment = "Highlander"
W.registered_name = H.real_name
H.equip_to_slot_or_del(W, slot_wear_id)
message_admins("\blue [key_name_admin(usr)] used THERE CAN BE ONLY ONE!", 1)
log_admin("[key_name(usr)] used there can be only one.")
+3 -3
View File
@@ -6,7 +6,7 @@
usr << "\red Speech is currently admin-disabled."
return
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
msg = sanitize(msg)
if(!msg) return
if(usr.client)
@@ -29,14 +29,14 @@
//log_admin("HELP: [key_name(src)]: [msg]")
/proc/Centcomm_announce(var/text , var/mob/Sender , var/iamessage)
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
var/msg = sanitize(text)
msg = "\blue <b><font color=orange>CENTCOMM[iamessage ? " IA" : ""]:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;CentcommReply=\ref[Sender]'>RPLY</A>):</b> [msg]"
for(var/client/C in admins)
if(R_ADMIN & C.holder.rights)
C << msg
/proc/Syndicate_announce(var/text , var/mob/Sender)
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
var/msg = sanitize(text)
msg = "\blue <b><font color=crimson>ILLEGAL:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;SyndicateReply=\ref[Sender]'>RPLY</A>):</b> [msg]"
for(var/client/C in admins)
if(R_ADMIN & C.holder.rights)
+12 -63
View File
@@ -52,7 +52,7 @@
src << "Only administrators may use this command."
return
var/msg = input("Message:", text("Subtle PM to [M.key]")) as text
var/msg = sanitize(input("Message:", text("Subtle PM to [M.key]")) as text)
if (!msg)
return
@@ -109,7 +109,7 @@
src << "Only administrators may use this command."
return
var/msg = input("Message:", text("Enter the text you wish to appear to everyone:")) as text
var/msg = sanitize(input("Message:", text("Enter the text you wish to appear to everyone:")) as text)
if (!msg)
return
@@ -132,7 +132,7 @@
if(!M)
return
var/msg = input("Message:", text("Enter the text you wish to appear to your target:")) as text
var/msg = sanitize(input("Message:", text("Enter the text you wish to appear to your target:")) as text)
if( !msg )
return
@@ -368,19 +368,6 @@ Traitors and the like can also be revived with the previous role mostly intact.
usr << "<font color='red'>There is no active key like that in the game or the person is not currently a ghost.</font>"
return
if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something
//check if they were a monkey
if(findtext(G_found.real_name,"monkey"))
if(alert("This character appears to have been a monkey. Would you like to respawn them as such?",,"Yes","No")=="Yes")
var/mob/living/carbon/monkey/new_monkey = new(pick(latejoin))
G_found.mind.transfer_to(new_monkey) //be careful when doing stuff like this! I've already checked the mind isn't in use
new_monkey.key = G_found.key
new_monkey << "You have been fully respawned. Enjoy the game."
message_admins("\blue [key_name_admin(usr)] has respawned [new_monkey.key] as a filthy xeno.", 1)
return //all done. The ghost is auto-deleted
//Ok, it's not a monkey. So, spawn a human.
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
var/datum/data/record/record_found //Referenced to later to either randomize or not randomize the character.
@@ -445,50 +432,12 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/player_key = G_found.key
//Now for special roles and equipment.
switch(new_character.mind.special_role)
if("traitor")
job_master.EquipRank(new_character, new_character.mind.assigned_role, 1)
ticker.mode.equip_traitor(new_character)
if("Wizard")
new_character.loc = pick(wizardstart)
//ticker.mode.learn_basic_spells(new_character)
ticker.mode.equip_wizard(new_character)
if("Mercenary")
var/obj/effect/landmark/synd_spawn = locate("landmark*Syndicate-Spawn")
if(synd_spawn)
new_character.loc = get_turf(synd_spawn)
call(/datum/game_mode/proc/equip_syndicate)(new_character)
if("Ninja")
new_character.equip_space_ninja()
if(ninjastart.len == 0)
new_character << "<B>\red A proper starting location for you could not be found, please report this bug!</B>"
new_character << "<B>\red Attempting to place at a carpspawn.</B>"
for(var/obj/effect/landmark/L in landmarks_list)
if(L.name == "carpspawn")
ninjastart.Add(L)
if(ninjastart.len == 0 && latejoin.len > 0)
new_character << "<B>\red Still no spawneable locations could be found. Defaulting to latejoin.</B>"
new_character.loc = pick(latejoin)
else if (ninjastart.len == 0)
new_character << "<B>\red Still no spawneable locations could be found. Aborting.</B>"
if("Death Commando")//Leaves them at late-join spawn.
new_character.equip_death_commando()
new_character.internal = new_character.s_store
new_character.internals.icon_state = "internal1"
else//They may also be a cyborg or AI.
switch(new_character.mind.assigned_role)
if("Cyborg")//More rigging to make em' work and check if they're traitor.
new_character = new_character.Robotize()
if(new_character.mind.special_role=="traitor")
call(/datum/game_mode/proc/add_law_zero)(new_character)
if("AI")
new_character = new_character.AIize()
if(new_character.mind.special_role=="traitor")
call(/datum/game_mode/proc/add_law_zero)(new_character)
//Add aliens.
else
job_master.EquipRank(new_character, new_character.mind.assigned_role, 1)//Or we simply equip them.
var/datum/antagonist/antag_data = get_antag_data(new_character.mind.special_role)
if(antag_data)
antag_data.add_antagonist(new_character.mind)
antag_data.place_mob(new_character)
else
job_master.EquipRank(new_character, new_character.mind.assigned_role, 1)
//Announces the character on all the systems, based on the record.
if(!issilicon(new_character))//If they are not a cyborg/AI.
@@ -513,7 +462,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!holder)
src << "Only administrators may use this command."
return
var/input = input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") as text|null
var/input = sanitize(input(usr, "Please enter anything you want the AI to do. Anything. Serious.", "What?", "") as text|null)
if(!input)
return
for(var/mob/living/silicon/ai/M in mob_list)
@@ -561,8 +510,8 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!holder)
src << "Only administrators may use this command."
return
var/input = input(usr, "Please enter anything you want. Anything. Serious.", "What?", "") as message|null
var/customname = input(usr, "Pick a title for the report.", "Title") as text|null
var/input = sanitize(input(usr, "Please enter anything you want. Anything. Serious.", "What?", "") as message|null, extra = 0)
var/customname = sanitizeSafe(input(usr, "Pick a title for the report.", "Title") as text|null)
if(!input)
return
if(!customname)
+35 -154
View File
@@ -1,174 +1,55 @@
//STRIKE TEAMS
var/const/commandos_possible = 6 //if more Commandos are needed in the future
var/global/sent_strike_team = 0
/client/proc/strike_team()
set category = "Fun"
set name = "Spawn Strike Team"
set desc = "Spawns a death squad if you want to run an admin event."
if(!src.holder)
src << "Only administrators may use this command."
return
if(!ticker)
usr << "<font color='red'>The game hasn't started yet!</font>"
return
if(world.time < 6000)
usr << "<font color='red'>There are [(6000-world.time)/10] seconds remaining before it may be called.</font>"
return
if(sent_strike_team == 1)
usr << "<font color='red'>CentCom is already sending a team.</font>"
var/datum/antagonist/deathsquad/team
var/choice = input(usr, "Select type of strike team:") as null|anything in list("Death Squad", "Mercenaries")
if(!choice)
return
if(alert("Do you want to send in the CentCom death squad? Once enabled, this is irreversible.",,"Yes","No")!="Yes")
switch(choice)
if("Death Squad")
team = deathsquad
if("Mercenaries")
team = commandos
else
return
if(team.deployed)
usr << "<font color='red'>Someone is already sending a team.</font>"
return
if(alert("Do you want to send in a strike team? Once enabled, this is irreversible.",,"Yes","No")!="Yes")
return
alert("This 'mode' will go on until everyone is dead or the station is destroyed. You may also admin-call the evac shuttle when appropriate. Spawned commandos have internals cameras which are viewable through a monitor inside the Spec. Ops. Office. Assigning the team's detailed task is recommended from there. While you will be able to manually pick the candidates from active ghosts, their assignment in the squad will be random.")
var/input = null
while(!input)
input = sanitize(copytext(input(src, "Please specify which mission the death commando squad shall undertake.", "Specify Mission", ""),1,MAX_MESSAGE_LEN))
if(!input)
choice = null
while(!choice)
choice = sanitize(input(src, "Please specify which mission the strike team shall undertake.", "Specify Mission", ""))
if(!choice)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
if(sent_strike_team)
if(team.deployed)
usr << "Looks like someone beat you to it."
return
sent_strike_team = 1
if (emergency_shuttle.can_recall())
emergency_shuttle.recall()
var/commando_number = commandos_possible //for selecting a leader
var/leader_selected = 0 //when the leader is chosen. The last person spawned.
//Code for spawning a nuke auth code.
var/nuke_code
var/temp_code
for(var/obj/machinery/nuclearbomb/N in world)
temp_code = text2num(N.r_code)
if(temp_code)//if it's actually a number. It won't convert any non-numericals.
nuke_code = N.r_code
break
//Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos.
var/list/candidates = list() //candidates for being a commando out of all the active ghosts in world.
var/list/commandos = list() //actual commando ghosts as picked by the user.
for(var/mob/dead/observer/G in player_list)
if(!G.client.holder && !G.client.is_afk()) //Whoever called/has the proc won't be added to the list.
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
for(var/i=commandos_possible,(i>0&&candidates.len),i--)//Decrease with every commando selected.
var/candidate = input("Pick characters to spawn as the commandos. This will go on until there either no more ghosts to pick from or the slots are full.", "Active Players") as null|anything in candidates //It will auto-pick a person when there is only one candidate.
candidates -= candidate //Subtract from candidates.
commandos += candidate//Add their ghost to commandos.
//Spawns commandos and equips them.
for(var/obj/effect/landmark/L in landmarks_list)
if(commando_number<=0) break
if (L.name == "Commando")
leader_selected = commando_number == 1?1:0
var/mob/living/carbon/human/new_commando = create_death_commando(L, leader_selected)
if(commandos.len)
new_commando.key = pick(commandos)
commandos -= new_commando.key
new_commando.internal = new_commando.s_store
new_commando.internals.icon_state = "internal1"
//So they don't forget their code or mission.
if(nuke_code)
new_commando.mind.store_memory("<B>Nuke Code:</B> \red [nuke_code].")
new_commando.mind.store_memory("<B>Mission:</B> \red [input].")
new_commando << "\blue You are a Special Ops. [!leader_selected?"commando":"<B>LEADER</B>"] in the service of Central Command. Check the table ahead for detailed instructions.\nYour current mission is: \red<B>[input]</B>"
commando_number--
//Spawns the rest of the commando gear.
for (var/obj/effect/landmark/L in landmarks_list)
if (L.name == "Commando_Manual")
//new /obj/item/weapon/gun/energy/pulse_rifle(L.loc)
var/obj/item/weapon/paper/P = new(L.loc)
P.info = "<p><b>Good morning soldier!</b>. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:<br>#1 Work as a team.<br>#2 Accomplish your objective at all costs.<br>#3 Leave no witnesses.<br>You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.<br>If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.</p><p>In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations <b>LEADER</b> is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.</p><p>Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.<br>First and foremost, <b>DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.</b> Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.<br>To make the device functional:<br>#1 Place bomb in designated detonation zone<br> #2 Extend and anchor bomb (attack with hand).<br>#3 Insert Nuclear Auth. Disk into slot.<br>#4 Type numeric code into keypad ([nuke_code]).<br>Note: If you make a mistake press R to reset the device.<br>#5 Press the E button to log onto the device.<br>You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.<br>Note: Toggle off the <b>SAFETY</b>.<br>Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.<br>Note: <b>THE BOMB IS STILL SET AND WILL DETONATE</b><br>Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.</p><p>The nuclear authorization code is: <b>[nuke_code ? nuke_code : "None provided"]</b></p><p><b>Good luck, soldier!</b></p>"
P.name = "Spec. Ops. Manual"
for (var/obj/effect/landmark/L in landmarks_list)
if (L.name == "Commando-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(L.loc)
del(L)
message_admins("\blue [key_name_admin(usr)] has spawned a CentCom strike squad.", 1)
log_admin("[key_name(usr)] used Spawn Death Squad.")
return 1
/client/proc/create_death_commando(obj/spawn_location, leader_selected = 0)
var/mob/living/carbon/human/new_commando = new(spawn_location.loc)
var/commando_leader_rank = pick("Lieutenant", "Captain", "Major")
var/commando_rank = pick("Corporal", "Sergeant", "Staff Sergeant", "Sergeant 1st Class", "Master Sergeant", "Sergeant Major")
var/commando_name = pick(last_names)
new_commando.gender = pick(MALE, FEMALE)
var/datum/preferences/A = new()//Randomize appearance for the commando.
A.randomize_appearance_for(new_commando)
new_commando.real_name = "[!leader_selected ? commando_rank : commando_leader_rank] [commando_name]"
new_commando.age = !leader_selected ? rand(23,35) : rand(35,45)
new_commando.dna.ready_dna(new_commando)//Creates DNA.
//Creates mind stuff.
new_commando.mind_initialize()
new_commando.mind.assigned_role = "MODE"
new_commando.mind.special_role = "Death Commando"
ticker.mode.traitors |= new_commando.mind//Adds them to current traitor list. Which is really the extra antagonist list.
new_commando.equip_death_commando(leader_selected)
return new_commando
/mob/living/carbon/human/proc/equip_death_commando(leader_selected = 0)
var/obj/item/device/radio/R = new /obj/item/device/radio/headset(src)
R.set_frequency(DTH_FREQ)
equip_to_slot_or_del(R, slot_l_ear)
if (leader_selected == 0)
equip_to_slot_or_del(new /obj/item/clothing/under/color/green(src), slot_w_uniform)
else
equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(src), slot_w_uniform)
equip_to_slot_or_del(new /obj/item/clothing/shoes/swat(src), slot_shoes)
equip_to_slot_or_del(new /obj/item/clothing/suit/armor/swat(src), slot_wear_suit)
equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(src), slot_gloves)
equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad(src), slot_head)
equip_to_slot_or_del(new /obj/item/clothing/mask/gas/swat(src), slot_wear_mask)
equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal(src), slot_glasses)
equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(src), slot_back)
equip_to_slot_or_del(new /obj/item/weapon/storage/box(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/ammo_magazine/a357(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/regular(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/storage/box/flashbangs(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_in_backpack)
if (!leader_selected)
equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_in_backpack)
else
equip_to_slot_or_del(new /obj/item/weapon/pinpointer(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/disk/nuclear(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword(src), slot_l_store)
equip_to_slot_or_del(new /obj/item/weapon/grenade/flashbang(src), slot_r_store)
equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store)
equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/revolver/mateba(src), slot_belt)
equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle(src), slot_r_hand)
implant_loyalty(src)
var/obj/item/weapon/card/id/W = new(src)
W.name = "[real_name]'s ID Card"
W.icon_state = "centcom"
W.access = get_all_accesses()//They get full station access.
W.access += list(access_cent_general, access_cent_specops, access_cent_living, access_cent_storage)//Let's add their alloted CentCom access.
W.assignment = "Death Commando"
W.registered_name = real_name
equip_to_slot_or_del(W, slot_wear_id)
return 1
team.attempt_spawn(1)
@@ -1,178 +0,0 @@
//STRIKE TEAMS
var/const/syndicate_commandos_possible = 6 //if more Commandos are needed in the future
var/global/sent_syndicate_strike_team = 0
/client/proc/syndicate_strike_team()
set category = "Fun"
set name = "Spawn Mercenary Strike Team"
set desc = "Spawns a squad of commandos in the Syndicate Mothership if you want to run an admin event."
if(!src.holder)
src << "Only administrators may use this command."
return
if(!ticker)
alert("The game hasn't started yet!")
return
// if(world.time < 6000)
// alert("Not so fast, buddy. Wait a few minutes until the game gets going. There are [(6000-world.time)/10] seconds remaining.")
// return
if(sent_syndicate_strike_team == 1)
alert("Criminal elements are already sending a team, Mr. Dumbass.")
return
if(alert("Do you want to send in the Mercenary Strike Team? Once enabled, this is irreversible.",,"Yes","No")=="No")
return
alert("This 'mode' will go on until everyone is dead or the station is destroyed. You may also admin-call the evac shuttle when appropriate. Spawned mercs have internals cameras which are viewable through a monitor inside the Syndicate Mothership Bridge. Assigning the team's detailed task is recommended from there. While you will be able to manually pick the candidates from active ghosts, their assignment in the squad will be random.")
var/input = null
while(!input)
input = sanitize(copytext(input(src, "Please specify which mission the strike team shall undertake.", "Specify Mission", ""),1,MAX_MESSAGE_LEN))
if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return
if(sent_syndicate_strike_team)
src << "Looks like someone beat you to it."
return
sent_syndicate_strike_team = 1
//if (emergency_shuttle.can_recall())
// emergency_shuttle.recall() //why, exactly? Admins can do this themselves.
var/syndicate_commando_number = syndicate_commandos_possible //for selecting a leader
var/syndicate_leader_selected = 0 //when the leader is chosen. The last person spawned.
//Code for spawning a nuke auth code.
var/nuke_code
var/temp_code
for(var/obj/machinery/nuclearbomb/N in world)
temp_code = text2num(N.r_code)
if(temp_code)//if it's actually a number. It won't convert any non-numericals.
nuke_code = N.r_code
break
//Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos.
var/list/candidates = list() //candidates for being a commando out of all the active ghosts in world.
var/list/commandos = list() //actual commando ghosts as picked by the user.
for(var/mob/dead/observer/G in player_list)
if(!G.client.holder && !G.client.is_afk()) //Whoever called/has the proc won't be added to the list.
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
for(var/i=commandos_possible,(i>0&&candidates.len),i--)//Decrease with every commando selected.
var/candidate = input("Pick characters to spawn as the commandos. This will go on until there either no more ghosts to pick from or the slots are full.", "Active Players") as null|anything in candidates //It will auto-pick a person when there is only one candidate.
candidates -= candidate //Subtract from candidates.
commandos += candidate//Add their ghost to commandos.
//Spawns commandos and equips them.
for(var/obj/effect/landmark/L in landmarks_list)
if(syndicate_commando_number<=0) break
if (L.name == "Syndicate-Commando")
syndicate_leader_selected = syndicate_commando_number == 1?1:0
var/mob/living/carbon/human/new_syndicate_commando = create_syndicate_death_commando(L, syndicate_leader_selected)
if(commandos.len)
new_syndicate_commando.key = pick(commandos)
commandos -= new_syndicate_commando.key
new_syndicate_commando.internal = new_syndicate_commando.s_store
new_syndicate_commando.internals.icon_state = "internal1"
//So they don't forget their code or mission.
if(nuke_code)
new_syndicate_commando.mind.store_memory("<B>Nuke Code:</B> \red [nuke_code].")
new_syndicate_commando.mind.store_memory("<B>Mission:</B> \red [input].")
new_syndicate_commando << "\blue You are an Elite Mercenary. [!syndicate_leader_selected?"commando":"<B>LEADER</B>"] in the service of criminal elements hostile to NanoTrasen. \nYour current mission is: \red<B>[input]</B>"
syndicate_commando_number--
//Spawns the rest of the commando gear.
// for (var/obj/effect/landmark/L)
// if (L.name == "Commando_Manual")
//new /obj/item/weapon/gun/energy/pulse_rifle(L.loc)
// var/obj/item/weapon/paper/P = new(L.loc)
// P.info = "<p><b>Good morning soldier!</b>. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:<br>#1 Work as a team.<br>#2 Accomplish your objective at all costs.<br>#3 Leave no witnesses.<br>You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.<br>If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.</p><p>In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations <b>LEADER</b> is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.</p><p>Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.<br>First and foremost, <b>DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE.</b> Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.<br>To make the device functional:<br>#1 Place bomb in designated detonation zone<br> #2 Extend and anchor bomb (attack with hand).<br>#3 Insert Nuclear Auth. Disk into slot.<br>#4 Type numeric code into keypad ([nuke_code]).<br>Note: If you make a mistake press R to reset the device.<br>#5 Press the E button to log onto the device.<br>You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.<br>Note: Toggle off the <b>SAFETY</b>.<br>Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.<br>Note: <b>THE BOMB IS STILL SET AND WILL DETONATE</b><br>Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.</p><p>The nuclear authorization code is: <b>[nuke_code ? nuke_code : "None provided"]</b></p><p><b>Good luck, soldier!</b></p>"
// P.name = "Spec. Ops. Manual"
for (var/obj/effect/landmark/L in landmarks_list)
if (L.name == "Syndicate-Commando-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(L.loc)
del(L)
message_admins("\blue [key_name_admin(usr)] has spawned a mercenary strike squad.", 1)
log_admin("[key_name(usr)] used Spawn Mercenary Squad.")
feedback_add_details("admin_verb","SDTHS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/create_syndicate_death_commando(obj/spawn_location, syndicate_leader_selected = 0)
var/mob/living/carbon/human/new_syndicate_commando = new(spawn_location.loc)
var/syndicate_commando_leader_rank = pick("Lieutenant", "Captain", "Major")
var/syndicate_commando_rank = pick("Corporal", "Sergeant", "Staff Sergeant", "Sergeant 1st Class", "Master Sergeant", "Sergeant Major")
var/syndicate_commando_name = pick(last_names)
new_syndicate_commando.gender = pick(MALE, FEMALE)
var/datum/preferences/A = new()//Randomize appearance for the commando.
A.randomize_appearance_for(new_syndicate_commando)
new_syndicate_commando.real_name = "[!syndicate_leader_selected ? syndicate_commando_rank : syndicate_commando_leader_rank] [syndicate_commando_name]"
new_syndicate_commando.age = !syndicate_leader_selected ? rand(23,35) : rand(35,45)
new_syndicate_commando.dna.ready_dna(new_syndicate_commando)//Creates DNA.
//Creates mind stuff.
new_syndicate_commando.mind_initialize()
new_syndicate_commando.mind.assigned_role = "MODE"
new_syndicate_commando.mind.special_role = "Mercenary"
ticker.mode.traitors |= new_syndicate_commando.mind //Adds them to current traitor list. Which is really the extra antagonist list.
new_syndicate_commando.equip_syndicate_commando(syndicate_leader_selected)
del(spawn_location)
return new_syndicate_commando
/mob/living/carbon/human/proc/equip_syndicate_commando(syndicate_leader_selected = 0)
var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate(src)
R.set_frequency(SYND_FREQ) //Same frequency as the syndicate team in Nuke mode.
equip_to_slot_or_del(R, slot_l_ear)
equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(src), slot_w_uniform)
equip_to_slot_or_del(new /obj/item/clothing/shoes/swat(src), slot_shoes)
if (!syndicate_leader_selected)
equip_to_slot_or_del(new /obj/item/clothing/suit/space/syndicate/black(src), slot_wear_suit)
else
equip_to_slot_or_del(new /obj/item/clothing/suit/space/syndicate/black/red(src), slot_wear_suit)
equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(src), slot_gloves)
if (!syndicate_leader_selected)
equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/syndicate/black(src), slot_head)
else
equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/syndicate/black/red(src), slot_head)
equip_to_slot_or_del(new /obj/item/clothing/mask/gas/syndicate(src), slot_wear_mask)
equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal(src), slot_glasses)
equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(src), slot_back)
equip_to_slot_or_del(new /obj/item/weapon/storage/box(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/ammo_magazine/c45(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/regular(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_in_backpack)
if (!syndicate_leader_selected)
equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_in_backpack)
else
equip_to_slot_or_del(new /obj/item/weapon/pinpointer(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/disk/nuclear(src), slot_in_backpack)
equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword(src), slot_l_store)
equip_to_slot_or_del(new /obj/item/weapon/grenade/empgrenade(src), slot_r_store)
equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store)
equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/silenced(src), slot_belt)
equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle(src), slot_r_hand) //Will change to something different at a later time -- Superxpdude
var/obj/item/weapon/card/id/syndicate/W = new(src) //Untrackable by AI
W.name = "[real_name]'s ID Card"
W.icon_state = "id"
W.access = get_all_accesses()//They get full station access because obviously the syndicate has HAAAX, and can make special IDs for their most elite members.
W.access += list(access_cent_general, access_cent_specops, access_cent_living, access_cent_storage, access_syndicate)//Let's add their forged CentCom access and syndicate access.
W.assignment = "Mercenary"
W.registered_name = real_name
equip_to_slot_or_del(W, slot_wear_id)
return 1
-69
View File
@@ -1,69 +0,0 @@
var/global/vox_tick = 1
/mob/living/carbon/human/proc/equip_vox_raider()
var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate(src)
R.set_frequency(SYND_FREQ)
equip_to_slot_or_del(R, slot_l_ear)
equip_to_slot_or_del(new /obj/item/clothing/under/vox/vox_robes(src), slot_w_uniform)
equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/vox(src), slot_shoes) // REPLACE THESE WITH CODED VOX ALTERNATIVES.
equip_to_slot_or_del(new /obj/item/clothing/gloves/yellow/vox(src), slot_gloves) // AS ABOVE.
switch(vox_tick)
if(1) // Vox raider!
equip_to_slot_or_del(new /obj/item/clothing/suit/space/vox/carapace(src), slot_wear_suit)
equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/vox/carapace(src), slot_head)
equip_to_slot_or_del(new /obj/item/weapon/melee/baton/loaded(src), slot_belt)
equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(src), slot_glasses) // REPLACE WITH CODED VOX ALTERNATIVE.
equip_to_slot_or_del(new /obj/item/device/chameleon(src), slot_l_store)
var/obj/item/weapon/gun/launcher/spikethrower/W = new(src)
equip_to_slot_or_del(W, slot_r_hand)
if(2) // Vox engineer!
equip_to_slot_or_del(new /obj/item/clothing/suit/space/vox/pressure(src), slot_wear_suit)
equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/vox/pressure(src), slot_head)
equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full(src), slot_belt)
equip_to_slot_or_del(new /obj/item/clothing/glasses/meson(src), slot_glasses) // REPLACE WITH CODED VOX ALTERNATIVE.
equip_to_slot_or_del(new /obj/item/weapon/storage/box/emps(src), slot_r_hand)
equip_to_slot_or_del(new /obj/item/device/multitool(src), slot_l_hand)
if(3) // Vox saboteur!
equip_to_slot_or_del(new /obj/item/clothing/suit/space/vox/stealth(src), slot_wear_suit)
equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/vox/stealth(src), slot_head)
equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full(src), slot_belt)
equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(src), slot_glasses) // REPLACE WITH CODED VOX ALTERNATIVE.
equip_to_slot_or_del(new /obj/item/weapon/card/emag(src), slot_l_store)
equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/dartgun/vox/raider(src), slot_r_hand)
equip_to_slot_or_del(new /obj/item/device/multitool(src), slot_l_hand)
if(4) // Vox medic!
equip_to_slot_or_del(new /obj/item/clothing/suit/space/vox/medic(src), slot_wear_suit)
equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/vox/medic(src), slot_head)
equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full(src), slot_belt) // Who needs actual surgical tools?
equip_to_slot_or_del(new /obj/item/clothing/glasses/hud/health(src), slot_glasses) // REPLACE WITH CODED VOX ALTERNATIVE.
equip_to_slot_or_del(new /obj/item/weapon/circular_saw(src), slot_l_store)
equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/dartgun/vox/medical, slot_r_hand)
equip_to_slot_or_del(new /obj/item/clothing/mask/breath(src), slot_wear_mask)
equip_to_slot_or_del(new /obj/item/weapon/tank/nitrogen(src), slot_back)
equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_r_store)
var/obj/item/weapon/card/id/syndicate/C = new(src)
C.name = "[real_name]'s Legitimate Human ID Card"
C.icon_state = "id"
C.access = list(access_syndicate)
C.assignment = "Trader"
C.registered_name = real_name
C.registered_user = src
var/obj/item/weapon/storage/wallet/W = new(src)
W.handle_item_insertion(C)
spawn_money(rand(50,150)*10,W)
equip_to_slot_or_del(W, slot_wear_id)
vox_tick++
if (vox_tick > 4) vox_tick = 1
return 1
+1 -1
View File
@@ -145,7 +145,7 @@
if(custom_event_msg && custom_event_msg != "")
src << "<h1 class='alert'>Custom Event</h1>"
src << "<h2 class='alert'>A custom event is taking place. OOC Info:</h2>"
src << "<span class='alert'>[html_encode(custom_event_msg)]</span>"
src << "<span class='alert'>[custom_event_msg]</span>"
src << "<br>"
if( (world.address == address || !address) && !host )
+21 -49
View File
@@ -15,7 +15,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set
"cultist" = IS_MODE_COMPILED("cult"), // 8
"infested monkey" = IS_MODE_COMPILED("monkey"), // 9
"ninja" = "true", // 10
"vox raider" = IS_MODE_COMPILED("heist"), // 11
"raider" = IS_MODE_COMPILED("heist"), // 11
"diona" = 1, // 12
"mutineer" = IS_MODE_COMPILED("mutiny"), // 13
"pAI candidate" = 1, // -- TLE // 14
@@ -171,16 +171,16 @@ datum/preferences
used_skillpoints += 6 * multiplier
/datum/preferences/proc/GetSkillClass(points)
return CalculateSkillClass(points, age)
/proc/CalculateSkillClass(points, age)
if(points <= 0) return "Unconfigured"
// skill classes describe how your character compares in total points
var/original_points = points
points -= min(round((age - 20) / 2.5), 4) // every 2.5 years after 20, one extra skillpoint
if(age > 30)
points -= round((age - 30) / 5) // every 5 years after 30, one extra skillpoint
if(original_points > 0 && points <= 0) points = 1
switch(points)
if(0)
return "Unconfigured"
if(1 to 3)
if(-1000 to 3)
return "Terrifying"
if(4 to 6)
return "Below Average"
@@ -394,7 +394,7 @@ datum/preferences
dat += "<b><a href=\"byond://?src=\ref[user];preference=antagoptions;active=0\">Set Antag Options</b></a><br>"
dat += "\t<a href=\"byond://?src=\ref[user];preference=skills\"><b>Set Skills</b> (<i>[GetSkillClass(used_skillpoints)][used_skillpoints > 0 ? " [used_skillpoints]" : "0"])</i></a><br>"
dat += "\t<a href=\"byond://?src=\ref[user];preference=skills\"><b>Set Skills</b> (<i>[GetSkillClass(used_skillpoints)] [used_skillpoints > 0 ? "[used_skillpoints]" : "0"]</i>)</a><br>"
dat += "<a href='byond://?src=\ref[user];preference=flavor_text;task=open'><b>Set Flavor Text</b></a><br>"
dat += "<a href='byond://?src=\ref[user];preference=flavour_text_robot;task=open'><b>Set Robot Flavour Text</b></a><br>"
@@ -995,16 +995,10 @@ datum/preferences
ShowChoices(user)
return
if("general")
var/msg = input(usr,"Give a general description of your character. This will be shown regardless of clothing, and may include OOC notes and preferences.","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message
if(msg != null)
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
msg = html_encode(msg)
var/msg = sanitize(input(usr,"Give a general description of your character. This will be shown regardless of clothing, and may include OOC notes and preferences.","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message, extra = 0)
flavor_texts[href_list["task"]] = msg
else
var/msg = input(usr,"Set the flavor text for your [href_list["task"]].","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message
if(msg != null)
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
msg = html_encode(msg)
var/msg = sanitize(input(usr,"Set the flavor text for your [href_list["task"]].","Flavor Text",html_decode(flavor_texts[href_list["task"]])) as message, extra = 0)
flavor_texts[href_list["task"]] = msg
SetFlavorText(user)
return
@@ -1019,16 +1013,10 @@ datum/preferences
ShowChoices(user)
return
if("Default")
var/msg = input(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting.","Flavour Text",html_decode(flavour_texts_robot["Default"])) as message
if(msg != null)
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
msg = html_encode(msg)
var/msg = sanitize(input(usr,"Set the default flavour text for your robot. It will be used for any module without individual setting.","Flavour Text",html_decode(flavour_texts_robot["Default"])) as message, extra = 0)
flavour_texts_robot[href_list["task"]] = msg
else
var/msg = input(usr,"Set the flavour text for your robot with [href_list["task"]] module. If you leave this empty, default flavour text will be used for this module.","Flavour Text",html_decode(flavour_texts_robot[href_list["task"]])) as message
if(msg != null)
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
msg = html_encode(msg)
var/msg = sanitize(input(usr,"Set the flavour text for your robot with [href_list["task"]] module. If you leave this empty, default flavour text will be used for this module.","Flavour Text",html_decode(flavour_texts_robot[href_list["task"]])) as message, extra = 0)
flavour_texts_robot[href_list["task"]] = msg
SetFlavourTextRobot(user)
return
@@ -1044,41 +1032,25 @@ datum/preferences
else
user << browse(null, "window=records")
if(href_list["task"] == "med_record")
var/medmsg = input(usr,"Set your medical notes here.","Medical Records",html_decode(med_record)) as message
var/medmsg = sanitize(input(usr,"Set your medical notes here.","Medical Records",html_decode(med_record)) as message, MAX_PAPER_MESSAGE_LEN, extra = 0)
if(medmsg != null)
medmsg = copytext(medmsg, 1, MAX_PAPER_MESSAGE_LEN)
medmsg = html_encode(medmsg)
med_record = medmsg
SetRecords(user)
if(href_list["task"] == "sec_record")
var/secmsg = input(usr,"Set your security notes here.","Security Records",html_decode(sec_record)) as message
var/secmsg = sanitize(input(usr,"Set your security notes here.","Security Records",html_decode(sec_record)) as message, MAX_PAPER_MESSAGE_LEN, extra = 0)
if(secmsg != null)
secmsg = copytext(secmsg, 1, MAX_PAPER_MESSAGE_LEN)
secmsg = html_encode(secmsg)
sec_record = secmsg
SetRecords(user)
if(href_list["task"] == "gen_record")
var/genmsg = input(usr,"Set your employment notes here.","Employment Records",html_decode(gen_record)) as message
var/genmsg = sanitize(input(usr,"Set your employment notes here.","Employment Records",html_decode(gen_record)) as message, MAX_PAPER_MESSAGE_LEN, extra = 0)
if(genmsg != null)
genmsg = copytext(genmsg, 1, MAX_PAPER_MESSAGE_LEN)
genmsg = html_encode(genmsg)
gen_record = genmsg
SetRecords(user)
if(href_list["task"] == "exploitable_record")
var/exploitmsg = input(usr,"Set exploitable information about you here.","Exploitable Information",html_decode(exploit_record)) as message
var/exploitmsg = sanitize(input(usr,"Set exploitable information about you here.","Exploitable Information",html_decode(exploit_record)) as message, MAX_PAPER_MESSAGE_LEN, extra = 0)
if(exploitmsg != null)
exploitmsg = copytext(exploitmsg, 1, MAX_PAPER_MESSAGE_LEN)
exploitmsg = html_encode(exploitmsg)
exploit_record = exploitmsg
SetAntagoptions(user)
@@ -1205,7 +1177,7 @@ datum/preferences
if("name")
var/raw_name = input(user, "Choose your character's name:", "Character Preference") as text|null
if (!isnull(raw_name)) // Check to ensure that the user entered text (rather than cancel.)
var/new_name = reject_bad_name(raw_name)
var/new_name = sanitizeName(raw_name)
if(new_name)
real_name = new_name
else
@@ -1291,7 +1263,7 @@ datum/preferences
if("metadata")
var/new_metadata = input(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , metadata) as message|null
if(new_metadata)
metadata = sanitize(copytext(new_metadata,1,MAX_MESSAGE_LEN))
metadata = sanitize(new_metadata)
if("b_type")
var/new_b_type = input(user, "Choose your character's blood-type:", "Character Preference") as null|anything in list( "A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-" )
@@ -1504,7 +1476,7 @@ datum/preferences
if(choice == "Other")
var/raw_choice = input(user, "Please enter a home system.") as text|null
if(raw_choice)
home_system = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
home_system = sanitize(raw_choice)
return
home_system = choice
if("citizenship")
@@ -1514,7 +1486,7 @@ datum/preferences
if(choice == "Other")
var/raw_choice = input(user, "Please enter your current citizenship.", "Character Preference") as text|null
if(raw_choice)
citizenship = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
citizenship = sanitize(raw_choice)
return
citizenship = choice
if("faction")
@@ -1524,7 +1496,7 @@ datum/preferences
if(choice == "Other")
var/raw_choice = input(user, "Please enter a faction.") as text|null
if(raw_choice)
faction = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
faction = sanitize(raw_choice)
return
faction = choice
if("religion")
@@ -1534,7 +1506,7 @@ datum/preferences
if(choice == "Other")
var/raw_choice = input(user, "Please enter a religon.") as text|null
if(raw_choice)
religion = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
religion = sanitize(raw_choice)
return
religion = choice
else
+1 -1
View File
@@ -187,7 +187,7 @@
//Sanitize
metadata = sanitize_text(metadata, initial(metadata))
real_name = reject_bad_name(real_name)
real_name = sanitizeName(real_name)
if(isnull(species) || !(species in playable_species))
species = "Human"
+2 -2
View File
@@ -453,13 +453,13 @@ BLIND // can't see anything
A.attack_hand(user)
return
if ((ishuman(usr) || ismonkey(usr)) && src.loc == user) //make it harder to accidentally undress yourself
if ((ishuman(usr) || issmall(usr)) && src.loc == user) //make it harder to accidentally undress yourself
return
..()
/obj/item/clothing/under/MouseDrop(obj/over_object as obj)
if (ishuman(usr) || ismonkey(usr))
if (ishuman(usr) || issmall(usr))
//makes sure that the clothing is equipped so that we can't drag it into our hand from miles away.
if (!(src.loc == usr))
return
+4
View File
@@ -43,6 +43,10 @@
siemens_coefficient = 0.7
body_parts_covered = FACE|EYES
/obj/item/clothing/mask/gas/swat/vox
name = "\improper alien mask"
desc = "Clearly not designed for a human face."
/obj/item/clothing/mask/gas/syndicate
name = "tactical mask"
desc = "A close-fitting tactical mask that can be connected to an air supply."
+32 -1
View File
@@ -100,4 +100,35 @@
body_parts_covered = HEAD|FACE|EYES
w_class = 2
var/voicechange = 0
siemens_coefficient = 0.9
siemens_coefficient = 0.9
/obj/item/clothing/mask/ai
name = "camera MIU"
desc = "Allows for direct mental connection to accessible camera networks."
icon_state = "s-ninja"
item_state = "s-ninja"
flags_inv = HIDEFACE
body_parts_covered = 0
var/mob/eye/aiEye/eye
/obj/item/clothing/mask/ai/New()
eye = new(src)
/obj/item/clothing/mask/ai/equipped(var/mob/user, var/slot)
..(user, slot)
if(slot == slot_wear_mask)
eye.owner = user
user.eyeobj = eye
for(var/datum/chunk/c in eye.visibleChunks)
c.remove(eye)
eye.setLoc(user)
/obj/item/clothing/mask/ai/dropped(var/mob/user)
..()
if(eye.owner == user)
for(var/datum/chunk/c in eye.visibleChunks)
c.remove(eye)
eye.owner.eyeobj = null
eye.owner = null
+1 -1
View File
@@ -21,7 +21,7 @@
set category = "Object"
set src in usr
var/voice = sanitize(copytext(name,1,MAX_MESSAGE_LEN))
var/voice = sanitize(name, MAX_NAME_LEN)
if(!voice || !length(voice)) return
changer.voice = voice
usr << "<span class='notice'>You are now mimicking <B>[changer.voice]</B>.</span>"
@@ -133,7 +133,7 @@
/obj/item/rig_module/chem_dispenser/ninja
interface_desc = "Dispenses loaded chemicals directly into the wearer's bloodstream. This variant is made to be extremely light and flexible."
//just over a syringe worth of each. Want more? Go refill. Gives the ninja another reason to have to show their face.
charges = list(
list("tricordrazine", "tricordrazine", 0, 20),
@@ -280,10 +280,10 @@
voice_holder.active = 0
usr << "<font color='blue'>You disable the speech synthesiser.</font>"
if("Set Name")
var/raw_choice = input(usr, "Please enter a new name.") as text|null
var/raw_choice = sanitize(input(usr, "Please enter a new name.") as text|null)
if(!raw_choice)
return 0
voice_holder.voice = sanitize(copytext(raw_choice,1,MAX_MESSAGE_LEN))
voice_holder.voice = raw_choice
usr << "<font color='blue'>You are now mimicking <B>[voice_holder.voice]</B>.</font>"
return 1
+13 -12
View File
@@ -688,27 +688,28 @@
//Todo
/obj/item/weapon/rig/proc/malfunction()
return 0
return 0
/obj/item/weapon/rig/emp_act(severity_class)
//set malfunctioning
if(emp_protection < 30) //for ninjas, really.
malfunctioning += 10
if(malfunction_delay <= 0)
malfunction_delay = max(malfunction_delay, round(30/severity_class))
malfunction_delay = max(malfunction_delay, round(30/severity_class))
//drain some charge
if(cell) cell.emp_act(severity_class + 15)
//possibly damage some modules
take_hit((100/severity_class), "electrical pulse", 1)
take_hit((100/severity_class), "electrical pulse", 1)
/obj/item/weapon/rig/proc/shock(mob/user)
if (electrocute_mob(user, cell, src))
spark_system.start()
return 1
if(user.stunned)
return 1
return 0
/obj/item/weapon/rig/proc/take_hit(damage, source, is_emp=0)
if(!installed_modules.len)
@@ -720,7 +721,7 @@
else
//Want this to be roughly independant of the number of modules, meaning that X emp hits will disable Y% of the suit's modules on average.
//that way people designing hardsuits don't have to worry (as much) about how adding that extra module will affect emp resiliance by 'soaking' hits for other modules
chance = max(0, damage - emp_protection)*min(installed_modules.len/15, 1)
chance = 2*max(0, damage - emp_protection)*min(installed_modules.len/15, 1)
if(!prob(chance))
return
@@ -740,7 +741,7 @@
dam_module = pick(damaged_modules)
else if(valid_modules.len)
dam_module = pick(valid_modules)
if(!dam_module) return
dam_module.damage++
@@ -748,11 +749,11 @@
if(!source)
source = "hit"
if(wearer)
if(wearer)
if(dam_module.damage >= 2)
wearer << "<span class='danger'>The [source] has disabled your [dam_module.interface_name]!"
else
wearer << "<span class='warning'>The [source] has damaged your [dam_module.interface_name]!"
wearer << "<span class='warning'>The [source] has damaged your [dam_module.interface_name]!"
dam_module.deactivate()
/obj/item/weapon/rig/proc/malfunction_check(var/mob/living/carbon/human/user)
@@ -39,9 +39,9 @@
flags_inv = HIDEJUMPSUIT|HIDETAIL
flags = STOPPRESSUREDAMAGE | THICKMATERIAL | AIRTIGHT
slowdown = 0
//will reach 10 breach damage after 18 laser carbine blasts, or 7 revolver hits. Completely immune to smg hits.
breach_threshold = 28
resilience = 0.05
//will reach 10 breach damage after 25 laser carbine blasts, 3 revolver hits, or ~1 PTR hit. Completely immune to smg or sts hits.
breach_threshold = 38
resilience = 0.2
can_breach = 1
sprite_sheets = list("Tajara" = 'icons/mob/species/tajaran/suit.dmi',"Unathi" = 'icons/mob/species/unathi/suit.dmi')
supporting_limbs = list()
@@ -20,7 +20,6 @@
/obj/item/clothing/suit/space/rig/light
name = "suit"
breach_threshold = 18 //comparable to voidsuits
resilience = 0.2
/obj/item/clothing/gloves/rig/light
name = "gloves"
@@ -82,8 +81,7 @@
..()
/obj/item/clothing/suit/space/rig/light/ninja
breach_threshold = 28 //comparable to regular hardsuits
resilience = 0.05
breach_threshold = 38 //comparable to regular hardsuits
/obj/item/weapon/rig/light/stealth
name = "stealth suit control module"
@@ -94,7 +92,6 @@
req_access = list(access_syndicate)
initial_modules = list(
/obj/item/rig_module/teleporter,
/obj/item/rig_module/stealth_field,
/obj/item/rig_module/vision
)
+5 -5
View File
@@ -13,7 +13,7 @@
item_state = "w_suit"
/obj/item/clothing/under/captain_fly
name = "rogue captains uniform"
name = "rogue's uniform"
desc = "For the man who doesn't care because he's still free."
icon_state = "captain_fly"
item_state = "captain_fly"
@@ -154,7 +154,7 @@
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
/obj/item/clothing/under/gentlesuit
name = "Gentlemans Suit"
name = "gentlemans suit"
desc = "A silk black shirt with a white tie and a matching gray vest and slacks. Feels proper."
icon_state = "gentlesuit"
item_state = "gentlesuit"
@@ -477,14 +477,14 @@
item_color = "tan_suit"
/obj/item/clothing/under/serviceoveralls
name = "Workman outfit"
name = "workman outfit"
desc = "The very image of a working man. Not that you're probably doing work."
icon_state = "mechanic"
item_state = "mechanic"
item_color = "mechanic"
/obj/item/clothing/under/cheongsam
name = "White Cheongsam"
name = "white cheongsam"
desc = "It is a white cheongsam dress."
icon_state = "mai_yang"
item_state = "mai_yang"
@@ -496,4 +496,4 @@
desc = "A bold but yet conservative outfit, red corduroys, navy blazer and a tie."
icon_state = "blue_blazer"
item_state = "blue_blazer"
item_color = "blue_blazer"
item_color = "blue_blazer"
@@ -222,7 +222,7 @@
if("logout")
authenticated = 0
if("filter")
var/filterstr = stripped_input(usr,"Input the search criteria. Multiple values can be input, separated by a comma.", "Filter setting") as text|null
var/filterstr = sanitize(input("Input the search criteria. Multiple values can be input, separated by a comma.", "Filter setting") as text|null)
if(filterstr)
filters[href_list["filter"]] = text2list(filterstr,",")
else
@@ -243,7 +243,7 @@
current = null
if("label")
if(current)
var/label = stripped_input(usr,"Input the label for this record. Multiple values can be input, separated by a comma.", "Labeling record", current.fields["label"]) as text|null
var/label = sanitize(input(usr,"Input the label for this record. Multiple values can be input, separated by a comma.", "Labeling record", current.fields["label"]) as text|null)
current.fields["label"] = label
if("object")
if(scanning)
+2 -2
View File
@@ -167,7 +167,7 @@
if("change_id")
var/attempt_code = text2num(input("Re-enter the current EFTPOS access code", "Confirm EFTPOS code"))
if(attempt_code == access_code)
eftpos_name = input("Enter a new terminal ID for this device", "Enter new EFTPOS ID") + " EFTPOS scanner"
eftpos_name = sanitize(input("Enter a new terminal ID for this device", "Enter new EFTPOS ID")) + " EFTPOS scanner"
print_reference()
else
usr << "\icon[src]<span class='warning'>Incorrect code entered.</span>"
@@ -182,7 +182,7 @@
else
usr << "\icon[src]<span class='warning'>Account not found.</span>"
if("trans_purpose")
var/choice = input("Enter reason for EFTPOS transaction", "Transaction purpose")
var/choice = sanitize(input("Enter reason for EFTPOS transaction", "Transaction purpose"))
if(choice) transaction_purpose = choice
if("trans_value")
var/try_num = input("Enter amount for EFTPOS transaction", "Transaction amount") as num
-39
View File
@@ -1,39 +0,0 @@
/var/global/sent_aliens_to_station = 0
/datum/event/alien_infestation
announceWhen = 400
var/spawncount = 1
var/successSpawn = 0 //So we don't make a command report if nothing gets spawned.
/datum/event/alien_infestation/setup()
announceWhen = rand(announceWhen, announceWhen + 50)
spawncount = rand(1, 2)
sent_aliens_to_station = 1
/datum/event/alien_infestation/announce()
if(successSpawn)
command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
/datum/event/alien_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in config.station_levels)
if(temp_vent.network.normal_members.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
var/list/candidates = get_alien_candidates()
while(spawncount > 0 && vents.len && candidates.len)
var/obj/vent = pick(vents)
var/candidate = pick(candidates)
var/mob/living/carbon/alien/larva/new_xeno = new(vent.loc)
new_xeno.key = candidate
candidates -= candidate
vents -= vent
spawncount--
successSpawn = 1
-33
View File
@@ -1,33 +0,0 @@
//Cortical borer spawn event - care of RobRichards1997 with minor editing by Zuhayr.
/datum/event/borer_infestation
announceWhen = 400
var/spawncount = 5
var/successSpawn = 0 //So we don't make a command report if nothing gets spawned.
/datum/event/borer_infestation/setup()
announceWhen = rand(announceWhen, announceWhen + 50)
spawncount = rand(1, 3)
/datum/event/borer_infestation/announce()
if(successSpawn)
command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
/datum/event/borer_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in config.station_levels)
//Stops cortical borers getting stuck in small networks. See: Security, Virology
if(temp_vent.network.normal_members.len > 50)
vents += temp_vent
var/list/candidates = get_alien_candidates()
while(spawncount > 0 && vents.len && candidates.len)
var/obj/vent = pick_n_take(vents)
var/client/C = pick_n_take(candidates)
var/mob/living/simple_animal/borer/new_borer = new(vent.loc)
new_borer.key = C.key
spawncount--
successSpawn = 1
+1 -2
View File
@@ -153,8 +153,7 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Viral Infection", /datum/event/viral_infection, 0, list(ASSIGNMENT_MEDICAL = 150)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spider Infestation", /datum/event/spider_infestation, 100, list(ASSIGNMENT_SECURITY = 30), 1),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Ion Storm", /datum/event/ionstorm, 0, list(ASSIGNMENT_AI = 50, ASSIGNMENT_CYBORG = 50, ASSIGNMENT_ENGINEER = 15, ASSIGNMENT_SCIENTIST = 5)),
new /datum/event_meta/alien(EVENT_LEVEL_MODERATE, "Alien Infestation", /datum/event/alien_infestation, 2.5, list(ASSIGNMENT_SECURITY = 1), 1, 0, 5),
new /datum/event_meta/ninja(EVENT_LEVEL_MODERATE, "Space Ninja", /datum/event/space_ninja, 0, list(ASSIGNMENT_SECURITY = 1), 1, 0, 5),
new /datum/event_meta/alien(EVENT_LEVEL_MODERATE, "Random Antagonist", /datum/event/random_antag, 2.5, list(ASSIGNMENT_SECURITY = 1), 1, 0, 5),
)
/datum/event_container/major
+4 -13
View File
@@ -45,15 +45,9 @@ var/list/event_last_fired = list()
// Code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events.dm
// Code/WorkInProgress/Cael_Aislinn/Economy/Economy_Events_Mundane.dm
if(ticker.mode && ticker.mode.name == "calamity") //Calamity mode messes with some events.
possibleEvents[/datum/event/borer_infestation] = 400
possibleEvents[/datum/event/economic_event] = 25
possibleEvents[/datum/event/trivial_news] = 25
possibleEvents[/datum/event/mundane_news] = 25
else
possibleEvents[/datum/event/economic_event] = 300
possibleEvents[/datum/event/trivial_news] = 400
possibleEvents[/datum/event/mundane_news] = 300
possibleEvents[/datum/event/economic_event] = 300
possibleEvents[/datum/event/trivial_news] = 400
possibleEvents[/datum/event/mundane_news] = 300
possibleEvents[/datum/event/pda_spam] = max(min(25, player_list.len) * 4, 200)
possibleEvents[/datum/event/money_lotto] = max(min(5, player_list.len), 50)
@@ -89,10 +83,7 @@ var/list/event_last_fired = list()
if(active_with_role["Security"] > 0)
if(!sent_spiders_to_station)
possibleEvents[/datum/event/spider_infestation] = max(active_with_role["Security"], 5) + 5
if(config.aliens_allowed && !sent_aliens_to_station)
possibleEvents[/datum/event/alien_infestation] = max(active_with_role["Security"], 5) + 2.5
if(!sent_ninja_to_station && config.ninjas_allowed)
possibleEvents[/datum/event/space_ninja] = max(active_with_role["Security"], 5)
possibleEvents[/datum/event/random_antag] = max(active_with_role["Security"], 5) + 2.5
for(var/event_type in event_last_fired) if(possibleEvents[event_type])
var/time_passed = world.time - event_last_fired[event_type]
+1 -1
View File
@@ -233,7 +233,7 @@
else if(href_list["back"])
selected_event_container = null
else if(href_list["set_name"])
var/name = input("Enter event name.", "Set Name") as text|null
var/name = sanitize(input("Enter event name.", "Set Name") as text|null)
if(name)
var/datum/event_meta/EM = locate(href_list["set_name"])
EM.name = name
-2
View File
@@ -49,8 +49,6 @@
else
randmutg(H) // Applies good mutation
domutcheck(H,null,MUTCHK_FORCED)
else if(istype(C,/mob/living/carbon/monkey))
C.apply_effect((rand(5,25)),IRRADIATE,0)
/datum/event/radiation_storm/end()
revoke_maint_all_access()
+13
View File
@@ -0,0 +1,13 @@
// The random spawn proc on the antag datum will handle announcing the spawn and whatnot.
/datum/event/random_antag/announce()
return
/datum/event/random_antag/start()
var/list/valid_types = list()
for(var/antag_type in all_antag_types)
var/datum/antagonist/antag = all_antag_types[antag_type]
if(antag.flags & ANTAG_RANDSPAWN)
valid_types |= antag
if(valid_types.len)
var/datum/antagonist/antag = pick(valid_types)
antag.random_spawn()
+2
View File
@@ -319,6 +319,7 @@
del(src)
return
/*
if(seed.kitchen_tag)
switch(seed.kitchen_tag)
if("shand")
@@ -333,6 +334,7 @@
user << "<span class='notice'>You mash the petals into a poultice.</span>"
del(src)
return
*/
/obj/item/weapon/reagent_containers/food/snacks/grown/pickup(mob/user)
..()
+12 -1
View File
@@ -59,7 +59,7 @@
set_trait(TRAIT_HIGHKPA_TOLERANCE, 200) // High pressure capacity.
set_trait(TRAIT_IDEAL_HEAT, 293) // Preferred temperature in Kelvin.
set_trait(TRAIT_NUTRIENT_CONSUMPTION, 0.25) // Plant eats this much per tick.
set_trait(TRAIT_PLANT_COLOUR, "#6EF86A") // Colour of the plant icon.
set_trait(TRAIT_PLANT_COLOUR, "#46B543") // Colour of the plant icon.
spawn(5)
sleep(-1)
@@ -142,6 +142,17 @@
if(!get_trait(TRAIT_STINGS))
return
if(chems && chems.len)
var/body_coverage = HEAD|FACE|EYES|UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
for(var/obj/item/clothing/clothes in target)
if(target.l_hand == clothes|| target.r_hand == clothes)
continue
body_coverage &= ~(clothes.body_parts_covered)
if(!body_coverage)
return
target << "<span class='danger'>You are stung by \the [fruit]!</span>"
for(var/rid in chems)
var/injecting = min(5,max(1,get_trait(TRAIT_POTENCY)/5))
+3 -1
View File
@@ -66,7 +66,9 @@ var/global/datum/controller/plants/plant_controller // Set in New().
plant_sprites[base] = ikey
for(var/icostate in icon_states('icons/obj/hydroponics_products.dmi'))
plant_product_sprites |= icostate
var/split = findtext(icostate,"-")
if(split)
plant_product_sprites |= copytext(icostate,1,split)
// Populate the global seed datum list.
for(var/type in typesof(/datum/seed)-/datum/seed)
+6 -5
View File
@@ -241,7 +241,7 @@
set_trait(TRAIT_PRODUCTION,6)
set_trait(TRAIT_YIELD,5)
set_trait(TRAIT_POTENCY,10)
set_trait(TRAIT_PRODUCT_ICON,"treefruit")
set_trait(TRAIT_PRODUCT_ICON,"apple")
set_trait(TRAIT_PRODUCT_COLOUR,"#FF540A")
set_trait(TRAIT_PLANT_ICON,"tree2")
@@ -419,7 +419,7 @@
set_trait(TRAIT_POTENCY,10)
set_trait(TRAIT_PRODUCT_ICON,"mushroom")
set_trait(TRAIT_PRODUCT_COLOUR,"#FF4545")
set_trait(TRAIT_PLANT_COLOUR,"#F5F2D0")
set_trait(TRAIT_PLANT_COLOUR,"#E0DDBA")
set_trait(TRAIT_PLANT_ICON,"mushroom4")
/datum/seed/mushroom/poison/death
@@ -466,7 +466,6 @@
set_trait(TRAIT_SPREAD,1)
set_trait(TRAIT_MATURATION,15)
set_trait(TRAIT_YIELD,3)
set_trait(TRAIT_EXPLOSIVE,1)
set_trait(TRAIT_POTENCY,30)
set_trait(TRAIT_BIOLUM,1)
set_trait(TRAIT_BIOLUM_COLOUR,"#006622")
@@ -585,7 +584,7 @@
set_trait(TRAIT_YIELD,6)
set_trait(TRAIT_POTENCY,10)
set_trait(TRAIT_PRODUCT_ICON,"potato")
set_trait(TRAIT_PRODUCT_COLOUR,"#96855D")
set_trait(TRAIT_PRODUCT_COLOUR,"#C4AE7A")
set_trait(TRAIT_PLANT_ICON,"bush2")
/datum/seed/cabbage
@@ -861,6 +860,7 @@
seed_name = "orange"
display_name = "orange trees"
kitchen_tag = "orange"
chems = list("nutriment" = list(1,20), "orangejuice" = list(1,20))
/datum/seed/citrus/orange/New()
..()
@@ -918,8 +918,9 @@
set_trait(TRAIT_YIELD,3)
set_trait(TRAIT_POTENCY,10)
set_trait(TRAIT_PRODUCT_ICON,"cherry")
set_trait(TRAIT_PRODUCT_COLOUR,"#8C0101")
set_trait(TRAIT_PRODUCT_COLOUR,"#A80000")
set_trait(TRAIT_PLANT_ICON,"tree2")
set_trait(TRAIT_PLANT_COLOUR,"#2F7D2D")
/datum/seed/kudzu
name = "kudzu"
+2
View File
@@ -12,6 +12,8 @@ var/global/list/plant_seed_sprites = list()
var/modified = 0
/obj/item/seeds/New()
while(!plant_controller)
sleep(30)
update_seed()
..()
@@ -66,7 +66,13 @@
victim.buckled = src
victim.update_canmove()
buckled_mob = victim
if(victim.loc != get_turf(src))
src.visible_message("<span class='danger'>Tendrils lash out from \the [src] and drag \the [victim] in!</span>")
victim.loc = src.loc
if(!victim.anchored && !victim.buckled && victim.loc != get_turf(src))
var/can_grab = 1
if(istype(victim, /mob/living/carbon/human))
var/mob/living/carbon/human/H = victim
if(istype(H.shoes, /obj/item/clothing/shoes/magboots) && (H.shoes.flags & NOSLIP))
can_grab = 0
if(can_grab)
src.visible_message("<span class='danger'>Tendrils lash out from \the [src] and drag \the [victim] in!</span>")
victim.loc = src.loc
victim << "<span class='danger'>Tendrils [pick("wind", "tangle", "tighten")] around you!</span>"
+5 -5
View File
@@ -31,11 +31,11 @@
O.loc = src
update_icon()
else if(istype(O, /obj/item/weapon/pen))
var/newname = stripped_input(usr, "What would you like to title this bookshelf?")
var/newname = sanitizeSafe(input("What would you like to title this bookshelf?"), MAX_MESSAGE_LEN)
if(!newname)
return
else
name = ("bookcase ([sanitize(newname)])")
name = ("bookcase ([newname])")
else
..()
@@ -174,7 +174,7 @@
var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
switch(choice)
if("Title")
var/newtitle = reject_bad_text(stripped_input(usr, "Write a new title:"))
var/newtitle = reject_bad_text(sanitizeSafe(input("Write a new title:")))
if(!newtitle)
usr << "The title is invalid."
return
@@ -182,14 +182,14 @@
src.name = newtitle
src.title = newtitle
if("Contents")
var/content = strip_html(input(usr, "Write your book's contents (HTML NOT allowed):"),8192) as message|null
var/content = sanitize(input("Write your book's contents (HTML NOT allowed):") as message|null, MAX_BOOK_MESSAGE_LEN)
if(!content)
usr << "The content is invalid."
return
else
src.dat += content
if("Author")
var/newauthor = stripped_input(usr, "Write the author's name:")
var/newauthor = sanitize(input(usr, "Write the author's name:"))
if(!newauthor)
usr << "The name is invalid."
return
+4 -4
View File
@@ -300,12 +300,12 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
if(checkoutperiod < 1)
checkoutperiod = 1
if(href_list["editbook"])
buffer_book = sanitize(copytext(input("Enter the book's title:") as text|null,1,MAX_MESSAGE_LEN))
buffer_book = sanitizeSafe(input("Enter the book's title:") as text|null)
if(href_list["editmob"])
buffer_mob = sanitize(copytext(input("Enter the recipient's name:") as text|null,1,MAX_NAME_LEN))
buffer_mob = sanitize(input("Enter the recipient's name:") as text|null, MAX_NAME_LEN)
if(href_list["checkout"])
var/datum/borrowbook/b = new /datum/borrowbook
b.bookname = sanitize(buffer_book)
b.bookname = sanitizeSafe(buffer_book)
b.mobname = sanitize(buffer_mob)
b.getdate = world.time
b.duedate = world.time + (checkoutperiod * 600)
@@ -317,7 +317,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
var/obj/item/weapon/book/b = locate(href_list["delbook"])
inventory.Remove(b)
if(href_list["setauthor"])
var/newauthor = sanitize(copytext(input("Enter the author's name: ") as text|null,1,MAX_MESSAGE_LEN))
var/newauthor = sanitize(input("Enter the author's name: ") as text|null)
if(newauthor)
scanner.cache.author = newauthor
if(href_list["setcategory"])
+88 -121
View File
@@ -14,7 +14,6 @@
var/supported = 0
var/active = 0
var/list/resource_field = list()
var/open = 0
var/ore_types = list(
"iron" = /obj/item/weapon/ore/iron,
@@ -30,10 +29,10 @@
)
//Upgrades
var/obj/item/weapon/stock_parts/matter_bin/storage
var/obj/item/weapon/stock_parts/micro_laser/cutter
var/obj/item/weapon/stock_parts/capacitor/cellmount
var/obj/item/weapon/cell/cell
var/harvest_speed
var/capacity
var/charge_use
var/obj/item/weapon/cell/cell = null
//Flags
var/need_update_field = 0
@@ -43,13 +42,14 @@
..()
storage = new(src)
cutter = new(src)
cellmount = new(src)
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/miningdrill(src)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
component_parts += new /obj/item/weapon/cell/high(src)
cell = new(src)
cell.maxcharge = 10000
cell.charge = cell.maxcharge
RefreshParts()
/obj/machinery/mining/drill/process()
@@ -74,11 +74,11 @@
return
//Drill through the flooring, if any.
if(istype(get_turf(src),/turf/simulated/floor/plating/airless/asteroid))
if(istype(get_turf(src), /turf/simulated/floor/plating/airless/asteroid))
var/turf/simulated/floor/plating/airless/asteroid/T = get_turf(src)
if(!T.dug)
T.gets_dug()
else if(istype(get_turf(src),/turf/simulated/floor))
else if(istype(get_turf(src), /turf/simulated/floor))
var/turf/simulated/floor/T = get_turf(src)
T.ex_act(2.0)
@@ -94,20 +94,20 @@
if(!harvesting) return
var/total_harvest = get_harvest_capacity() //Ore harvest-per-tick.
var/total_harvest = harvest_speed //Ore harvest-per-tick.
var/found_resource = 0 //If this doesn't get set, the area is depleted and the drill errors out.
for(var/metal in ore_types)
if(contents.len >= get_storage_capacity())
if(contents.len >= capacity)
system_error("insufficient storage space")
active = 0
need_player_check = 1
update_icon()
return
if(contents.len + total_harvest >= get_storage_capacity())
total_harvest = get_storage_capacity() - contents.len
if(contents.len + total_harvest >= capacity)
total_harvest = capacity - contents.len
if(total_harvest <= 0) break
if(harvesting.resources[metal])
@@ -124,7 +124,7 @@
create_ore = harvesting.resources[metal]
harvesting.resources[metal] = 0
for(var/i=1,i<=create_ore,i++)
for(var/i=1, i <= create_ore, i++)
var/oretype = ore_types[metal]
new oretype(src)
@@ -140,93 +140,56 @@
/obj/machinery/mining/drill/attack_ai(var/mob/user as mob)
return src.attack_hand(user)
/obj/machinery/mining/drill/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/screwdriver))
if(active) return
open = !open
user << "\blue You [open ? "open" : "close"] the maintenance panel." //TODO: Sprite.
/obj/machinery/mining/drill/attackby(obj/item/O as obj, mob/user as mob)
if(!active)
if(default_deconstruction_screwdriver(user, O))
return
if(default_deconstruction_crowbar(user, O))
return
if(default_part_replacement(user, O))
return
if(!panel_open || active) return ..()
if(istype(O, /obj/item/weapon/cell))
if(cell)
user << "The drill already has a cell installed."
else
user.drop_item()
O.loc = src
cell = O
component_parts += O
user << "You install \the [O]."
return
else
if(!open || active) return ..()
if(istype(W,/obj/item/weapon/crowbar))
if(cell)
user << "You pry out \the [cell]."
cell.loc = get_turf(src)
cell = null
else if(storage)
user << "You slip the bolt and pry out \the [storage]."
storage.loc = get_turf(src)
storage = null
else if(cutter)
user << "You carefully detatch and pry out \the [cutter]."
cutter.loc = get_turf(src)
cutter = null
else if(cellmount)
user << "You yank out a few wires and pry out \the [cellmount]."
cellmount.loc = get_turf(src)
cellmount = null
else
user << "There's nothing inside the drilling rig to remove."
return
else if(istype(W,/obj/item/weapon/stock_parts/matter_bin))
if(storage)
user << "The drill already has a matter bin installed."
else
user.drop_item()
W.loc = src
storage = W
user << "You install \the [W]."
return
else if(istype(W,/obj/item/weapon/stock_parts/micro_laser))
if(cutter)
user << "The drill already has a cutting head installed."
else
user.drop_item()
W.loc = src
cutter = W
user << "You install \the [W]."
return
else if(istype(W,/obj/item/weapon/stock_parts/capacitor))
if(cellmount)
user << "The drill already has a cell capacitor installed."
else
user.drop_item()
W.loc = src
cellmount = W
user << "You install \the [W]."
return
else if(istype(W,/obj/item/weapon/cell))
if(cell)
user << "The drill already has a cell installed."
else
user.drop_item()
W.loc = src
cell = W
user << "You install \the [W]."
return
..()
/obj/machinery/mining/drill/attack_hand(mob/user as mob)
check_supports()
if(need_player_check)
if (panel_open && cell)
user << "You take out \the [cell]."
cell.loc = get_turf(user)
component_parts -= cell
cell = null
return
else if(need_player_check)
user << "You hit the manual override and reset the drill's error checking."
need_player_check = 0
if(anchored) get_resource_field()
if(anchored)
get_resource_field()
update_icon()
return
else if(supported)
else if(supported && !panel_open)
if(use_cell_power())
active = !active
if(active)
user << "\blue You engage \the [src] and it lurches downwards, grinding noisily."
visible_message("<span class='notice'>\The [src] lurches downwards, grinding noisily.</span>")
need_update_field = 1
else
user << "\blue You disengage \the [src] and it shudders to a grinding halt."
visible_message("<span class='notice'>\The [src] shudders to a grinding halt.</span>")
else
user << "\blue The drill is unpowered."
user << "<span class='notice'>The drill is unpowered.</span>"
else
user << "\blue Turning on a piece of industrial machinery without sufficient bracing is a bad idea."
user << "<span class='notice'>Turning on a piece of industrial machinery without sufficient bracing or wires exposed is a bad idea.</span>"
update_icon()
@@ -241,6 +204,21 @@
icon_state = "mining_drill"
return
/obj/machinery/mining/drill/RefreshParts()
..()
harvest_speed = 0
capacity = 0
charge_use = 50
for(var/obj/item/weapon/stock_parts/P in component_parts)
if(istype(P, /obj/item/weapon/stock_parts/micro_laser))
harvest_speed = P.rating
if(istype(P, /obj/item/weapon/stock_parts/matter_bin))
capacity = 200 * P.rating
if(istype(P, /obj/item/weapon/stock_parts/capacitor))
charge_use -= 10 * P.rating
cell = locate(/obj/item/weapon/cell) in component_parts
/obj/machinery/mining/drill/proc/check_supports()
supported = 0
@@ -259,20 +237,12 @@
/obj/machinery/mining/drill/proc/system_error(var/error)
if(error) src.visible_message("\red \The [src] flashes a '[error]' warning.")
if(error)
src.visible_message("<span class='notice'>\The [src] flashes a '[error]' warning.</span>")
need_player_check = 1
active = 0
update_icon()
/obj/machinery/mining/drill/proc/get_harvest_capacity()
return (cutter ? cutter.rating : 0)
/obj/machinery/mining/drill/proc/get_storage_capacity()
return 200 * (storage ? storage.rating : 0)
/obj/machinery/mining/drill/proc/get_charge_use()
return 50 - (10 * (cellmount ? cellmount.rating : 0))
/obj/machinery/mining/drill/proc/get_resource_field()
resource_field = list()
@@ -281,13 +251,13 @@
var/turf/T = get_turf(src)
if(!istype(T)) return
var/tx = T.x-2
var/ty = T.y-2
var/tx = T.x - 2
var/ty = T.y - 2
var/turf/mine_turf
for(var/iy=0,iy<5,iy++)
for(var/ix=0,ix<5,ix++)
mine_turf = locate(tx+ix,ty+iy,T.z)
if(mine_turf && istype(mine_turf) && mine_turf.has_resources)
for(var/iy = 0,iy < 5, iy++)
for(var/ix = 0, ix < 5, ix++)
mine_turf = locate(tx + ix, ty + iy, T.z)
if(mine_turf && mine_turf.has_resources)
resource_field += mine_turf
if(!resource_field.len)
@@ -295,9 +265,8 @@
/obj/machinery/mining/drill/proc/use_cell_power()
if(!cell) return 0
var/req = get_charge_use()
if(cell.charge >= req)
cell.use(req)
if(cell.charge >= charge_use)
cell.use(charge_use)
return 1
return 0
@@ -312,9 +281,9 @@
if(B)
for(var/obj/item/weapon/ore/O in contents)
O.loc = B
usr << "\red You unload the drill's storage cache into the ore box."
usr << "<span class='notice'>You unload the drill's storage cache into the ore box.</span>"
else
usr << "\red You must move an ore box up to the drill before you can unload it."
usr << "<span class='notice'>You must move an ore box up to the drill before you can unload it.</span>"
/obj/machinery/mining/brace
@@ -326,16 +295,16 @@
/obj/machinery/mining/brace/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/wrench))
if(istype(get_turf(src),/turf/space))
user << "\blue You can't anchor something to empty space. Idiot."
if(istype(get_turf(src), /turf/space))
user << "<span class='notice'>You can't anchor something to empty space. Idiot.</span>"
return
if(connected && connected.active)
user << "\blue You can't unanchor the brace of a running drill!"
user << "<span class='notice'>You can't unanchor the brace of a running drill!</span>"
return
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user << "\blue You [anchored ? "un" : ""]anchor the brace."
user << "<span class='notice'>You [anchored ? "un" : ""]anchor the brace.</span>"
anchored = !anchored
if(anchored)
@@ -347,18 +316,16 @@
var/turf/T = get_step(get_turf(src), src.dir)
if(!T.has_resources)
src.visible_message("\red The terrain near the brace is unsuitable!")
return
for(var/thing in T.contents)
if(istype(thing,/obj/machinery/mining/drill))
if(istype(thing, /obj/machinery/mining/drill))
connected = thing
break
if(!connected) return
if(!connected)
return
if(!connected.supports) connected.supports = list()
if(!connected.supports)
connected.supports = list()
icon_state = "mining_brace_active"
+11 -16
View File
@@ -5,16 +5,13 @@
icon_state = "forensic0-old" //GET A BETTER SPRITE.
item_state = "electronic"
matter = list("metal" = 150)
origin_tech = "magnets=1;engineering=1"
/obj/item/weapon/mining_scanner/attack_self(mob/user as mob)
user << "You begin sweeping \the [src] about, scanning for metal deposits."
if(!do_after(user,50)) return
if(!user || !src) return
if(!do_after(user, 50))
return
var/list/metals = list(
"surface minerals" = 0,
@@ -23,32 +20,30 @@
"exotic matter" = 0
)
for(var/turf/T in range(3,get_turf(user)))
for(var/turf/T in range(2, get_turf(user)))
if(!T.has_resources)
continue
for(var/metal in T.resources)
var/ore_type
switch(metal)
if("silicates" || "carbonaceous rock" || "iron") ore_type = "surface minerals"
if("gold" || "silver" || "diamond") ore_type = "precious metals"
if("uranium") ore_type = "nuclear fuel"
if("phoron" || "osmium" || "hydrogen") ore_type = "exotic matter"
if("silicates", "carbonaceous rock", "iron") ore_type = "surface minerals"
if("gold", "silver", "diamond") ore_type = "precious metals"
if("uranium") ore_type = "nuclear fuel"
if("phoron", "osmium", "hydrogen") ore_type = "exotic matter"
if(ore_type) metals[ore_type] += T.resources[metal]
user << "\icon[src] \blue The scanner beeps and displays a readout."
user << "\icon[src] <span class='notice'>The scanner beeps and displays a readout.</span>"
for(var/ore_type in metals)
var/result = "no sign"
switch(metals[ore_type])
if(1 to 50) result = "trace amounts"
if(51 to 150) result = "significant amounts"
if(151 to INFINITY) result = "huge quantities"
if(1 to 25) result = "trace amounts"
if(26 to 75) result = "significant amounts"
if(76 to INFINITY) result = "huge quantities"
user << "- [result] of [ore_type]."
+4 -5
View File
@@ -229,8 +229,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
//world << "DEBUG: ticker not null"
if(ticker.mode.name == "AI malfunction")
//world << "DEBUG: malf mode ticker test"
if(ticker.mode:malf_mode_declared)
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
if(malf.revealed)
stat(null, "Time left: [max(malf.hack_time/(malf.hacked_apcs.len/3), 0)]")
if(emergency_shuttle)
var/eta_status = emergency_shuttle.get_status_panel_eta()
if(eta_status)
@@ -492,8 +492,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/ghosts_can_write
if(ticker.mode.name == "cult")
var/datum/game_mode/cult/C = ticker.mode
if(C.cult.len > config.cult_ghostwriter_req_cultists)
if(cult.current_antagonists.len > config.cult_ghostwriter_req_cultists)
ghosts_can_write = 1
if(!ghosts_can_write)
@@ -534,7 +533,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/max_length = 50
var/message = stripped_input(src,"Write a message. It cannot be longer than [max_length] characters.","Blood writing", "")
var/message = sanitize(input("Write a message. It cannot be longer than [max_length] characters.","Blood writing", ""))
if (message)
+2 -2
View File
@@ -1,5 +1,5 @@
/mob/dead/observer/say(var/message)
message = strip_html_properly(message)
message = sanitize(message)
if (!message)
return
@@ -18,7 +18,7 @@
/mob/dead/observer/emote(var/act, var/type, var/message)
message = trim_strip_html_properly(message)
message = sanitize(message)
if(!message)
return
+2 -2
View File
@@ -12,7 +12,7 @@
var/input
if(!message)
input = sanitize(copytext(input(src,"Choose an emote to display.") as text|null,1,MAX_MESSAGE_LEN))
input = sanitize(input(src,"Choose an emote to display.") as text|null)
else
input = message
if(input)
@@ -108,7 +108,7 @@
var/input
if(!message)
input = sanitize(copytext(input(src, "Choose an emote to display.") as text|null, 1, MAX_MESSAGE_LEN))
input = sanitize(input(src, "Choose an emote to display.") as text|null)
else
input = message
+146
View File
@@ -0,0 +1,146 @@
#define UPDATE_BUFFER 25 // 2.5 seconds
// CHUNK
//
// A 16x16 grid of the map with a list of turfs that can be seen, are visible and are dimmed.
// Allows the Eye to stream these chunks and know what it can and cannot see.
/datum/obfuscation
var/icon = 'icons/effects/cameravis.dmi'
var/icon_state = "black"
/datum/chunk
var/list/obscuredTurfs = list()
var/list/visibleTurfs = list()
var/list/obscured = list()
var/list/turfs = list()
var/list/seenby = list()
var/visible = 0
var/changed = 0
var/updating = 0
var/x = 0
var/y = 0
var/z = 0
var/datum/obfuscation/obfuscation = new()
// Add an eye to the chunk, then update if changed.
/datum/chunk/proc/add(mob/eye/eye)
if(!eye.owner)
return
eye.visibleChunks += src
if(eye.owner.client)
eye.owner.client.images += obscured
visible++
seenby += eye
if(changed && !updating)
update()
// Remove an eye from the chunk, then update if changed.
/datum/chunk/proc/remove(mob/eye/eye)
if(!eye.owner)
return
eye.visibleChunks -= src
if(eye.owner.client)
eye.owner.client.images -= obscured
seenby -= eye
if(visible > 0)
visible--
// Called when a chunk has changed. I.E: A wall was deleted.
/datum/chunk/proc/visibilityChanged(turf/loc)
if(!visibleTurfs[loc])
return
hasChanged()
// Updates the chunk, makes sure that it doesn't update too much. If the chunk isn't being watched it will
// instead be flagged to update the next time an AI Eye moves near it.
/datum/chunk/proc/hasChanged(var/update_now = 0)
if(visible || update_now)
if(!updating)
updating = 1
spawn(UPDATE_BUFFER) // Batch large changes, such as many doors opening or closing at once
update()
updating = 0
else
changed = 1
// The actual updating.
/datum/chunk/proc/update()
set background = 1
var/list/newVisibleTurfs = new()
acquireVisibleTurfs(newVisibleTurfs)
// Removes turf that isn't in turfs.
newVisibleTurfs &= turfs
var/list/visAdded = newVisibleTurfs - visibleTurfs
var/list/visRemoved = visibleTurfs - newVisibleTurfs
visibleTurfs = newVisibleTurfs
obscuredTurfs = turfs - newVisibleTurfs
for(var/turf in visAdded)
var/turf/t = turf
if(t.obfuscations[obfuscation.type])
obscured -= t.obfuscations[obfuscation.type]
for(var/eye in seenby)
var/mob/eye/m = eye
if(!m || !m.owner)
continue
if(m.owner.client)
m.owner.client.images -= t.obfuscations[obfuscation.type]
for(var/turf in visRemoved)
var/turf/t = turf
if(obscuredTurfs[t])
if(!t.obfuscations[obfuscation.type])
t.obfuscations[obfuscation.type] = image(obfuscation.icon, t, obfuscation.icon_state, 15)
obscured += t.obfuscations[obfuscation.type]
for(var/eye in seenby)
var/mob/eye/m = eye
if(!m || !m.owner)
seenby -= m
continue
if(m.owner.client)
m.owner.client.images += t.obfuscations[obfuscation.type]
/datum/chunk/proc/acquireVisibleTurfs(var/list/visible)
// Create a new camera chunk, since the chunks are made as they are needed.
/datum/chunk/New(loc, x, y, z)
// 0xf = 15
x &= ~0xf
y &= ~0xf
src.x = x
src.y = y
src.z = z
for(var/turf/t in range(10, locate(x + 8, y + 8, z)))
if(t.x >= x && t.y >= y && t.x < x + 16 && t.y < y + 16)
turfs[t] = t
acquireVisibleTurfs(visibleTurfs)
// Removes turf that isn't in turfs.
visibleTurfs &= turfs
obscuredTurfs = turfs - visibleTurfs
for(var/turf in obscuredTurfs)
var/turf/t = turf
if(!t.obfuscations[obfuscation.type])
t.obfuscations[obfuscation.type] = image(obfuscation.icon, t, obfuscation.icon_state, 15)
obscured += t.obfuscations[obfuscation.type]
#undef UPDATE_BUFFER
+103
View File
@@ -0,0 +1,103 @@
// EYE
//
// A mob that another mob controls to look around the station with.
// It streams chunks as it moves around, which will show it what the controller can and cannot see.
/mob/eye
name = "Eye"
icon = 'icons/mob/eye.dmi'
icon_state = "default-eye"
alpha = 127
var/sprint = 10
var/cooldown = 0
var/acceleration = 1
see_in_dark = 7
status_flags = GODMODE
invisibility = INVISIBILITY_EYE
var/mob/owner = null
var/list/visibleChunks = list()
var/ghostimage = null
var/datum/visualnet/visualnet
/mob/eye/New()
ghostimage = image(src.icon,src,src.icon_state)
ghost_darkness_images |= ghostimage //so ghosts can see the eye when they disable darkness
ghost_sightless_images |= ghostimage //so ghosts can see the eye when they disable ghost sight
updateallghostimages()
..()
mob/eye/Del()
if (ghostimage)
ghost_darkness_images -= ghostimage
ghost_sightless_images -= ghostimage
del(ghostimage)
ghostimage = null;
updateallghostimages()
..()
// Movement code. Returns 0 to stop air movement from moving it.
/mob/eye/Move()
return 0
/mob/eye/examinate()
set popup_menu = 0
set src = usr.contents
return 0
/mob/eye/pointed()
set popup_menu = 0
set src = usr.contents
return 0
/mob/eye/examine(mob/user)
// Use this when setting the eye's location.
// It will also stream the chunk that the new loc is in.
/mob/eye/proc/setLoc(var/T)
if(owner)
T = get_turf(T)
loc = T
if(owner.client)
owner.client.eye = src
visualnet.visibility(src)
return 1
return 0
/mob/eye/EyeMove(n, direct)
var/initial = initial(sprint)
var/max_sprint = 50
if(cooldown && cooldown < world.timeofday)
sprint = initial
for(var/i = 0; i < max(sprint, initial); i += 20)
var/turf/step = get_turf(get_step(src, direct))
if(step)
setLoc(step)
cooldown = world.timeofday + 5
if(acceleration)
sprint = min(sprint + 0.5, max_sprint)
else
sprint = initial
/mob/eye/proc/getLoc()
if(owner)
if(!isturf(owner.loc) || !owner.client)
return
return loc
/mob
var/mob/eye/eyeobj
/mob/proc/EyeMove(n, direct)
if(!eyeobj)
return
return eyeobj.EyeMove(n, direct)
@@ -0,0 +1,53 @@
//UPDATE TRIGGERS, when the chunk (and the surrounding chunks) should update.
// TURFS
/proc/updateVisibility(atom/A, var/opacity_check = 1)
if(ticker)
for(var/datum/visualnet/VN in visual_nets)
VN.updateVisibility(A, opacity_check)
/turf
var/list/image/obfuscations = new()
/turf/drain_power()
return -1
/turf/simulated/Del()
updateVisibility(src)
..()
/turf/simulated/New()
..()
updateVisibility(src)
// STRUCTURES
/obj/structure/Del()
updateVisibility(src)
..()
/obj/structure/New()
..()
updateVisibility(src)
// EFFECTS
/obj/effect/Del()
updateVisibility(src)
..()
/obj/effect/New()
..()
updateVisibility(src)
// DOORS
// Simply updates the visibility of the area when it opens/closes/destroyed.
/obj/machinery/door/update_nearby_tiles(need_rebuild)
. = ..(need_rebuild)
// Glass door glass = 1
// don't check then?
if(!glass)
updateVisibility(src, 0)
+133
View File
@@ -0,0 +1,133 @@
// VISUAL NET
//
// The datum containing all the chunks.
var/global/list/visual_nets = new()
/datum/visualnet
// The chunks of the map, mapping the areas that an object can see.
var/list/chunks = list()
var/ready = 0
var/chunk_type = /datum/chunk
/datum/visualnet/New()
..()
visual_nets += src
/datum/visualnet/Del()
visual_nets -= src
..()
// Checks if a chunk has been Generated in x, y, z.
/datum/visualnet/proc/chunkGenerated(x, y, z)
x &= ~0xf
y &= ~0xf
var/key = "[x],[y],[z]"
return (chunks[key])
// Returns the chunk in the x, y, z.
// If there is no chunk, it creates a new chunk and returns that.
/datum/visualnet/proc/getChunk(x, y, z)
x &= ~0xf
y &= ~0xf
var/key = "[x],[y],[z]"
if(!chunks[key])
chunks[key] = new chunk_type(null, x, y, z)
return chunks[key]
// Updates what the aiEye can see. It is recommended you use this when the aiEye moves or it's location is set.
/datum/visualnet/proc/visibility(mob/eye/eye)
// 0xf = 15
var/x1 = max(0, eye.x - 16) & ~0xf
var/y1 = max(0, eye.y - 16) & ~0xf
var/x2 = min(world.maxx, eye.x + 16) & ~0xf
var/y2 = min(world.maxy, eye.y + 16) & ~0xf
var/list/visibleChunks = list()
for(var/x = x1; x <= x2; x += 16)
for(var/y = y1; y <= y2; y += 16)
visibleChunks += getChunk(x, y, eye.z)
var/list/remove = eye.visibleChunks - visibleChunks
var/list/add = visibleChunks - eye.visibleChunks
for(var/chunk in remove)
var/datum/chunk/c = chunk
c.remove(eye)
for(var/chunk in add)
var/datum/chunk/c = chunk
c.add(eye)
// Updates the chunks that the turf is located in. Use this when obstacles are destroyed or when doors open.
/datum/visualnet/proc/updateVisibility(atom/A, var/opacity_check = 1)
if(!ticker || (opacity_check && !A.opacity))
return
majorChunkChange(A, 2)
/datum/visualnet/proc/updateChunk(x, y, z)
// 0xf = 15
if(!chunkGenerated(x, y, z))
return
var/datum/chunk/chunk = getChunk(x, y, z)
chunk.hasChanged()
// Never access this proc directly!!!!
// This will update the chunk and all the surrounding chunks.
// It will also add the atom to the cameras list if you set the choice to 1.
// Setting the choice to 0 will remove the camera from the chunks.
// If you want to update the chunks around an object, without adding/removing a camera, use choice 2.
/datum/visualnet/proc/majorChunkChange(atom/c, var/choice)
// 0xf = 15
if(!c)
return
var/turf/T = get_turf(c)
if(T)
var/x1 = max(0, T.x - 8) & ~0xf
var/y1 = max(0, T.y - 8) & ~0xf
var/x2 = min(world.maxx, T.x + 8) & ~0xf
var/y2 = min(world.maxy, T.y + 8) & ~0xf
//world << "X1: [x1] - Y1: [y1] - X2: [x2] - Y2: [y2]"
for(var/x = x1; x <= x2; x += 16)
for(var/y = y1; y <= y2; y += 16)
if(chunkGenerated(x, y, T.z))
var/datum/chunk/chunk = getChunk(x, y, T.z)
onMajorChunkChange(c, choice, chunk)
chunk.hasChanged()
/datum/visualnet/proc/onMajorChunkChange(atom/c, var/choice, var/datum/chunk/chunk)
// Will check if a mob is on a viewable turf. Returns 1 if it is, otherwise returns 0.
/datum/visualnet/proc/checkVis(mob/living/target as mob)
// 0xf = 15
var/turf/position = get_turf(target)
return checkTurfVis(position)
/datum/visualnet/proc/checkTurfVis(var/turf/position)
var/datum/chunk/chunk = getChunk(position.x, position.y, position.z)
if(chunk)
if(chunk.changed)
chunk.hasChanged(1) // Update now, no matter if it's visible or not.
if(chunk.visibleTurfs[position])
return 1
return 0
// Debug verb for VVing the chunk that the turf is in.
/*
/turf/verb/view_chunk()
set src in world
if(cameranet.chunkGenerated(x, y, z))
var/datum/chunk/chunk = cameranet.getCameraChunk(x, y, z)
usr.client.debug_variables(chunk)
*/
+4 -6
View File
@@ -83,21 +83,19 @@
/obj/item/weapon/holder/monkey
name = "monkey"
desc = "It's a monkey. Ook."
icon_state = "cat"
icon = 'icons/mob/monkey.dmi'
icon_state = "monkey1"
icon_state = "monkey"
/obj/item/weapon/holder/monkey/farwa
name = "farwa"
desc = "It's a farwa."
icon_state = "tajkey1"
icon_state = "farwa"
/obj/item/weapon/holder/monkey/stok
name = "stok"
desc = "It's a stok. stok."
icon_state = "stokkey1"
icon_state = "stok"
/obj/item/weapon/holder/monkey/neaera
name = "neaera"
desc = "It's a neaera."
icon_state = "skrellkey1"
icon_state = "neara"
+22
View File
@@ -0,0 +1,22 @@
/datum/language/human/monkey
name = "Chimpanzee"
desc = "Ook ook ook."
speech_verb = "chimpers"
ask_verb = "chimpers"
exclaim_verb = "screeches"
key = "6"
/datum/language/skrell/monkey
name = "Neara"
desc = "Squik squik squik."
key = "8"
/datum/language/unathi/monkey
name = "Stok"
desc = "Hiss hiss hiss."
key = "7"
/datum/language/tajaran/monkey
name = "Farwa"
desc = "Meow meow meow."
key = "9"
+1 -1
View File
@@ -7,7 +7,7 @@
src << "\red You cannot speak in IC (Muted)."
return
message = trim_strip_html_properly(message)
message = sanitize(message)
if(stat == 2)
return say_dead(message)
+1 -1
View File
@@ -32,5 +32,5 @@
if(istype(container, /obj/item/device/mmi/radio_enabled))
var/obj/item/device/mmi/radio_enabled/R = container
if(R.radio)
spawn(0) R.radio.hear_talk(src, trim(sanitize(message)), verb, speaking)
spawn(0) R.radio.hear_talk(src, sanitize(message), verb, speaking)
..(trim(message), speaking, verb)
@@ -65,8 +65,6 @@
if(ticker && ticker.mode)
sql_report_death(src)
ticker.mode.check_win()
if(istype(ticker.mode,/datum/game_mode/heist))
vox_kills++ //Bad vox. Shouldn't be killing humans.
return ..(gibbed,species.death_message)
@@ -50,7 +50,7 @@
m_type = 1
if ("custom")
var/input = sanitize(copytext(input("Choose an emote to display.") as text|null,1,MAX_MESSAGE_LEN))
var/input = sanitize(input("Choose an emote to display.") as text|null)
if (!input)
return
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
@@ -577,7 +577,7 @@
set desc = "Sets a description which will be shown when someone examines you."
set category = "IC"
pose = sanitize(copytext(input(usr, "This is [src]. \He is...", "Pose", null) as text, 1, MAX_MESSAGE_LEN))
pose = sanitize(input(usr, "This is [src]. \He is...", "Pose", null) as text)
/mob/living/carbon/human/verb/set_flavor()
set name = "Set Flavour Text"
@@ -242,7 +242,7 @@
if(getBrainLoss() >= 60)
msg += "[t_He] [t_has] a stupid expression on [t_his] face.\n"
if((!species.has_organ["brain"] || has_brain()) && stat != DEAD)
if(species.show_ssd && (!species.has_organ["brain"] || has_brain()) && stat != DEAD)
if(!key)
msg += "<span class='deadsay'>[t_He] [t_is] fast asleep. It doesn't look like they are waking up anytime soon.</span>\n"
else if(!client)
+8 -13
View File
@@ -48,8 +48,8 @@
stat(null, "Intent: [a_intent]")
stat(null, "Move Mode: [m_intent]")
if(ticker && ticker.mode && ticker.mode.name == "AI malfunction")
if(ticker.mode:malf_mode_declared)
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
if(malf.revealed)
stat(null, "Time left: [max(malf.hack_time/(malf.hacked_apcs/3), 0)]")
if(emergency_shuttle)
var/eta_status = emergency_shuttle.get_status_panel_eta()
if(eta_status)
@@ -196,6 +196,7 @@
var/datum/organ/external/affected = M.organs_by_name["head"]
affected.implants += L
L.part = affected
L.implanted(src)
/mob/living/carbon/human/proc/is_loyalty_implanted(mob/living/carbon/human/M)
for(var/L in M.contents)
@@ -500,7 +501,7 @@
for (var/datum/data/record/R in data_core.security)
if (R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
var/t1 = sanitize(copytext(input("Add Comment:", "Sec. records", null, null) as message,1,MAX_MESSAGE_LEN))
var/t1 = sanitize(input("Add Comment:", "Sec. records", null, null) as message)
if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"security")) )
return
var/counter = 1
@@ -629,7 +630,7 @@
for (var/datum/data/record/R in data_core.medical)
if (R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
var/t1 = sanitize(copytext(input("Add Comment:", "Med. records", null, null) as message,1,MAX_MESSAGE_LEN))
var/t1 = sanitize(input("Add Comment:", "Med. records", null, null) as message)
if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"medical")) )
return
var/counter = 1
@@ -656,17 +657,11 @@
src << browse(null, "window=flavor_changes")
return
if("general")
var/msg = input(usr,"Update the general description of your character. This will be shown regardless of clothing, and may include OOC notes and preferences.","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]])) as message
if(msg != null)
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
msg = html_encode(msg)
var/msg = sanitize(input(usr,"Update the general description of your character. This will be shown regardless of clothing, and may include OOC notes and preferences.","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]])) as message, extra = 0)
flavor_texts[href_list["flavor_change"]] = msg
return
else
var/msg = input(usr,"Update the flavor text for your [href_list["flavor_change"]].","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]])) as message
if(msg != null)
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
msg = html_encode(msg)
var/msg = sanitize(input(usr,"Update the flavor text for your [href_list["flavor_change"]].","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]])) as message, extra = 0)
flavor_texts[href_list["flavor_change"]] = msg
set_flavor()
return
@@ -1204,7 +1199,7 @@
var/max_length = bloody_hands * 30 //tweeter style
var/message = stripped_input(src,"Write a message. It cannot be longer than [max_length] characters.","Blood writing", "")
var/message = sanitize(input("Write a message. It cannot be longer than [max_length] characters.","Blood writing", ""))
if (message)
var/used_blood_amount = round(length(message) / 30, 1)
@@ -251,9 +251,6 @@ emp_act
if(prob(I.force))
apply_effect(20, PARALYZE, armor)
visible_message("\red <B>[src] has been knocked unconscious!</B>")
if(src != user && I.damtype == BRUTE)
ticker.mode.remove_revolutionary(mind)
if(bloody)//Apply blood
if(wear_mask)
wear_mask.add_blood(src)
@@ -372,13 +369,13 @@ emp_act
var/obj/item/I = O
mass = I.w_class/THROWNOBJ_KNOCKBACK_DIVISOR
var/momentum = speed*mass
if(O.throw_source && momentum >= THROWNOBJ_KNOCKBACK_SPEED)
var/dir = get_dir(O.throw_source, src)
visible_message("\red [src] staggers under the impact!","\red You stagger under the impact!")
src.throw_at(get_edge_target_turf(src,dir),1,momentum)
if(!O || !src) return
if(O.loc == src && O.sharp) //Projectile is embedded and suitable for pinning.
@@ -392,7 +389,7 @@ emp_act
/mob/living/carbon/human/embed(var/obj/O, var/def_zone=null)
if(!def_zone) ..()
var/datum/organ/external/affecting = get_organ(def_zone)
if(affecting)
affecting.embed(O)
@@ -175,7 +175,7 @@
text = input("What would you like to say?", "Speak to creature", null, null)
text = trim(sanitize(copytext(text, 1, MAX_MESSAGE_LEN)))
text = sanitize(text)
if(!text) return
@@ -213,7 +213,7 @@
set desc = "Whisper silently to someone over a distance."
set category = "Abilities"
var/msg = sanitize(copytext(input("Message:", "Psychic Whisper") as text|null, 1, MAX_MESSAGE_LEN))
var/msg = sanitize(input("Message:", "Psychic Whisper") as text|null)
if(msg)
log_say("PsychicWhisper: [key_name(src)]->[M.key] : [msg]")
M << "\green You hear a strange, alien voice in your head... \italic [msg]"
@@ -1,7 +1,3 @@
// These may have some say.dm bugs regarding understanding common,
// might be worth adapting the bugs into a feature and using these
// subtypes as a basis for non-common-speaking alien foreigners. ~ Z
/mob/living/carbon/human/dummy
real_name = "Test Dummy"
status_flags = GODMODE|CANPUSH
@@ -31,4 +27,16 @@
/mob/living/carbon/human/machine/New(var/new_loc)
h_style = "blue IPC screen"
..(new_loc, "Machine")
..(new_loc, "Machine")
/mob/living/carbon/human/monkey/New(var/new_loc)
..(new_loc, "Monkey")
/mob/living/carbon/human/farwa/New(var/new_loc)
..(new_loc, "Farwa")
/mob/living/carbon/human/neara/New(var/new_loc)
..(new_loc, "Neara")
/mob/living/carbon/human/stok/New(var/new_loc)
..(new_loc, "Stok")
@@ -351,10 +351,6 @@ This saves us from having to call add_fingerprint() any time something is put in
name = "human"
var/mob/living/carbon/human/target = null
/obj/effect/equip_e/monkey
name = "monkey"
var/mob/living/carbon/monkey/target = null
/obj/effect/equip_e/process()
return
@@ -100,6 +100,9 @@
handle_heartbeat()
if(!client)
species.handle_npc(src)
handle_stasis_bag()
if(life_tick > 5 && timeofdeath && (timeofdeath < 5 || world.time - timeofdeath > 6000)) //We are long dead, or we're junk mobs spawned like the clowns on the clown shuttle
@@ -1342,6 +1345,12 @@
if(machine)
if(!machine.check_eye(src))
reset_view(null)
else if(eyeobj)
if(eyeobj.owner != src)
reset_view(null)
else
src.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
else
var/isRemoteObserve = 0
if((mRemote in mutations) && remoteview_target)
@@ -1,6 +1,5 @@
/mob/living/carbon/human/Login()
..()
update_hud()
ticker.mode.update_all_synd_icons() //This proc only sounds CPU-expensive on paper. It is O(n^2), but the outer for-loop only iterates through syndicates, which are only prsenet in nuke rounds and even when they exist, there's usually 6 of them.
if(species) species.handle_login_special(src)
return
@@ -0,0 +1,13 @@
/obj/item/clothing/under/punpun
name = "fancy uniform"
desc = "It looks like it was tailored for a monkey."
icon_state = "punpun"
item_color = "punpun"
species_restricted = list("Monkey")
/mob/living/carbon/human/monkey/punpun/New()
..()
spawn(1)
name = "Pun Pun"
real_name = name
w_uniform = new /obj/item/clothing/under/punpun(src)
+1 -1
View File
@@ -10,7 +10,7 @@
src << "\red You cannot speak in IC (Muted)."
return
message = trim_strip_html_properly(message)
message = sanitize(message)
if(stat)
if(stat == 2)
@@ -12,6 +12,12 @@
// Icon/appearance vars.
var/icobase = 'icons/mob/human_races/r_human.dmi' // Normal icon set.
var/deform = 'icons/mob/human_races/r_def_human.dmi' // Mutated icon set.
// Damage overlay and masks.
var/damage_overlays = 'icons/mob/human_races/masks/dam_human.dmi'
var/damage_mask = 'icons/mob/human_races/masks/dam_mask_human.dmi'
var/blood_mask = 'icons/mob/human_races/masks/blood_human.dmi'
var/prone_icon // If set, draws this from icobase when mob is prone.
var/eyes = "eyes_s" // Icon for eyes.
var/blood_color = "#A10808" // Red.
@@ -20,6 +26,8 @@
var/tail // Name of tail image in species effects icon file.
var/race_key = 0 // Used for mob icon cache string.
var/icon/icon_template // Used for mob icon generation for non-32x32 species.
var/is_small
var/show_ssd = 1
// Language/culture vars.
var/default_language = "Galactic Common" // Default language is used when 'say' is used without modifiers.
@@ -40,6 +48,7 @@
var/vision_flags = 0 // Same flags as glasses.
// Death vars.
var/meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/human
var/gibber_type = /obj/effect/gibspawner/human
var/remains_type = /obj/effect/decal/remains/xeno
var/gibbed_anim = "gibbed-h"
@@ -91,7 +100,8 @@
var/darksight = 2 // Native darksight distance.
var/flags = 0 // Various specific features.
var/slowdown = 0 // Passive movement speed malus (or boost, if negative)
var/primitive // Lesser form, if any (ie. monkey for humans)
var/primitive_form // Lesser form, if any (ie. monkey for humans)
var/greater_form // Greater form, if any, ie. human for monkeys.
var/gluttonous // Can eat some mobs. 1 for monkeys, 2 for people.
var/rarity_value = 1 // Relative rarity/collector value for this species.
// Determines the organs that the species spawns with and
@@ -251,3 +261,6 @@
return 0
// Called in life() when the mob has no client.
/datum/species/proc/handle_npc(var/mob/living/carbon/human/H)
return
@@ -65,4 +65,10 @@
"storage1" = list("loc" = ui_storage1, "slot" = slot_l_store, "state" = "pocket"),
"storage2" = list("loc" = ui_storage2, "slot" = slot_r_store, "state" = "pocket"),
"belt" = list("loc" = ui_belt, "slot" = slot_belt, "state" = "belt")
)
/datum/hud_data/monkey
gear = list(
"mask" = list("loc" = ui_shoes, "slot" = slot_wear_mask, "state" = "equip", "toggle" = 1, "dir" = NORTH),
"back" = list("loc" = ui_sstore1, "slot" = slot_back, "state" = "back", "dir" = NORTH),
)
@@ -0,0 +1,88 @@
/datum/species/monkey
name = "Monkey"
name_plural = "Monkeys"
blurb = "Ook."
icobase = 'icons/mob/human_races/monkeys/r_monkey.dmi'
deform = 'icons/mob/human_races/monkeys/r_monkey.dmi'
damage_overlays = 'icons/mob/human_races/masks/dam_monkey.dmi'
damage_mask = 'icons/mob/human_races/masks/dam_mask_monkey.dmi'
blood_mask = 'icons/mob/human_races/masks/blood_monkey.dmi'
language = null
default_language = "Chimpanzee"
greater_form = "Human"
is_small = 1
has_fine_manipulation = 0
show_ssd = 0
eyes = "blank_eyes"
gibbed_anim = "gibbed-m"
dusted_anim = "dust-m"
death_message = "lets out a faint chimper as it collapses and stops moving..."
tail = "chimptail"
unarmed_types = list(/datum/unarmed_attack/bite, /datum/unarmed_attack/claws)
inherent_verbs = list(/mob/living/proc/ventcrawl)
hud_type = /datum/hud_data/monkey
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/monkey
rarity_value = 0.1
total_health = 75
brute_mod = 1.5
burn_mod = 1.5
flags = IS_RESTRICTED
/datum/species/monkey/handle_npc(var/mob/living/carbon/human/H)
if(H.stat != CONSCIOUS)
return
if(prob(33) && H.canmove && isturf(H.loc) && !H.pulledby) //won't move if being pulled
step(H, pick(cardinal))
if(prob(1))
H.emote(pick("scratch","jump","roll","tail"))
/datum/species/monkey/handle_post_spawn(var/mob/living/carbon/human/H)
H.real_name = "[lowertext(name)] ([rand(100,999)])"
H.name = H.real_name
..()
/datum/species/monkey/tajaran
name = "Farwa"
name_plural = "Farwa"
icobase = 'icons/mob/human_races/monkeys/r_farwa.dmi'
deform = 'icons/mob/human_races/monkeys/r_farwa.dmi'
greater_form = "Tajaran"
default_language = "Farwa"
flesh_color = "#AFA59E"
base_color = "#333333"
tail = "farwatail"
/datum/species/monkey/skrell
name = "Neara"
name_plural = "Neara"
icobase = 'icons/mob/human_races/monkeys/r_neara.dmi'
deform = 'icons/mob/human_races/monkeys/r_neara.dmi'
greater_form = "Skrell"
default_language = "Neara"
flesh_color = "#8CD7A3"
blood_color = "#1D2CBF"
reagent_tag = IS_SKRELL
tail = null
/datum/species/monkey/unathi
name = "Stok"
name_plural = "Stok"
icobase = 'icons/mob/human_races/monkeys/r_stok.dmi'
deform = 'icons/mob/human_races/monkeys/r_stok.dmi'
tail = "stoktail"
greater_form = "Unathi"
default_language = "Stok"
flesh_color = "#34AF10"
base_color = "#066000"
reagent_tag = IS_UNATHI
@@ -1,6 +1,7 @@
/datum/species/slime
name = "Slime"
name_plural = "slimes"
is_small = 1
icobase = 'icons/mob/human_races/r_slime.dmi'
deform = 'icons/mob/human_races/r_slime.dmi'
@@ -2,7 +2,7 @@
name = "Human"
name_plural = "Humans"
language = "Sol Common"
primitive = /mob/living/carbon/monkey
primitive_form = "Monkey"
unarmed_types = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/punch, /datum/unarmed_attack/bite)
blurb = "Humanity originated in the Sol system, and over the last five centuries has spread \
colonies across a wide swathe of space. They hold a wide range of forms and creeds.<br/><br/> \
@@ -20,7 +20,7 @@
language = "Sinta'unathi"
tail = "sogtail"
unarmed_types = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws, /datum/unarmed_attack/bite/sharp)
primitive = /mob/living/carbon/monkey/unathi
primitive_form = "Stok"
darksight = 3
gluttonous = 1
@@ -85,7 +85,7 @@
heat_level_2 = 380 //Default 400
heat_level_3 = 800 //Default 1000
primitive = /mob/living/carbon/monkey/tajara
primitive_form = "Farwa"
flags = CAN_JOIN | IS_WHITELISTED | HAS_LIPS | HAS_UNDERWEAR | HAS_SKIN_COLOR | HAS_EYE_COLOR
@@ -107,7 +107,7 @@
deform = 'icons/mob/human_races/r_def_skrell.dmi'
eyes = "skrell_eyes_s"
language = "Skrellian"
primitive = /mob/living/carbon/monkey/skrell
primitive_form = "Neara"
unarmed_types = list(/datum/unarmed_attack/punch)
blurb = "An amphibious species, Skrell come from the star system known as Qerr'Vallis, which translates to 'Star of \
the royals' or 'Light of the Crown'.<br/><br/>Skrell are a highly advanced and logical race who live under the rule \
@@ -130,7 +130,7 @@
deform = 'icons/mob/human_races/r_def_plant.dmi'
language = "Rootspeak"
unarmed_types = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/diona)
primitive = /mob/living/carbon/alien/diona
//primitive_form = "Nymph"
slowdown = 7
rarity_value = 3
hud_type = /datum/hud_data/diona
@@ -175,15 +175,6 @@ Please contact me on #coderbus IRC. ~Carn x
src.transform = M
var/global/list/damage_icon_parts = list()
proc/get_damage_icon_part(damage_state, body_part)
if(damage_icon_parts["[damage_state]/[body_part]"] == null)
var/icon/DI = new /icon('icons/mob/dam_human.dmi', damage_state) // the damage icon for whole human
// TODO: Convert dam_human.dmi to greyscale and blend in species.blood_colour here.
DI.Blend(new /icon('icons/mob/dam_mask.dmi', body_part), ICON_MULTIPLY) // mask with this organ's pixels
damage_icon_parts["[damage_state]/[body_part]"] = DI
return DI
else
return damage_icon_parts["[damage_state]/[body_part]"]
//DAMAGE OVERLAYS
//constructs damage icon for each organ from mask * damage field and saves it in our overlays_ lists
@@ -202,7 +193,7 @@ proc/get_damage_icon_part(damage_state, body_part)
previous_damage_appearance = damage_appearance
var/icon/standing = new /icon('icons/mob/dam_human.dmi', "00")
var/icon/standing = new /icon(species.damage_overlays, "00")
var/image/standing_image = new /image("icon" = standing)
@@ -211,8 +202,15 @@ proc/get_damage_icon_part(damage_state, body_part)
if(!(O.status & ORGAN_DESTROYED))
O.update_icon()
if(O.damage_state == "00") continue
var/icon/DI = get_damage_icon_part(O.damage_state, O.icon_name)
var/icon/DI
var/cache_index = "[O.damage_state]/[O.icon_name]/[species.blood_color]/[species.name]"
if(damage_icon_parts[cache_index] == null)
DI = new /icon(species.damage_overlays, O.damage_state) // the damage icon for whole human
DI.Blend(new /icon(species.damage_mask, O.icon_name), ICON_MULTIPLY) // mask with this organ's pixels
DI.Blend(species.blood_color, ICON_MULTIPLY)
damage_icon_parts[cache_index] = DI
else
DI = damage_icon_parts[cache_index]
standing_image.overlays += DI
@@ -336,7 +334,7 @@ proc/get_damage_icon_part(damage_state, body_part)
base_icon.MapColors(rgb(tone[1],0,0),rgb(0,tone[2],0),rgb(0,0,tone[3]))
//Handle husk overlay.
if(husk)
if(husk && ("overlay_husk" in icon_states(race_icon)))
var/icon/mask = new(base_icon)
var/icon/husk_over = new(race_icon,"overlay_husk")
mask.MapColors(0,0,0,1, 0,0,0,1, 0,0,0,1, 0,0,0,1, 0,0,0,0)
@@ -534,7 +532,7 @@ proc/get_damage_icon_part(damage_state, body_part)
standing.icon = 'icons/mob/uniform.dmi'
if(w_uniform.blood_DNA)
var/image/bloodsies = image("icon" = 'icons/effects/blood.dmi', "icon_state" = "uniformblood")
var/image/bloodsies = image("icon" = species.blood_mask, "icon_state" = "uniformblood")
bloodsies.color = w_uniform.blood_color
standing.overlays += bloodsies
@@ -583,14 +581,14 @@ proc/get_damage_icon_part(damage_state, body_part)
standing = image("icon" = 'icons/mob/hands.dmi', "icon_state" = "[t_state]")
if(gloves.blood_DNA)
var/image/bloodsies = image("icon" = 'icons/effects/blood.dmi', "icon_state" = "bloodyhands")
var/image/bloodsies = image("icon" = species.blood_mask, "icon_state" = "bloodyhands")
bloodsies.color = gloves.blood_color
standing.overlays += bloodsies
gloves.screen_loc = ui_gloves
overlays_standing[GLOVES_LAYER] = standing
else
if(blood_DNA)
var/image/bloodsies = image("icon" = 'icons/effects/blood.dmi', "icon_state" = "bloodyhands")
var/image/bloodsies = image("icon" = species.blood_mask, "icon_state" = "bloodyhands")
bloodsies.color = hand_blood_color
overlays_standing[GLOVES_LAYER] = bloodsies
else
@@ -659,13 +657,13 @@ proc/get_damage_icon_part(damage_state, body_part)
standing = image("icon" = 'icons/mob/feet.dmi', "icon_state" = "[shoes.icon_state]")
if(shoes.blood_DNA)
var/image/bloodsies = image("icon" = 'icons/effects/blood.dmi', "icon_state" = "shoeblood")
var/image/bloodsies = image("icon" = species.blood_mask, "icon_state" = "shoeblood")
bloodsies.color = shoes.blood_color
standing.overlays += bloodsies
overlays_standing[SHOES_LAYER] = standing
else
if(feet_blood_DNA)
var/image/bloodsies = image("icon" = 'icons/effects/blood.dmi', "icon_state" = "shoeblood")
var/image/bloodsies = image("icon" = species.blood_mask, "icon_state" = "shoeblood")
bloodsies.color = feet_blood_color
overlays_standing[SHOES_LAYER] = bloodsies
else
@@ -698,7 +696,7 @@ proc/get_damage_icon_part(damage_state, body_part)
standing = image("icon" = 'icons/mob/head.dmi', "icon_state" = "[head.icon_state]")
if(head.blood_DNA)
var/image/bloodsies = image("icon" = 'icons/effects/blood.dmi', "icon_state" = "helmetblood")
var/image/bloodsies = image("icon" = species.blood_mask, "icon_state" = "helmetblood")
bloodsies.color = head.blood_color
standing.overlays += bloodsies
@@ -760,7 +758,7 @@ proc/get_damage_icon_part(damage_state, body_part)
if(wear_suit.blood_DNA)
var/obj/item/clothing/suit/S = wear_suit
var/image/bloodsies = image("icon" = 'icons/effects/blood.dmi', "icon_state" = "[S.blood_overlay_type]blood")
var/image/bloodsies = image("icon" = species.blood_mask, "icon_state" = "[S.blood_overlay_type]blood")
bloodsies.color = wear_suit.blood_color
standing.overlays += bloodsies
@@ -796,7 +794,7 @@ proc/get_damage_icon_part(damage_state, body_part)
standing = image("icon" = 'icons/mob/mask.dmi', "icon_state" = "[wear_mask.icon_state]")
if( !istype(wear_mask, /obj/item/clothing/mask/smokable/cigarette) && wear_mask.blood_DNA )
var/image/bloodsies = image("icon" = 'icons/effects/blood.dmi', "icon_state" = "maskblood")
var/image/bloodsies = image("icon" = species.blood_mask, "icon_state" = "maskblood")
bloodsies.color = wear_mask.blood_color
standing.overlays += bloodsies
overlays_standing[FACEMASK_LAYER] = standing
@@ -6,7 +6,7 @@
usr << "\red Speech is currently admin-disabled."
return
message = trim_strip_html_properly(message)
message = sanitize(message)
log_whisper("[src.name]/[src.key] : [message]")
if (src.client)
@@ -146,7 +146,7 @@
pet.colour = "[M.colour]"
user <<"You feed the slime the potion, removing it's powers and calming it."
del(M)
var/newname = sanitize(copytext(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text,1,MAX_NAME_LEN))
var/newname = sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text, MAX_NAME_LEN)
if (!newname)
newname = "pet slime"
@@ -177,7 +177,7 @@
pet.colour = "[M.colour]"
user <<"You feed the slime the potion, removing it's powers and calming it."
del(M)
var/newname = sanitize(copytext(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text,1,MAX_NAME_LEN))
var/newname = sanitize(input(user, "Would you like to give the slime a name?", "Name your new pet", "pet slime") as null|text, MAX_NAME_LEN)
if (!newname)
newname = "pet slime"
@@ -248,7 +248,7 @@
Target = C
break
if(isalien(C) || ismonkey(C) || isanimal(C))
if(isalien(C) || issmall(C) || isanimal(C))
Target = C
break
@@ -1,8 +0,0 @@
/mob/living/carbon/monkey/gib()
..(null,1)
/mob/living/carbon/monkey/dust()
..("dust-m")
/mob/living/carbon/monkey/death(gibbed)
..(gibbed,"lets out a faint chimper as it collapses and stops moving...")
@@ -1,132 +0,0 @@
/mob/living/carbon/monkey/emote(var/act,var/m_type=1,var/message = null)
var/param = null
if (findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
param = copytext(act, t1 + 1, length(act) + 1)
act = copytext(act, 1, t1)
if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_'
act = copytext(act,1,length(act))
var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle)
switch(act)
if ("me")
if(silent)
return
if (src.client)
if (client.prefs.muted & MUTE_IC)
src << "\red You cannot send IC messages (muted)."
return
if (src.client.handle_spam_prevention(message,MUTE_IC))
return
if (stat)
return
if(!(message))
return
return custom_emote(m_type, message)
if ("custom")
return custom_emote(m_type, message)
if("sign")
if (!src.restrained())
message = text("<B>The monkey</B> signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null))
m_type = 1
if("scratch")
if (!src.restrained())
message = "<B>The [src.name]</B> scratches."
m_type = 1
if("whimper")
if (!muzzled)
message = "<B>The [src.name]</B> whimpers."
m_type = 2
if("roar")
if (!muzzled)
message = "<B>The [src.name]</B> roars."
m_type = 2
if("tail")
message = "<B>The [src.name]</B> waves his tail."
m_type = 1
if("gasp")
message = "<B>The [src.name]</B> gasps."
m_type = 2
if("shiver")
message = "<B>The [src.name]</B> shivers."
m_type = 2
if("drool")
message = "<B>The [src.name]</B> drools."
m_type = 1
if("paw")
if (!src.restrained())
message = "<B>The [src.name]</B> flails his paw."
m_type = 1
if("scretch")
if (!muzzled)
message = "<B>The [src.name]</B> scretches."
m_type = 2
if("choke")
message = "<B>The [src.name]</B> chokes."
m_type = 2
if("moan")
message = "<B>The [src.name]</B> moans!"
m_type = 2
if("nod")
message = "<B>The [src.name]</B> nods his head."
m_type = 1
if("sit")
message = "<B>The [src.name]</B> sits down."
m_type = 1
if("sway")
message = "<B>The [src.name]</B> sways around dizzily."
m_type = 1
if("sulk")
message = "<B>The [src.name]</B> sulks down sadly."
m_type = 1
if("twitch")
message = "<B>The [src.name]</B> twitches violently."
m_type = 1
if("dance")
if (!src.restrained())
message = "<B>The [src.name]</B> dances around happily."
m_type = 1
if("roll")
if (!src.restrained())
message = "<B>The [src.name]</B> rolls."
m_type = 1
if("shake")
message = "<B>The [src.name]</B> shakes his head."
m_type = 1
if("gnarl")
if (!muzzled)
message = "<B>The [src.name]</B> gnarls and shows his teeth.."
m_type = 2
if("jump")
message = "<B>The [src.name]</B> jumps!"
m_type = 1
if("collapse")
Paralyse(2)
message = text("<B>[]</B> collapses!", src)
m_type = 2
if("deathgasp")
message = "<b>The [src.name]</b> lets out a faint chimper as it collapses and stops moving..."
m_type = 1
if("help")
text += "choke, collapse, dance, deathgasp, drool, gasp, shiver, gnarl, jump, paw, moan, nod, roar, roll, scratch,\nscretch, shake, sign-#, sit, sulk, sway, tail, twitch, whimper"
src << text
else
src << text("Invalid Emote: []", act)
if ((message && src.stat == 0))
if(src.client)
log_emote("[name]/[key] : [message]")
if (m_type & 1)
for(var/mob/O in viewers(src, null))
O.show_message(message, m_type)
//Foreach goto(703)
else
for(var/mob/O in hearers(src, null))
O.show_message(message, m_type)
//Foreach goto(746)
return
@@ -1,39 +0,0 @@
/mob/living/carbon/monkey/examine(mob/user)
..(user)
var/msg = ""
if (src.handcuffed)
msg += "It is \icon[src.handcuffed] handcuffed!\n"
if (src.wear_mask)
msg += "It has \icon[src.wear_mask] \a [src.wear_mask] on its head.\n"
if (src.l_hand)
msg += "It has \icon[src.l_hand] \a [src.l_hand] in its left hand.\n"
if (src.r_hand)
msg += "It has \icon[src.r_hand] \a [src.r_hand] in its right hand.\n"
if (src.back)
msg += "It has \icon[src.back] \a [src.back] on its back.\n"
if (src.stat == DEAD)
msg += "<span class='deadsay'>It is limp and unresponsive, with no signs of life.</span>\n"
else
msg += "<span class='warning'>"
if (src.getBruteLoss())
if (src.getBruteLoss() < 30)
msg += "It has minor bruising.\n"
else
msg += "<B>It has severe bruising!</B>\n"
if (src.getFireLoss())
if (src.getFireLoss() < 30)
msg += "It has minor burns.\n"
else
msg += "<B>It has severe burns!</B>\n"
if (src.stat == UNCONSCIOUS)
msg += "It isn't responding to anything around it; it seems to be asleep.\n"
msg += "</span>"
if (src.digitalcamo)
msg += "It is repulsively uncanny!\n"
msg += "*---------*</span>"
user << msg
return
@@ -1,238 +0,0 @@
/obj/effect/equip_e/monkey/process()
if (item)
item.add_fingerprint(source)
if (!( item ))
switch(place)
if("head")
if (!( target.wear_mask ))
del(src)
return
if("l_hand")
if (!( target.l_hand ))
del(src)
return
if("r_hand")
if (!( target.r_hand ))
del(src)
return
if("back")
if (!( target.back ))
del(src)
return
if("handcuff")
if (!( target.handcuffed ))
del(src)
return
if("internal")
if ((!( (istype(target.wear_mask, /obj/item/clothing/mask) && istype(target.back, /obj/item/weapon/tank) && !( target.internal )) ) && !( target.internal )))
del(src)
return
if (item)
if(isrobot(source) && place != "handcuff")
var/list/L = list( "syringe", "pill", "drink", "dnainjector", "fuel")
if(!(L.Find(place)))
del(src)
return
for(var/mob/O in viewers(target, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] is trying to put a [] on []</B>", source, item, target), 1)
else
var/message = null
switch(place)
if("mask")
if(istype(target.wear_mask, /obj/item/clothing)&&!target.wear_mask:canremove)
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.wear_mask, target)
else
message = text("\red <B>[] is trying to take off \a [] from []'s head!</B>", source, target.wear_mask, target)
if("l_hand")
message = text("\red <B>[] is trying to take off a [] from []'s left hand!</B>", source, target.l_hand, target)
if("r_hand")
message = text("\red <B>[] is trying to take off a [] from []'s right hand!</B>", source, target.r_hand, target)
if("back")
message = text("\red <B>[] is trying to take off a [] from []'s back!</B>", source, target.back, target)
if("handcuff")
message = text("\red <B>[] is trying to unhandcuff []!</B>", source, target)
if("internal")
if (target.internal)
message = text("\red <B>[] is trying to remove []'s internals</B>", source, target)
else
message = text("\red <B>[] is trying to set on []'s internals.</B>", source, target)
if("pockets")
message = text("\red <B>[] is trying to empty []'s pockets</B>",source, target)
else
for(var/mob/M in viewers(target, null))
M.show_message(message, 1)
spawn( 30 )
done()
return
return
/obj/effect/equip_e/monkey/done()
if(!source || !target) return
if(source.loc != s_loc) return
if(target.loc != t_loc) return
if(LinkBlocked(s_loc,t_loc)) return
if(item && source.get_active_hand() != item) return
if ((source.restrained() || source.stat)) return
switch(place)
if("mask")
if (target.wear_mask)
if(istype(target.wear_mask, /obj/item/clothing)&& !target.wear_mask:canremove)
return
var/obj/item/W = target.wear_mask
target.u_equip(W)
if (target.client)
target.client.screen -= W
if (W)
W.loc = target.loc
W.dropped(target)
W.layer = initial(W.layer)
W.add_fingerprint(source)
else
if (istype(item, /obj/item/clothing/mask))
source.drop_item()
loc = target
item.layer = 20
target.wear_mask = item
item.loc = target
if("l_hand")
if (target.l_hand)
var/obj/item/W = target.l_hand
target.u_equip(W)
if (target.client)
target.client.screen -= W
if (W)
W.loc = target.loc
W.layer = initial(W.layer)
W.dropped(target)
W.add_fingerprint(source)
else
if (istype(item, /obj/item))
source.drop_item()
loc = target
item.layer = 20
target.l_hand = item
item.loc = target
item.dropped(source)
item.equipped(target,target.l_hand)
if("r_hand")
if (target.r_hand)
var/obj/item/W = target.r_hand
target.u_equip(W)
if (target.client)
target.client.screen -= W
if (W)
W.loc = target.loc
W.layer = initial(W.layer)
W.dropped(target)
W.add_fingerprint(source)
else
if (istype(item, /obj/item))
source.drop_item()
loc = target
item.layer = 20
target.r_hand = item
item.loc = target
item.dropped(source)
item.equipped(target,target.r_hand)
if("back")
if (target.back)
var/obj/item/W = target.back
target.u_equip(W)
if (target.client)
target.client.screen -= W
if (W)
W.loc = target.loc
W.dropped(target)
W.layer = initial(W.layer)
W.add_fingerprint(source)
else
if ((istype(item, /obj/item) && item.slot_flags & SLOT_BACK ))
source.drop_item()
loc = target
item.layer = 20
target.back = item
item.loc = target
if("handcuff")
if (target.handcuffed)
var/obj/item/W = target.handcuffed
target.u_equip(W)
if (target.client)
target.client.screen -= W
if (W)
W.loc = target.loc
W.dropped(target)
W.layer = initial(W.layer)
W.add_fingerprint(source)
else
if (istype(item, /obj/item/weapon/handcuffs))
source.drop_item()
target.handcuffed = item
item.loc = target
if("internal")
if (target.internal)
target.internal.add_fingerprint(source)
target.internal = null
else
if (target.internal)
target.internal = null
if (!( istype(target.wear_mask, /obj/item/clothing/mask) ))
return
else
if (istype(target.back, /obj/item/weapon/tank))
target.internal = target.back
target.internal.add_fingerprint(source)
for(var/mob/M in viewers(target, 1))
if ((M.client && !( M.blinded )))
M.show_message(text("[] is now running on internals.", target), 1)
else
source.regenerate_icons()
target.regenerate_icons()
del(src)
return
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
//set redraw_mob to 0 if you don't wish the hud to be updated - if you're doing it manually in your own proc.
/mob/living/carbon/monkey/equip_to_slot(obj/item/W as obj, slot, redraw_mob = 1)
if(!slot) return
if(!istype(W)) return
if(W == get_active_hand())
u_equip(W)
switch(slot)
if(slot_back)
src.back = W
W.equipped(src, slot)
update_inv_back(redraw_mob)
if(slot_wear_mask)
src.wear_mask = W
W.equipped(src, slot)
update_inv_wear_mask(redraw_mob)
if(slot_handcuffed)
src.handcuffed = W
update_inv_handcuffed(redraw_mob)
if(slot_legcuffed)
src.legcuffed = W
W.equipped(src, slot)
update_inv_legcuffed(redraw_mob)
if(slot_l_hand)
src.l_hand = W
W.equipped(src, slot)
update_inv_l_hand(redraw_mob)
if(slot_r_hand)
src.r_hand = W
W.equipped(src, slot)
update_inv_r_hand(redraw_mob)
if(slot_in_backpack)
W.loc = src.back
else
usr << "\red You are trying to eqip this item to an unsupported inventory slot. How the heck did you manage that? Stop it..."
return
W.layer = 20
return
@@ -1,511 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
/mob/living/carbon/monkey
var/oxygen_alert = 0
var/phoron_alert = 0
var/fire_alert = 0
var/pressure_alert = 0
var/temperature_alert = 0
/mob/living/carbon/monkey/Life()
set invisibility = 0
set background = 1
if (monkeyizing) return
if (update_muts)
update_muts=0
domutcheck(src,null,MUTCHK_FORCED)
..()
var/datum/gas_mixture/environment // Added to prevent null location errors-- TLE
if(loc)
environment = loc.return_air()
if (stat != DEAD)
//First, resolve location and get a breath
if(air_master.current_cycle%4==2)
//Only try to take a breath every 4 seconds, unless suffocating
breathe()
//Updates the number of stored chemicals for powers
handle_changeling()
//Mutations and radiation
handle_mutations_and_radiation()
//Chemicals in the body
handle_chemicals_in_body()
//Disabilities
handle_disabilities()
//Apparently, the person who wrote this code designed it so that
//blinded get reset each cycle and then get activated later in the
//code. Very ugly. I dont care. Moving this stuff here so its easy
//to find it.
blinded = null
//Handle temperature/pressure differences between body and environment
if(environment) // More error checking -- TLE
handle_environment(environment)
//Check if we're on fire
handle_fire()
//Status updates, death etc.
handle_regular_status_updates()
update_canmove()
if(client)
handle_regular_hud_updates()
// Grabbing
for(var/obj/item/weapon/grab/G in src)
G.process()
if(!client && stat == CONSCIOUS)
if(prob(33) && canmove && isturf(loc) && !pulledby) //won't move if being pulled
step(src, pick(cardinal))
if(prob(1))
emote(pick("scratch","jump","roll","tail"))
updatehealth()
/mob/living/carbon/monkey
proc/handle_disabilities()
if (disabilities & EPILEPSY)
if ((prob(1) && paralysis < 10))
src << "\red You have a seizure!"
Paralyse(10)
if (disabilities & COUGHING)
if ((prob(5) && paralysis <= 1))
drop_item()
spawn( 0 )
emote("cough")
return
if (disabilities & TOURETTES)
if ((prob(10) && paralysis <= 1))
Stun(10)
spawn( 0 )
emote("twitch")
return
if (disabilities & NERVOUS)
if (prob(10))
stuttering = max(10, stuttering)
proc/handle_mutations_and_radiation()
if(getFireLoss())
if((COLD_RESISTANCE in mutations) || prob(50))
switch(getFireLoss())
if(1 to 50)
adjustFireLoss(-1)
if(51 to 100)
adjustFireLoss(-5)
if ((HULK in mutations) && health <= 25)
mutations.Remove(HULK)
src << "\red You suddenly feel very weak."
Weaken(3)
emote("collapse")
if (radiation)
if (radiation > 100)
radiation = 100
Weaken(10)
if(!lying)
src << "\red You feel weak."
emote("collapse")
switch(radiation)
if(1 to 49)
radiation--
if(prob(25))
adjustToxLoss(1)
if(50 to 74)
radiation -= 2
adjustToxLoss(1)
if(prob(5))
radiation -= 5
Weaken(3)
if(!lying)
src << "\red You feel weak."
emote("collapse")
if(75 to 100)
radiation -= 3
adjustToxLoss(3)
if(prob(1))
src << "\red You mutate!"
randmutb(src)
domutcheck(src,null)
emote("gasp")
handle_breath(datum/gas_mixture/breath)
if(status_flags & GODMODE)
return
if(!breath || (breath.total_moles == 0))
adjustOxyLoss(7)
oxygen_alert = max(oxygen_alert, 1)
return 0
var/safe_oxygen_min = 16 // Minimum safe partial pressure of O2, in kPa
//var/safe_oxygen_max = 140 // Maximum safe partial pressure of O2, in kPa (Not used for now)
var/safe_co2_max = 10 // Yes it's an arbitrary value who cares?
var/safe_phoron_max = 0.5
var/SA_para_min = 0.5
var/SA_sleep_min = 5
var/oxygen_used = 0
var/breath_pressure = (breath.total_moles * R_IDEAL_GAS_EQUATION * breath.temperature) / BREATH_VOLUME
//Partial pressure of the O2 in our breath
var/O2_pp = (breath.gas["oxygen"] / breath.total_moles) * breath_pressure
// Same, but for the phoron
var/Toxins_pp = (breath.gas["phoron"] / breath.total_moles) * breath_pressure
// And CO2, lets say a PP of more than 10 will be bad (It's a little less really, but eh, being passed out all round aint no fun)
var/CO2_pp = (breath.gas["carbon_dioxide"] / breath.total_moles) * breath_pressure
if(O2_pp < safe_oxygen_min) // Too little oxygen
if(prob(20))
spawn(0) emote("gasp")
if (O2_pp == 0)
O2_pp = 0.01
var/ratio = safe_oxygen_min/O2_pp
adjustOxyLoss(min(5*ratio, 7)) // Don't fuck them up too fast (space only does 7 after all!)
oxygen_used = breath.gas["oxygen"] * ratio / 6
oxygen_alert = max(oxygen_alert, 1)
/*else if (O2_pp > safe_oxygen_max) // Too much oxygen (commented this out for now, I'll deal with pressure damage elsewhere I suppose)
spawn(0) emote("cough")
var/ratio = O2_pp/safe_oxygen_max
oxyloss += 5*ratio
oxygen_used = breath.oxygen*ratio/6
oxygen_alert = max(oxygen_alert, 1)*/
else // We're in safe limits
adjustOxyLoss(-5)
oxygen_used = breath.gas["oxygen"] / 6
oxygen_alert = 0
breath.adjust_gas("oxygen", -oxygen_used)
breath.adjust_gas("carbon_dioxide", oxygen_used)
if(CO2_pp > safe_co2_max)
if(!co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so.
co2overloadtime = world.time
else if(world.time - co2overloadtime > 120)
Paralyse(3)
adjustOxyLoss(3) // Lets hurt em a little, let them know we mean business
if(world.time - co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good!
adjustOxyLoss(8)
if(prob(20)) // Lets give them some chance to know somethings not right though I guess.
spawn(0) emote("cough")
else
co2overloadtime = 0
if(Toxins_pp > safe_phoron_max) // Too much phoron
var/ratio = (breath.gas["phoron"] / safe_phoron_max) * 10
//adjustToxLoss(Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second
if(reagents)
reagents.add_reagent("toxin", Clamp(ratio, MIN_TOXIN_DAMAGE, MAX_TOXIN_DAMAGE))
phoron_alert = max(phoron_alert, 1)
else
phoron_alert = 0
if(breath.gas["sleeping_agent"])
var/SA_pp = (breath.gas["sleeping_agent"] / breath.total_moles) * breath_pressure
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
Paralyse(3) // 3 gives them one second to wake up and run away a bit!
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
sleeping = max(sleeping+2, 10)
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
if(prob(20))
spawn(0) emote(pick("giggle", "laugh"))
if(breath.temperature > (T0C+66)) // Hot air hurts :(
if(prob(20))
src << "\red You feel a searing heat in your lungs!"
fire_alert = max(fire_alert, 2)
else
fire_alert = 0
//Temporary fixes to the alerts.
return 1
proc/handle_environment(datum/gas_mixture/environment)
if(!environment)
return
//Moved these vars here for use in the fuck-it-skip-processing check.
var/pressure = environment.return_pressure()
if(pressure < WARNING_HIGH_PRESSURE && pressure > WARNING_LOW_PRESSURE && abs(environment.temperature - 293.15) < 20 && abs(bodytemperature - 310.14) < 0.5 && environment.gas["phoron"] < MOLES_PHORON_VISIBLE)
//Hopefully should fix the walk-inside-still-pressure-warning issue.
if(pressure_alert)
pressure_alert = 0
return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp
var/environment_heat_capacity = environment.heat_capacity()
if(istype(get_turf(src), /turf/space))
var/turf/heat_turf = get_turf(src)
environment_heat_capacity = heat_turf.heat_capacity
if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10)))
var/transfer_coefficient = 1
handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient)
if(stat==2)
bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000)
//Account for massive pressure differences
switch(pressure)
if(HAZARD_HIGH_PRESSURE to INFINITY)
adjustBruteLoss( min( ( (pressure / HAZARD_HIGH_PRESSURE) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE) )
pressure_alert = 2
if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE)
pressure_alert = 1
if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE)
pressure_alert = 0
if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE)
pressure_alert = -1
else
if( !(COLD_RESISTANCE in mutations) )
adjustBruteLoss( LOW_PRESSURE_DAMAGE )
pressure_alert = -2
else
pressure_alert = -1
return
proc/handle_temperature_damage(body_part, exposed_temperature, exposed_intensity)
if(status_flags & GODMODE) return
var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0)
//adjustFireLoss(2.5*discomfort)
if(exposed_temperature > bodytemperature)
adjustFireLoss(20.0*discomfort)
else
adjustFireLoss(5.0*discomfort)
proc/handle_chemicals_in_body()
if(reagents && reagents.reagent_list.len)
reagents.metabolize(src)
if (drowsyness)
drowsyness--
eye_blurry = max(2, eye_blurry)
if (prob(5))
sleeping += 1
Paralyse(5)
if(confused)
confused = max(0, confused - 1)
if(resting)
dizziness = max(0, dizziness - 5)
else
dizziness = max(0, dizziness - 1)
return //TODO: DEFERRED
proc/handle_regular_status_updates()
if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
blinded = 1
silent = 0
else //ALIVE. LIGHTS ARE ON
updatehealth()
if(health < config.health_threshold_dead || !has_brain())
death()
blinded = 1
stat = DEAD
silent = 0
return 1
//UNCONSCIOUS. NO-ONE IS HOME
if( (getOxyLoss() > 25) || (config.health_threshold_crit > health) )
if( health <= 20 && prob(1) )
spawn(0)
emote("gasp")
if(!reagents.has_reagent("inaprovaline"))
adjustOxyLoss(1)
Paralyse(3)
if(halloss > 100)
src << "<span class='notice'>You're in too much pain to keep going...</span>"
for(var/mob/O in oviewers(src, null))
O.show_message("<B>[src]</B> slumps to the ground, too weak to continue fighting.", 1)
Paralyse(10)
setHalLoss(99)
if(paralysis)
AdjustParalysis(-1)
blinded = 1
stat = UNCONSCIOUS
if(halloss > 0)
adjustHalLoss(-3)
else if(sleeping)
handle_dreams()
adjustHalLoss(-3)
sleeping = max(sleeping-1, 0)
blinded = 1
stat = UNCONSCIOUS
if( prob(10) && health && !hal_crit )
spawn(0)
emote("snore")
else if(resting)
if(halloss > 0)
adjustHalLoss(-3)
//CONSCIOUS
else
stat = CONSCIOUS
if(halloss > 0)
adjustHalLoss(-1)
//Eyes
if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own
blinded = 1
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
blinded = 1
else if(eye_blurry) //blurry eyes heal slowly
eye_blurry = max(eye_blurry-1, 0)
//Ears
if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own
ear_deaf = max(ear_deaf, 1)
else if(ear_deaf) //deafness, heals slowly over time
ear_deaf = max(ear_deaf-1, 0)
else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs
ear_damage = max(ear_damage-0.05, 0)
//Other
handle_statuses()
return 1
proc/handle_regular_hud_updates()
if (stat == 2 || (XRAY in mutations))
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (stat != 2)
sight &= ~SEE_TURFS
sight &= ~SEE_MOBS
sight &= ~SEE_OBJS
see_in_dark = 2
see_invisible = SEE_INVISIBLE_LIVING
if (healths)
if (stat != 2)
switch(health)
if(100 to INFINITY)
healths.icon_state = "health0"
if(80 to 100)
healths.icon_state = "health1"
if(60 to 80)
healths.icon_state = "health2"
if(40 to 60)
healths.icon_state = "health3"
if(20 to 40)
healths.icon_state = "health4"
if(0 to 20)
healths.icon_state = "health5"
else
healths.icon_state = "health6"
else
healths.icon_state = "health7"
if(pressure)
pressure.icon_state = "pressure[pressure_alert]"
if (toxin) toxin.icon_state = "tox[phoron_alert ? 1 : 0]"
if (oxygen) oxygen.icon_state = "oxy[oxygen_alert ? 1 : 0]"
if (fire) fire.icon_state = "fire[fire_alert ? 2 : 0]"
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
//blame the person who coded them. Temporary fix added.
if(bodytemp)
switch(bodytemperature) //310.055 optimal body temp
if(345 to INFINITY)
bodytemp.icon_state = "temp4"
if(335 to 345)
bodytemp.icon_state = "temp3"
if(327 to 335)
bodytemp.icon_state = "temp2"
if(316 to 327)
bodytemp.icon_state = "temp1"
if(300 to 316)
bodytemp.icon_state = "temp0"
if(295 to 300)
bodytemp.icon_state = "temp-1"
if(280 to 295)
bodytemp.icon_state = "temp-2"
if(260 to 280)
bodytemp.icon_state = "temp-3"
else
bodytemp.icon_state = "temp-4"
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if(blind && stat != DEAD)
if(blinded)
blind.layer = 18
else
blind.layer = 0
if(disabilities & NEARSIGHTED)
client.screen += global_hud.vimpaired
if(eye_blurry)
client.screen += global_hud.blurry
if(druggy)
client.screen += global_hud.druggy
if (stat != 2)
if (machine)
if (!( machine.check_eye(src) ))
reset_view(null)
else
if(client && !client.adminobs)
reset_view(null)
return 1
proc/handle_random_events()
if (prob(1) && prob(2))
spawn(0)
emote("scratch")
return
proc/handle_changeling()
if(mind && mind.changeling)
mind.changeling.regenerate()
/mob/living/carbon/monkey/handle_fire()
if(..())
return
adjustFireLoss(6)
return
@@ -1,4 +0,0 @@
/mob/living/carbon/monkey/Login()
..()
update_hud()
return
@@ -1,291 +0,0 @@
/mob/living/carbon/monkey
name = "monkey"
voice_name = "monkey"
speak_emote = list("chimpers")
icon_state = "monkey1"
icon = 'icons/mob/monkey.dmi'
gender = NEUTER
pass_flags = PASSTABLE
update_icon = 0 ///no need to call regenerate_icon
var/obj/item/weapon/card/id/wear_id = null // Fix for station bounced radios -- Skie
var/greaterform = "Human" // Used when humanizing a monkey.
icon_state = "monkey1"
//var/uni_append = "12C4E2" // Small appearance modifier for different species.
var/list/uni_append = list(0x12C,0x4E2) // Same as above for DNA2.
var/update_muts = 1 // Monkey gene must be set at start.
holder_type = /obj/item/weapon/holder/monkey
/mob/living/carbon/monkey/tajara
name = "farwa"
voice_name = "farwa"
speak_emote = list("mews")
icon_state = "tajkey1"
greaterform = "Tajara"
uni_append = list(0x0A0,0xE00) // 0A0E00
holder_type = /obj/item/weapon/holder/monkey/farwa
/mob/living/carbon/monkey/skrell
name = "neaera"
voice_name = "neaera"
speak_emote = list("squicks")
icon_state = "skrellkey1"
greaterform = "Skrell"
uni_append = list(0x01C,0xC92) // 01CC92
holder_type = /obj/item/weapon/holder/monkey/neaera
/mob/living/carbon/monkey/unathi
name = "stok"
voice_name = "stok"
speak_emote = list("hisses")
icon_state = "stokkey1"
greaterform = "Unathi"
uni_append = list(0x044,0xC5D) // 044C5D
holder_type = /obj/item/weapon/holder/monkey/stok
/mob/living/carbon/monkey/New()
verbs += /mob/living/proc/ventcrawl
var/datum/reagents/R = new/datum/reagents(1000)
reagents = R
R.my_atom = src
species = all_species[greaterform]
add_language(species.language)
if(name == initial(name)) //To stop Pun-Pun becoming generic.
name = "[name] ([rand(1, 1000)])"
real_name = name
if (!(dna))
if(gender == NEUTER)
gender = pick(MALE, FEMALE)
dna = new /datum/dna( null )
dna.real_name = real_name
dna.ResetSE()
dna.ResetUI()
//dna.uni_identity = "00600200A00E0110148FC01300B009"
//dna.SetUI(list(0x006,0x002,0x00A,0x00E,0x011,0x014,0x8FC,0x013,0x00B,0x009))
//dna.struc_enzymes = "43359156756131E13763334D1C369012032164D4FE4CD61544B6C03F251B6C60A42821D26BA3B0FD6"
//dna.SetSE(list(0x433,0x591,0x567,0x561,0x31E,0x137,0x633,0x34D,0x1C3,0x690,0x120,0x321,0x64D,0x4FE,0x4CD,0x615,0x44B,0x6C0,0x3F2,0x51B,0x6C6,0x0A4,0x282,0x1D2,0x6BA,0x3B0,0xFD6))
dna.unique_enzymes = md5(name)
// We're a monkey
dna.SetSEState(MONKEYBLOCK, 1)
dna.SetSEValueRange(MONKEYBLOCK,0xDAC, 0xFFF)
// Fix gender
dna.SetUIState(DNA_UI_GENDER, gender != MALE, 1)
// Set the blocks to uni_append, if needed.
if(uni_append.len>0)
for(var/b=1;b<=uni_append.len;b++)
dna.SetUIValue(DNA_UI_LENGTH-(uni_append.len-b),uni_append[b], 1)
dna.UpdateUI()
update_muts=1
..()
update_icons()
return
/mob/living/carbon/monkey/movement_delay()
var/tally = 0
if(reagents)
if(reagents.has_reagent("hyperzine")) return -1
if(reagents.has_reagent("nuka_cola")) return -1
var/health_deficiency = (100 - health)
if(health_deficiency >= 45) tally += (health_deficiency / 25)
if (bodytemperature < 283.222)
tally += (283.222 - bodytemperature) / 10 * 1.75
return tally+config.monkey_delay
/mob/living/carbon/monkey/Topic(href, href_list)
..()
if (href_list["mach_close"])
var/t1 = text("window=[]", href_list["mach_close"])
unset_machine()
src << browse(null, t1)
if ((href_list["item"] && !( usr.stat ) && !( usr.restrained() ) && in_range(src, usr) ))
var/obj/effect/equip_e/monkey/O = new /obj/effect/equip_e/monkey( )
O.source = usr
O.target = src
O.item = usr.get_active_hand()
O.s_loc = usr.loc
O.t_loc = loc
O.place = href_list["item"]
requests += O
spawn( 0 )
O.process()
return
..()
return
/mob/living/carbon/monkey/meteorhit(obj/O as obj)
for(var/mob/M in viewers(src, null))
M.show_message(text("\red [] has been hit by []", src, O), 1)
if (health > 0)
var/shielded = 0
adjustBruteLoss(30)
if ((O.icon_state == "flaming" && !( shielded )))
adjustFireLoss(40)
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
return
/mob/living/carbon/monkey/attack_hand(mob/living/carbon/human/M as mob)
if (M.a_intent == "help" && a_intent == "help")
help_shake_act(M)
get_scooped(M)
else
if (M.a_intent == "hurt")
var/datum/unarmed_attack/attack = null
for(var/datum/unarmed_attack/u_attack in M.species.unarmed_attacks)
if(!u_attack.is_usable(M, src))
continue
else
attack = u_attack
break
if(!attack)
return 0
if ((prob(75) && health > 0))
visible_message("\red <B>[M] [pick(attack.attack_verb)] [src]!</B>")
playsound(loc, "punch", 25, 1, -1)
var/damage = rand(5, 10)
if (prob(40))
damage = rand(10, 15)
if (paralysis < 5)
Paralyse(rand(10, 15))
visible_message("\red <B>[M] has knocked out [src]!</B>")
adjustBruteLoss(damage)
M.attack_log += text("\[[time_stamp()]\] <font color='red'>[pick(attack.attack_verb)]ed [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been [pick(attack.attack_verb)]ed by [M.name] ([M.ckey])</font>")
msg_admin_attack("[key_name(M)] [pick(attack.attack_verb)]ed [key_name(src)]")
updatehealth()
else
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("\red <B>[M] tried to [pick(attack.attack_verb)] [src]!</B>")
else
if (M.a_intent == "grab")
if (M == src || anchored)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src )
M.put_in_active_hand(G)
G.synch()
LAssailant = M
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\red [] has grabbed [name] passively!", M), 1)
else
if (!( paralysis ))
if (prob(25))
Paralyse(2)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has pushed down [name]!</B>", M), 1)
else
drop_item()
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has disarmed [name]!</B>", M), 1)
return
/mob/living/carbon/monkey/Stat()
..()
statpanel("Status")
stat(null, text("Intent: []", a_intent))
stat(null, text("Move Mode: []", m_intent))
if(client && mind)
if (client.statpanel == "Status")
if(mind.changeling)
stat("Chemical Storage", mind.changeling.chem_charges)
stat("Genetic Damage Time", mind.changeling.geneticdamage)
return
/mob/living/carbon/monkey/verb/removeinternal()
set name = "Remove Internals"
set category = "IC"
internal = null
return
/mob/living/carbon/monkey/var/co2overloadtime = null
/mob/living/carbon/monkey/var/temperature_resistance = T0C+75
/mob/living/carbon/monkey/emp_act(severity)
if(wear_id) wear_id.emp_act(severity)
..()
/mob/living/carbon/monkey/ex_act(severity)
if(!blinded)
flick("flash", flash)
switch(severity)
if(1.0)
if (stat != 2)
adjustBruteLoss(200)
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
if(2.0)
if (stat != 2)
adjustBruteLoss(60)
adjustFireLoss(60)
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
if(3.0)
if (stat != 2)
adjustBruteLoss(30)
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
if (prob(50))
Paralyse(10)
else
return
/mob/living/carbon/monkey/blob_act()
if (stat != 2)
adjustFireLoss(60)
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
if (prob(50))
Paralyse(10)
if (stat == DEAD && client)
gib()
return
if (stat == DEAD && !client)
gibs(loc, viruses)
del(src)
return
//Unless its monkey mode monkeys cant use advanced tools
/mob/living/carbon/monkey/IsAdvancedToolUser(var/silent)
if(!silent)
src << "<span class='warning'>You don't have the dexterity to use that!</span>"
return 0
/mob/living/carbon/monkey/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="", var/italics=0, var/message_range = world.view, var/list/used_radios = list())
if(stat)
return
if(copytext(message,1,2) == "*")
return emote(copytext(message,2))
if(stat)
return
if(speak_emote.len)
verb = pick(speak_emote)
message = capitalize(trim_left(message))
..(message, speaking, verb, alt_name, italics, message_range, used_radios)
@@ -1,89 +0,0 @@
mob/living/carbon/monkey/var
mob/npc_target = null // the NPC this monkey is attacking
mob/npc_fleeing = null // the monkey is scared of this mob
mob/hiding_behind = null
hid_behind = 0
var/list/hostiles = list()
fleeing_duration = 0
mob/living/carbon/monkey/proc/npc_act()
if(!client && !stat)
if(npc_fleeing && canmove)
var/prevloc = loc
if(!hiding_behind)
for(var/mob/living/carbon/human/H in view(7, src))
if(!hostiles.Find(H))
hiding_behind = H
if(hiding_behind)
if(get_dist(src, hiding_behind) == 1)
if(!hid_behind)
emote("me", 1, "hides behind [hiding_behind]!")
hid_behind = 1
step_to(src, get_step(hiding_behind, get_dir(npc_fleeing, hiding_behind)))
else
if(!step_to(src, hiding_behind, 1))
hiding_behind = null
else
step_away(src, npc_fleeing, 7)
if(prob(7))
if(prob(50) && (npc_fleeing in view(8,src)))
switch(rand(1,3))
if(1)
emote("me", 1, "shows [npc_fleeing] its fangs!")
if(2)
emote("me", 2, "gnarls at [npc_fleeing].")
if(3)
emote("me", 2, "eyes [npc_fleeing] fearfully.")
else
switch(rand(1,3))
if(1)
emote("whimper")
if(2)
emote("me", 1, "trembles heavily.")
if(3)
emote("me", 2, "chimpers nervously.")
fleeing_duration--
if(fleeing_duration <= 0)
npc_fleeing = null
hiding_behind = null
hid_behind = 0
if(loc == prevloc) set_dir(get_dir(src, npc_fleeing))
else
if(prob(33) && canmove && isturf(loc))
step(src, pick(cardinal))
if(prob(1))
if(health < 70)
switch(rand(1,3))
if(1)
emote("me", 1, "cowers on the floor, writhing in pain.")
if(2)
emote("me", 1, "trembles visibly, it seems to be in pain.")
if(3)
emote("me", 1, "wraps its arms around its knees, breathing heavily.")
else
emote(pick("scratch","jump","roll","tail"))
mob/living/carbon/monkey/react_to_attack(mob/M)
if(npc_fleeing == M)
fleeing_duration += 30
return
if(!hostiles.Find(M)) hostiles += M
spawn(5)
switch(rand(1,3))
if(1)
emote("me", 1, "flails about wildly!")
if(2)
emote("me", 2, "screams loudly at [M]!")
if(3)
emote("me", 2, "whimpers fearfully!")
npc_fleeing = M
fleeing_duration = 30
@@ -1,129 +0,0 @@
//Monkey Overlays Indexes////////
#define M_MASK_LAYER 1
#define M_BACK_LAYER 2
#define M_HANDCUFF_LAYER 3
#define M_L_HAND_LAYER 4
#define M_R_HAND_LAYER 5
#define TARGETED_LAYER 6
#define M_FIRE_LAYER 6
#define M_TOTAL_LAYERS 7
/////////////////////////////////
/mob/living/carbon/monkey
var/list/overlays_lying[M_TOTAL_LAYERS]
var/list/overlays_standing[M_TOTAL_LAYERS]
/mob/living/carbon/monkey/regenerate_icons()
..()
update_inv_wear_mask(0)
update_inv_back(0)
update_inv_r_hand(0)
update_inv_l_hand(0)
update_inv_handcuffed(0)
update_fire(0)
update_icons()
//Hud Stuff
update_hud()
return
/mob/living/carbon/monkey/update_icons()
update_hud()
lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again
overlays.Cut()
for(var/image/I in overlays_standing)
overlays += I
if(lying)
var/matrix/M = matrix()
M.Turn(90)
M.Translate(1,-6)
src.transform = M
else
var/matrix/M = matrix()
src.transform = M
////////
/mob/living/carbon/monkey/update_inv_wear_mask(var/update_icons=1)
if( wear_mask && istype(wear_mask, /obj/item/clothing/mask) )
overlays_standing[M_MASK_LAYER] = image("icon" = 'icons/mob/monkey.dmi', "icon_state" = "[wear_mask.icon_state]")
wear_mask.screen_loc = ui_monkey_mask
else
overlays_standing[M_MASK_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_r_hand(var/update_icons=1)
if(r_hand)
var/t_state = r_hand.item_state
if(!t_state) t_state = r_hand.icon_state
overlays_standing[M_R_HAND_LAYER] = image("icon" = 'icons/mob/items_righthand.dmi', "icon_state" = t_state)
r_hand.screen_loc = ui_rhand
if (handcuffed) drop_r_hand()
else
overlays_standing[M_R_HAND_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_l_hand(var/update_icons=1)
if(l_hand)
var/t_state = l_hand.item_state
if(!t_state) t_state = l_hand.icon_state
overlays_standing[M_L_HAND_LAYER] = image("icon" = 'icons/mob/items_lefthand.dmi', "icon_state" = t_state)
l_hand.screen_loc = ui_lhand
if (handcuffed) drop_l_hand()
else
overlays_standing[M_L_HAND_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_back(var/update_icons=1)
if(back)
overlays_standing[M_BACK_LAYER] = image("icon" = 'icons/mob/back.dmi', "icon_state" = "[back.icon_state]")
back.screen_loc = ui_monkey_back
else
overlays_standing[M_BACK_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_handcuffed(var/update_icons=1)
if(handcuffed)
drop_r_hand()
drop_l_hand()
stop_pulling()
overlays_standing[M_HANDCUFF_LAYER] = image("icon" = 'icons/mob/monkey.dmi', "icon_state" = "handcuff1")
else
overlays_standing[M_HANDCUFF_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_hud()
if (client)
client.screen |= contents
//Call when target overlay should be added/removed
/mob/living/carbon/monkey/update_targeted(var/update_icons=1)
if (targeted_by && target_locked)
overlays_standing[TARGETED_LAYER] = target_locked
else if (!targeted_by && target_locked)
del(target_locked)
if (!targeted_by)
overlays_standing[TARGETED_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_fire(var/update_icons=1)
if(on_fire)
overlays_standing[M_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing", "layer"= -M_FIRE_LAYER)
else
overlays_standing[M_FIRE_LAYER] = null
if(update_icons) update_icons()
//Monkey Overlays Indexes////////
#undef M_MASK_LAYER
#undef M_BACK_LAYER
#undef M_HANDCUFF_LAYER
#undef M_L_HAND_LAYER
#undef M_R_HAND_LAYER
#undef TARGETED_LAYER
#undef M_FIRE_LAYER
#undef M_TOTAL_LAYERS
+1 -8
View File
@@ -59,13 +59,6 @@
H.UpdateDamageIcon()
H.updatehealth()
return 1
else if(istype(src, /mob/living/carbon/monkey))
if (COLD_RESISTANCE in src.mutations) //fireproof
return 0
var/mob/living/carbon/monkey/M = src
M.adjustFireLoss(burn_amount)
M.updatehealth()
return 1
else if(istype(src, /mob/living/silicon/ai))
return 0
@@ -241,7 +234,7 @@
src.updatehealth()
// damage ONE external organ, organ gets randomly selected from damaged ones.
/mob/living/proc/take_organ_damage(var/brute, var/burn)
/mob/living/proc/take_organ_damage(var/brute, var/burn, var/emp=0)
if(status_flags & GODMODE) return 0 //godmode
adjustBruteLoss(brute)
adjustFireLoss(burn)
+1 -17
View File
@@ -6,21 +6,5 @@
mind.active = 1 //indicates that the mind is currently synced with a client
//If they're SSD, remove it so they can wake back up.
player_logged = 0
//Round specific stuff like hud updates
if(ticker && ticker.mode)
switch(ticker.mode.name)
if("revolution")
if((mind in ticker.mode.revolutionaries) || (src.mind in ticker.mode:head_revolutionaries))
ticker.mode.update_rev_icons_added(src.mind)
if("cult")
if(mind in ticker.mode:cult)
ticker.mode.update_cult_icons_added(src.mind)
if("mercenary")
if(mind in ticker.mode:syndicates)
ticker.mode.update_all_synd_icons()
if("mutiny")
var/datum/game_mode/mutiny/mode = get_mutiny_mode()
if(mode)
mode.update_all_icons()
update_antag_icons(mind)
return .
+5 -16
View File
@@ -189,7 +189,7 @@ var/list/ai_verbs_default = list(
src << radio_text
if (!(ticker && ticker.mode && (mind in ticker.mode.malf_ai)))
if (malf && !(mind in malf.current_antagonists))
show_laws()
src << "<b>These laws may be changed by other players, or by you being the traitor.</b>"
@@ -197,6 +197,7 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/Del()
ai_list -= src
del(eyeobj)
..()
/mob/living/silicon/ai/pointed(atom/A as mob|obj|turf in view())
@@ -312,17 +313,15 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/proc/is_malf()
if(ticker.mode.name == "AI malfunction")
var/datum/game_mode/malfunction/malf = ticker.mode
for (var/datum/mind/malfai in malf.malf_ai)
for (var/datum/mind/malfai in malf.current_antagonists)
if (mind == malfai)
return malf
return 0
// displays the malf_ai information if the AI is the malf
/mob/living/silicon/ai/show_malf_ai()
var/datum/game_mode/malfunction/malf = is_malf()
if(malf && malf.apcs >= 3)
stat(null, "Time until station control secured: [max(malf.AI_win_timeleft/(malf.apcs/3), 0)] seconds")
if(malf && malf.hacked_apcs.len >= 3)
stat(null, "Time until station control secured: [max(malf.hack_time/(malf.hacked_apcs/3), 0)] seconds")
// this verb lets the ai see the stations manifest
/mob/living/silicon/ai/proc/ai_roster()
@@ -585,16 +584,6 @@ var/list/ai_verbs_default = list(
holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo4"))
return
/*/mob/living/silicon/ai/proc/corereturn()
set category = "Malfunction"
set name = "Return to Main Core"
var/obj/machinery/power/apc/apc = src.loc
if(!istype(apc))
src << "\blue You are already in your Main Core."
return
apc.malfvacate()*/
//Toggles the luminosity and applies it by re-entereing the camera.
/mob/living/silicon/ai/proc/toggle_camera_light()
set name = "Toggle Camera Light"
+1 -1
View File
@@ -35,7 +35,7 @@
break
callshuttle++
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction" || sent_strike_team)
if(ticker.mode.name == "revolution" || ticker.mode.name == "AI malfunction")
callshuttle = 0
if(callshuttle == 3) //if all three conditions are met
@@ -2,157 +2,45 @@
//
// The datum containing all the chunks.
var/datum/cameranet/cameranet = new()
var/datum/visualnet/camera/cameranet = new()
/datum/cameranet
/datum/visualnet/camera
// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Del().
var/list/cameras = list()
var/cameras_unsorted = 1
// The chunks of the map, mapping the areas that the cameras can see.
var/list/chunks = list()
var/ready = 0
chunk_type = /datum/chunk/camera
/datum/cameranet/proc/process_sort()
/datum/visualnet/camera/proc/process_sort()
if(cameras_unsorted)
cameras = dd_sortedObjectList(cameras)
cameras_unsorted = 0
// Checks if a chunk has been Generated in x, y, z.
/datum/cameranet/proc/chunkGenerated(x, y, z)
x &= ~0xf
y &= ~0xf
var/key = "[x],[y],[z]"
return (chunks[key])
// Returns the chunk in the x, y, z.
// If there is no chunk, it creates a new chunk and returns that.
/datum/cameranet/proc/getCameraChunk(x, y, z)
x &= ~0xf
y &= ~0xf
var/key = "[x],[y],[z]"
if(!chunks[key])
chunks[key] = new /datum/camerachunk(null, x, y, z)
return chunks[key]
// Updates what the aiEye can see. It is recommended you use this when the aiEye moves or it's location is set.
/datum/cameranet/proc/visibility(mob/aiEye/ai)
// 0xf = 15
var/x1 = max(0, ai.x - 16) & ~0xf
var/y1 = max(0, ai.y - 16) & ~0xf
var/x2 = min(world.maxx, ai.x + 16) & ~0xf
var/y2 = min(world.maxy, ai.y + 16) & ~0xf
var/list/visibleChunks = list()
for(var/x = x1; x <= x2; x += 16)
for(var/y = y1; y <= y2; y += 16)
visibleChunks += getCameraChunk(x, y, ai.z)
var/list/remove = ai.visibleCameraChunks - visibleChunks
var/list/add = visibleChunks - ai.visibleCameraChunks
for(var/chunk in remove)
var/datum/camerachunk/c = chunk
c.remove(ai)
for(var/chunk in add)
var/datum/camerachunk/c = chunk
c.add(ai)
// Updates the chunks that the turf is located in. Use this when obstacles are destroyed or when doors open.
/datum/cameranet/proc/updateVisibility(atom/A, var/opacity_check = 1)
if(!ticker || (opacity_check && !A.opacity))
return
majorChunkChange(A, 2)
/datum/cameranet/proc/updateChunk(x, y, z)
// 0xf = 15
if(!chunkGenerated(x, y, z))
return
var/datum/camerachunk/chunk = getCameraChunk(x, y, z)
chunk.hasChanged()
// Removes a camera from a chunk.
/datum/cameranet/proc/removeCamera(obj/machinery/camera/c)
/datum/visualnet/camera/proc/removeCamera(obj/machinery/camera/c)
if(c.can_use())
majorChunkChange(c, 0)
// Add a camera to a chunk.
/datum/cameranet/proc/addCamera(obj/machinery/camera/c)
/datum/visualnet/camera/proc/addCamera(obj/machinery/camera/c)
if(c.can_use())
majorChunkChange(c, 1)
// Used for Cyborg cameras. Since portable cameras can be in ANY chunk.
/datum/cameranet/proc/updatePortableCamera(obj/machinery/camera/c)
/datum/visualnet/camera/proc/updatePortableCamera(obj/machinery/camera/c)
if(c.can_use())
majorChunkChange(c, 1)
//else
// majorChunkChange(c, 0)
// Never access this proc directly!!!!
// This will update the chunk and all the surrounding chunks.
// It will also add the atom to the cameras list if you set the choice to 1.
// Setting the choice to 0 will remove the camera from the chunks.
// If you want to update the chunks around an object, without adding/removing a camera, use choice 2.
/datum/cameranet/proc/majorChunkChange(atom/c, var/choice)
// 0xf = 15
if(!c)
return
var/turf/T = get_turf(c)
if(T)
var/x1 = max(0, T.x - 8) & ~0xf
var/y1 = max(0, T.y - 8) & ~0xf
var/x2 = min(world.maxx, T.x + 8) & ~0xf
var/y2 = min(world.maxy, T.y + 8) & ~0xf
//world << "X1: [x1] - Y1: [y1] - X2: [x2] - Y2: [y2]"
for(var/x = x1; x <= x2; x += 16)
for(var/y = y1; y <= y2; y += 16)
if(chunkGenerated(x, y, T.z))
var/datum/camerachunk/chunk = getCameraChunk(x, y, T.z)
// Only add actual cameras to the list of cameras
if(istype(c, /obj/machinery/camera))
if(choice == 0)
// Remove the camera.
chunk.cameras -= c
else if(choice == 1)
// You can't have the same camera in the list twice.
chunk.cameras |= c
chunk.hasChanged()
// Will check if a mob is on a viewable turf. Returns 1 if it is, otherwise returns 0.
/datum/cameranet/proc/checkCameraVis(mob/living/target as mob)
// 0xf = 15
var/turf/position = get_turf(target)
return checkTurfVis(position)
/datum/cameranet/proc/checkTurfVis(var/turf/position)
var/datum/camerachunk/chunk = getCameraChunk(position.x, position.y, position.z)
if(chunk)
if(chunk.changed)
chunk.hasChanged(1) // Update now, no matter if it's visible or not.
if(chunk.visibleTurfs[position])
return 1
return 0
// Debug verb for VVing the chunk that the turf is in.
/*
/turf/verb/view_chunk()
set src in world
if(cameranet.chunkGenerated(x, y, z))
var/datum/camerachunk/chunk = cameranet.getCameraChunk(x, y, z)
usr.client.debug_variables(chunk)
*/
/datum/visualnet/camera/onMajorChunkChange(atom/c, var/choice, var/datum/chunk/camera/chunk)
// Only add actual cameras to the list of cameras
if(istype(c, /obj/machinery/camera))
if(choice == 0)
// Remove the camera.
chunk.cameras -= c
else if(choice == 1)
// You can't have the same camera in the list twice.
chunk.cameras |= c
@@ -1,77 +1,12 @@
#define UPDATE_BUFFER 25 // 2.5 seconds
// CAMERA CHUNK
//
// A 16x16 grid of the map with a list of turfs that can be seen, are visible and are dimmed.
// Allows the AI Eye to stream these chunks and know what it can and cannot see.
// Allows the Eye to stream these chunks and know what it can and cannot see.
/datum/camerachunk
var/list/obscuredTurfs = list()
var/list/visibleTurfs = list()
var/list/obscured = list()
/datum/chunk/camera
var/list/cameras = list()
var/list/turfs = list()
var/list/seenby = list()
var/visible = 0
var/changed = 0
var/updating = 0
var/x = 0
var/y = 0
var/z = 0
// Add an AI eye to the chunk, then update if changed.
/datum/camerachunk/proc/add(mob/aiEye/ai)
if(!ai.ai)
return
ai.visibleCameraChunks += src
if(ai.ai.client)
ai.ai.client.images += obscured
visible++
seenby += ai
if(changed && !updating)
update()
// Remove an AI eye from the chunk, then update if changed.
/datum/camerachunk/proc/remove(mob/aiEye/ai)
if(!ai.ai)
return
ai.visibleCameraChunks -= src
if(ai.ai.client)
ai.ai.client.images -= obscured
seenby -= ai
if(visible > 0)
visible--
// Called when a chunk has changed. I.E: A wall was deleted.
/datum/camerachunk/proc/visibilityChanged(turf/loc)
if(!visibleTurfs[loc])
return
hasChanged()
// Updates the chunk, makes sure that it doesn't update too much. If the chunk isn't being watched it will
// instead be flagged to update the next time an AI Eye moves near it.
/datum/camerachunk/proc/hasChanged(var/update_now = 0)
if(visible || update_now)
if(!updating)
updating = 1
spawn(UPDATE_BUFFER) // Batch large changes, such as many doors opening or closing at once
update()
updating = 0
else
changed = 1
// The actual updating. It gathers the visible turfs from cameras and puts them into the appropriate lists.
/datum/camerachunk/proc/update()
set background = 1
var/list/newVisibleTurfs = list()
/datum/chunk/camera/acquireVisibleTurfs(var/list/visible)
for(var/camera in cameras)
var/obj/machinery/camera/c = camera
@@ -87,77 +22,12 @@
cameras -= c
for(var/turf/t in c.can_see())
newVisibleTurfs[t] = t
// Removes turf that isn't in turfs.
newVisibleTurfs &= turfs
var/list/visAdded = newVisibleTurfs - visibleTurfs
var/list/visRemoved = visibleTurfs - newVisibleTurfs
visibleTurfs = newVisibleTurfs
obscuredTurfs = turfs - newVisibleTurfs
for(var/turf in visAdded)
var/turf/t = turf
if(t.obscured)
obscured -= t.obscured
for(var/eye in seenby)
var/mob/aiEye/m = eye
if(!m || !m.ai)
continue
if(m.ai.client)
m.ai.client.images -= t.obscured
for(var/turf in visRemoved)
var/turf/t = turf
if(obscuredTurfs[t])
if(!t.obscured)
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
obscured += t.obscured
for(var/eye in seenby)
var/mob/aiEye/m = eye
if(!m || !m.ai)
seenby -= m
continue
if(m.ai.client)
m.ai.client.images += t.obscured
visible[t] = t
// Create a new camera chunk, since the chunks are made as they are needed.
/datum/camerachunk/New(loc, x, y, z)
// 0xf = 15
x &= ~0xf
y &= ~0xf
src.x = x
src.y = y
src.z = z
/datum/chunk/camera/New(loc, x, y, z)
for(var/obj/machinery/camera/c in range(16, locate(x + 8, y + 8, z)))
if(c.can_use())
cameras += c
for(var/turf/t in range(10, locate(x + 8, y + 8, z)))
if(t.x >= x && t.y >= y && t.x < x + 16 && t.y < y + 16)
turfs[t] = t
// At this point we only have functional cameras
for(var/obj/machinery/camera/c in cameras)
for(var/turf/t in c.can_see())
visibleTurfs[t] = t
// Removes turf that isn't in turfs.
visibleTurfs &= turfs
obscuredTurfs = turfs - visibleTurfs
for(var/turf in obscuredTurfs)
var/turf/t = turf
if(!t.obscured)
t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15)
obscured += t.obscured
#undef UPDATE_BUFFER
..()

Some files were not shown because too many files have changed in this diff Show More