Merge branch 'bleeding-edge-freeze' into tentacles

This commit is contained in:
Chinsky
2013-05-26 05:02:34 +04:00
33 changed files with 862 additions and 741 deletions
+18 -1
View File
@@ -140,7 +140,24 @@
return t_out
//checks text for html tags
//if tag is not in whitelist (var/list/paper_tag_whitelist in global.dm)
//relpaces < with &lt;
proc/checkhtml(var/t)
t = sanitize_simple(t, list("&#"="."))
var/p = findtext(t,"<",1)
while (p) //going through all the tags
var/start = p++
var/tag = copytext(t,p, p+1)
if (tag != "/")
while (reject_bad_text(copytext(t, p, p+1), 1))
tag = copytext(t,start, p)
p++
tag = copytext(t,start+1, p)
if (!(tag in paper_tag_whitelist)) //if it's unkown tag, disarming it
t = copytext(t,1,start-1) + "&lt;" + copytext(t,start+1)
p = findtext(t,"<",p)
return t
/*
* Text searches
*/
+1
View File
@@ -112,6 +112,7 @@ var/list/radiochannels = list(
var/list/DEPT_FREQS = list(1351,1355,1357,1359,1213,1441,1347)
var/const/COMM_FREQ = 1353 //command, colored gold in chat window
var/const/SYND_FREQ = 1213
var/const/ERT_FREQ = 1439
#define TRANSMISSION_WIRE 0
#define TRANSMISSION_RADIO 1
+1 -1
View File
@@ -331,7 +331,7 @@
if(!M) return
var/num
var/newdna
num = rand(1,STRUCDNASIZE-1)
num = rand(1,UNIDNASIZE)
M.dna.check_integrity()
newdna = setblock(M.dna.uni_identity,num,add_zero2(num2hex(rand(1,4095),1),3),3)
M.dna.uni_identity = newdna
@@ -217,18 +217,28 @@
message_admins("Unable to add new heads of revolution.")
tried_to_add_revheads = world.time + 6000 // wait 10 minutes
if(last_command_report == 0 && world.time >= 60 * 10)
command_alert("We are regrettably announcing that your performance has been disappointing, and we are thus forced to cut down on financial support to your station. To achieve this, the pay of all personnal, except the Heads of Staff, has been halved.")
if(last_command_report == 0 && world.time >= 10 * 60 * 10)
src.command_report("We are regrettably announcing that your performance has been disappointing, and we are thus forced to cut down on financial support to your station. To achieve this, the pay of all personnal, except the Heads of Staff, has been halved.")
last_command_report = 1
else if(last_command_report == 1 && world.time >= 60 * 30)
command_alert("Statistics hint that a high amount of leisure time, and associated activities, are responsible for the poor performance of many of our stations. You are to bolt and close down any leisure facilities, such as the holodeck, the theatre and the bar. Food can be distributed through vendors and the kitchen.")
else if(last_command_report == 1 && world.time >= 10 * 60 * 30)
src.command_report("Statistics hint that a high amount of leisure time, and associated activities, are responsible for the poor performance of many of our stations. You are to bolt and close down any leisure facilities, such as the holodeck, the theatre and the bar. Food can be distributed through vendors and the kitchen.")
last_command_report = 2
else if(last_command_report == 2 && world.time >= 60 * 60)
command_alert("It is reported that merely closing down leisure facilities has not been successful. You and your Heads of Staff are to ensure that all crew are working hard, and not wasting time or energy. Any crew caught off duty without leave from their Head of Staff are to be warned, and on repeated offence, to be brigged until the next transfer shuttle arrives, which will take them to facilities where they can be of more use.")
else if(last_command_report == 2 && world.time >= 10 * 60 * 60)
src.command_report("It is reported that merely closing down leisure facilities has not been successful. You and your Heads of Staff are to ensure that all crew are working hard, and not wasting time or energy. Any crew caught off duty without leave from their Head of Staff are to be warned, and on repeated offence, to be brigged until the next transfer shuttle arrives, which will take them to facilities where they can be of more use.")
last_command_report = 3
return ..()
/datum/game_mode/revolution/rp_revolution/proc/command_report(message)
for (var/obj/machinery/computer/communications/comm in world)
if (!(comm.stat & (BROKEN | NOPOWER)) && comm.prints_intercept)
var/obj/item/weapon/paper/intercept = new /obj/item/weapon/paper( comm.loc )
intercept.name = "paper- 'Cent. Com. Announcement'"
intercept.info = message
comm.messagetitle.Add("Cent. Com. Announcement")
comm.messagetext.Add(message)
world << sound('commandreport.ogg')
/datum/game_mode/revolution/rp_revolution/latespawn(mob/M)
if(M.mind.assigned_role in command_positions)
@@ -239,6 +249,6 @@
var/datum/objective/mutiny/rp/rev_obj = new
rev_obj.owner = rev_mind
rev_obj.target = M.mind
rev_obj.explanation_text = "Assassinate, convert or capture [M.name], the [M.mind.assigned_role]."
rev_obj.explanation_text = "Assassinate, convert or capture [M.real_name], the [M.mind.assigned_role]."
rev_mind.objectives += rev_obj
rev_mind.current << "\red A new Head of Staff, [M.name], the [M.mind.assigned_role] has appeared. Your objectives have been updated."
rev_mind.current << "\red A new Head of Staff, [M.real_name], the [M.mind.assigned_role] has appeared. Your objectives have been updated."
+1 -1
View File
@@ -115,7 +115,7 @@
steal_objective.find_target()
traitor.objectives += steal_objective
switch(rand(1,100))
if(1 to 90)
if(1 to 100)
if (!(locate(/datum/objective/escape) in traitor.objectives))
var/datum/objective/escape/escape_objective = new
escape_objective.owner = traitor
+1 -1
View File
@@ -87,7 +87,7 @@
escape_objective.owner = wizard
wizard.objectives += escape_objective
if(61 to 85)
if(61 to 100)
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = wizard
kill_objective.find_target()
+5 -5
View File
@@ -4,8 +4,8 @@
var/title = "NOPE"
//Job access. The use of minimal_access or access is determined by a config setting: config.jobs_have_minimal_access
var/minimal_access = list() //Useful for servers which prefer to only have access given to the places a job absolutely needs (Larger server population)
var/access = list() //Useful for servers which either have fewer players, so each person needs to fill more than one role, or servers which like to give more access, so players can't hide forever in their super secure departments (I'm looking at you, chemistry!)
var/list/minimal_access = list() //Useful for servers which prefer to only have access given to the places a job absolutely needs (Larger server population)
var/list/access = list() //Useful for servers which either have fewer players, so each person needs to fill more than one role, or servers which like to give more access, so players can't hide forever in their super secure departments (I'm looking at you, chemistry!)
//Bitflags for the job
var/flag = 0
@@ -46,12 +46,12 @@
/datum/job/proc/get_access()
if(!config) //Needed for robots.
return src.minimal_access
return src.minimal_access.Copy()
if(config.jobs_have_minimal_access)
return src.minimal_access
return src.minimal_access.Copy()
else
return src.access
return src.access.Copy()
//If the configuration option is set to require players to be logged as old enough to play certain jobs, then this proc checks that they are, otherwise it just returns 1
/datum/job/proc/player_old_enough(client/C)
+1
View File
@@ -197,6 +197,7 @@
if(H.dna)
H.dna.mutantrace = mrace
H.update_mutantrace()
H.update_mutantrace_languages()
H.suiciding = 0
src.attempting = 0
return 1
@@ -153,6 +153,7 @@ obj/machinery/embedded_controller/radio/access_controller
name = "Access Console"
density = 0
power_channel = ENVIRON
unacidable = 1
frequency = 1449
@@ -262,6 +262,7 @@ obj/machinery/embedded_controller/radio/airlock_controller
name = "Airlock Console"
density = 0
unacidable = 1
frequency = 1449
power_channel = ENVIRON
@@ -44,6 +44,7 @@
name = "Vent Controller"
density = 0
unacidable = 1
frequency = 1229
power_channel = ENVIRON
@@ -252,7 +252,7 @@ obj/machinery/embedded_controller/radio/smart_airlock_controller
name = "Cycling Airlock Console"
density = 0
unacidable = 1
frequency = 1449
power_channel = ENVIRON
+6 -1
View File
@@ -99,4 +99,9 @@ obj/machinery/recharger/update_icon() //we have an update_icon() in addition to
if(charging)
icon_state = "recharger1"
else
icon_state = "recharger0"
icon_state = "recharger0"
obj/machinery/recharger/wallcharger
name = "wall recharger"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "wrecharger0"
@@ -148,6 +148,15 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
signal.data["radio"], signal.data["message"],
signal.data["name"], signal.data["job"],
signal.data["realname"], signal.data["vname"],, signal.data["compression"], list(0), connection.frequency)
if(connection.frequency == ERT_FREQ)
Broadcast_Message(signal.data["connection"], signal.data["mob"],
signal.data["vmask"], signal.data["vmessage"],
signal.data["radio"], signal.data["message"],
signal.data["name"], signal.data["job"],
signal.data["realname"], signal.data["vname"],, signal.data["compression"], list(0), connection.frequency)
else
if(intercept)
Broadcast_Message(signal.data["connection"], signal.data["mob"],
+7 -1
View File
@@ -24,12 +24,18 @@
toggled = 0
autolinkers = list("r_relay")
/obj/machinery/telecomms/relay/preset/centcom
id = "Centcom Relay"
hide = 1
toggled = 0
autolinkers = list("c_relay")
//HUB
/obj/machinery/telecomms/hub/preset
id = "Hub"
network = "tcommsat"
autolinkers = list("hub", "relay", "s_relay", "m_relay", "r_relay", "science", "medical",
autolinkers = list("hub", "relay", "c_relay", "s_relay", "m_relay", "r_relay", "science", "medical",
"supply", "common", "command", "engineering", "security",
"receiverA", "receiverB", "broadcasterA", "broadcasterB")
+1 -1
View File
@@ -5,7 +5,7 @@
*/
/obj/item/device/debugger
icon = 'icon/obj/hacktool.dmi'
icon = 'icons/obj/hacktool.dmi'
name = "debugger"
desc = "Used to debug electronic equipment."
icon_state = "hacktool-g"
+2 -2
View File
@@ -119,7 +119,7 @@
/obj/item/weapon/card/id/syndicate
name = "agent card"
access = list(access_maint_tunnels, access_syndicate)
access = list(access_maint_tunnels, access_syndicate, access_external_airlocks)
origin_tech = "syndicate=3"
/obj/item/weapon/card/id/syndicate/afterattack(var/obj/item/weapon/O as obj, mob/user as mob)
@@ -156,7 +156,7 @@
desc = "An ID straight from the Syndicate."
registered_name = "Syndicate"
assignment = "Syndicate Overlord"
access = list(access_syndicate)
access = list(access_syndicate, access_external_airlocks)
/obj/item/weapon/card/id/captains_spare
name = "captain's spare ID"
@@ -120,8 +120,8 @@
/obj/item/weapon/melee/telebaton/attack_self(mob/user as mob)
on = !on
if(on)
user.visible_message("\red You extend the baton.",\
"\red With a flick of their wrist, [user] extends their telescopic baton.",\
user.visible_message("\red With a flick of their wrist, [user] extends their telescopic baton.",\
"\red You extend the baton.",\
"You hear an ominous click.")
icon_state = "telebaton_1"
item_state = "telebaton_1"
@@ -129,8 +129,8 @@
force = 15//quite robust
attack_verb = list("smacked", "struck", "slapped")
else
user.visible_message("\blue You collapse the baton.",\
"\blue [user] collapses their telescopic baton.",\
user.visible_message("\blue [user] collapses their telescopic baton.",\
"\blue You collapse the baton.",\
"You hear a click.")
icon_state = "telebaton_0"
item_state = "telebaton_0"
+6
View File
@@ -27,6 +27,12 @@ var/global/list/global_map = null
//////////////
var/list/paper_tag_whitelist = list("center","p","div","span","h1","h2","h3","h4","h5","h6","hr","pre", \
"big","small","font","i","u","b","s","sub","sup","tt","br","hr","ol","ul","li","caption","col", \
"table","td","th","tr")
var/list/paper_blacklist = list("java","onblur","onchange","onclick","ondblclick","onfocus","onkeydown", \
"onkeypress","onkeyup","onload","onmousedown","onmousemove","onmouseout","onmouseover", \
"onmouseup","onreset","onselect","onsubmit","onunload")
var/BLINDBLOCK = 0
var/DEAFBLOCK = 0
+8
View File
@@ -20,6 +20,8 @@
sleep(2400)
*/
var/list/event_last_fired = list()
//Always triggers an event when called, dynamically chooses events based on job population
/proc/spawn_dynamic_event()
if(!config.allow_random_events)
@@ -86,8 +88,14 @@
if(!sent_ninja_to_station && toggle_space_ninja)
possibleEvents[/datum/event/space_ninja] = max(active_with_role["Security"], 5)
for(var/event_type in event_last_fired) if(possibleEvents[event_type])
var/time_passed = world.time - event_last_fired[event_type]
var/weight_modifier = max(0, 60 * 60 - time_passed / 100)
possibleEvents[event_type] = max(possibleEvents[event_type] - weight_modifier, 0)
var/picked_event = pickweight(possibleEvents)
event_last_fired[picked_event] = world.time
// Debug code below here, very useful for testing so don't delete please.
var/debug_message = "Firing random event. "
+2 -2
View File
@@ -2,8 +2,8 @@ var/list/allEvents = typesof(/datum/event) - /datum/event
var/list/potentialRandomEvents = typesof(/datum/event) - /datum/event
//var/list/potentialRandomEvents = typesof(/datum/event) - /datum/event - /datum/event/spider_infestation - /datum/event/alien_infestation
var/eventTimeLower = 10000 //15 minutes
var/eventTimeUpper = 25000 //30 minutes
var/eventTimeLower = 6000 //10 minutes
var/eventTimeUpper = 12000 //15 minutes
var/scheduledEvent = null
+1 -1
View File
@@ -13,7 +13,7 @@ datum/event/organ_failure/announce()
datum/event/organ_failure/start()
var/list/candidates = list() //list of candidate keys
for(var/mob/living/carbon/human/G in player_list)
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD && G.health > 70))
if(G.mind && G.mind.current && G.mind.current.stat != DEAD && G.health > 70)
candidates += G
if(!candidates.len) return
candidates = shuffle(candidates)//Incorporating Donkie's list shuffle
@@ -48,9 +48,6 @@
/mob/living/carbon/human/death(gibbed)
if(halloss > 0 && !gibbed)
halloss = 0
return
if(stat == DEAD) return
if(healths) healths.icon_state = "health5"
stat = DEAD
+10 -1
View File
@@ -439,7 +439,7 @@
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable
/mob/living/carbon/human/proc/get_face_name()
var/datum/organ/external/head/head = get_organ("head")
if( !head || head.disfigured || (head.status & ORGAN_DESTROYED) || !real_name ) //disfigured. use id-name if possible
if( !head || head.disfigured || (head.status & ORGAN_DESTROYED) || !real_name || (HUSK in mutations) ) //disfigured. use id-name if possible
return "Unknown"
return real_name
@@ -823,6 +823,15 @@
else if(src.dna.mutantrace == "tajaran")
return "Tajaran"
/mob/living/carbon/proc/update_mutantrace_languages()
if(src.dna)
if(src.dna.mutantrace == "lizard")
src.soghun_talk_understand = 1
else if(src.dna.mutantrace == "skrell")
src.skrell_talk_understand = 1
else if(src.dna.mutantrace == "tajaran")
src.tajaran_talk_understand = 1
/mob/living/carbon/human/proc/play_xylophone()
if(!src.xylophone)
visible_message("\red [src] begins playing his ribcage like a xylophone. It's quite spooky.","\blue You begin to play a spooky refrain on your ribcage.","\red You hear a spooky xylophone melody.")
+3 -3
View File
@@ -402,7 +402,7 @@ var/list/department_radio_keys = list(
var/deaf_message = ""
var/deaf_type = 1
if(M != src)
deaf_message = "<span class='name'>[name][alt_name]</span> talks but you cannot hear them."
deaf_message = "<span class='name'>[name]</span>[alt_name] talks but you cannot hear them."
else
deaf_message = "<span class='notice'>You cannot hear yourself!</span>"
deaf_type = 2 // Since you should be able to hear yourself without looking
@@ -416,12 +416,12 @@ var/list/department_radio_keys = list(
message_b = voice_message
else
message_b = stars(message)
message_b = say_quote(message_b)
message_b = say_quote(message,is_speaking_soghun,is_speaking_skrell,is_speaking_taj)
if (italics)
message_b = "<i>[message_b]</i>"
rendered = "<span class='game say'><span class='name'>[voice_name]</span> <span class='message'>[message_b]</span></span>"
rendered = "<span class='game say'><span class='name'>[name]</span>[alt_name] <span class='message'>[message_b]</span></span>" //Voice_name isn't too useful. You'd be able to tell who was talking presumably.
for (var/M in heard_b)
@@ -210,14 +210,14 @@
/mob/living/silicon/robot/verb/Namepick()
if(custom_name)
return 0
spawn(0)
var/newname
newname = input(src,"You are a robot. Enter a name, or leave blank for the default name.", "Name change","") as text
if (newname != "")
custom_name = newname
var/newname
newname = input(src,"You are a robot. Enter a name, or leave blank for the default name.", "Name change","") as text
if (newname != "")
custom_name = newname
updatename("Default")
updateicon()
updatename("Default")
updateicon()
/mob/living/silicon/robot/verb/cmd_robot_alerts()
set category = "Robot Commands"
+13 -1
View File
@@ -236,7 +236,8 @@
if(href_list["write"])
var/id = href_list["write"]
//var/t = strip_html_simple(input(usr, "What text do you wish to add to " + (id=="end" ? "the end of the paper" : "field "+id) + "?", "[name]", null),8192) as message
var/t = strip_html_simple(input("Enter what you want to write:", "Write", null, null) as message, MAX_MESSAGE_LEN)
//var/t = strip_html_simple(input("Enter what you want to write:", "Write", null, null) as message, MAX_MESSAGE_LEN)
var/t = input("Enter what you want to write:", "Write", null, null) as message
var/obj/item/i = usr.get_active_hand() // Check to see if he still got that darn pen, also check if he's using a crayon or pen.
var/iscrayon = 0
if(!istype(i, /obj/item/weapon/pen))
@@ -248,6 +249,17 @@
if((!in_range(src, usr) && loc != usr && !( istype(loc, /obj/item/weapon/clipboard) ) && loc.loc != usr && usr.get_active_hand() != i)) // Some check to see if he's allowed to write
return
t = checkhtml(t)
// check for exploits
for(var/bad in paper_blacklist)
if(findtext(t,bad))
usr << "\blue You think to yourself, \"Hm.. this is only paper...\""
log_admin("PAPER: [usr] ([usr.ckey]) tried to use forbidden word in [src]: [bad].")
message_admins("PAPER: [usr] ([usr.ckey]) tried to use forbidden word in [src]: [bad].")
return
t = replacetext(t, "\n", "<BR>")
t = parsepencode(t, i, usr, iscrayon) // Encode everything from pencode to html
if(id!="end")
@@ -42,9 +42,9 @@
icon_state = "chocolateglass"
name = "Glass of chocolate"
desc = "Tasty"
if("lemon")
if("lemonjuice")
icon_state = "lemonglass"
name = "Glass of lemon"
name = "Glass of lemonjuice"
desc = "Sour..."
if("cola")
icon_state = "glass_brown"
+1
View File
@@ -304,6 +304,7 @@ var/MAX_EXPLOSION_RANGE = 14
// mob/var/list/mutations
#define STRUCDNASIZE 27
#define UNIDNASIZE 13
// Generic mutations:
#define TK 1