Merge pull request #236 from Aurorastation/development

Development Merge - 25MAR2016
This commit is contained in:
skull132
2016-03-25 22:35:35 +02:00
81 changed files with 944 additions and 439 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
if (!ckey || !address || !computer_id || !ban_id)
return
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
error("Ban database connection failure while attempting to mirror. Key passed for mirror handling: [ckey].")
+4 -4
View File
@@ -4,7 +4,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
if(!check_rights(R_MOD,0) && !check_rights(R_BAN)) return
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
return
@@ -122,7 +122,7 @@ datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
if(job)
sql += " AND job = '[job]'"
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
return
@@ -217,7 +217,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
var/sql = "SELECT ckey FROM ss13_ban WHERE id = [id]"
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
return
@@ -269,7 +269,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
if(!check_rights(R_BAN)) return
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
usr << "\red Failed to establish database connection"
return
+1 -1
View File
@@ -34,7 +34,7 @@ world/IsBanned(key,address,computer_id)
var/ckeytext = ckey(key)
if(!establish_db_connection())
if(!establish_db_connection(dbcon))
error("Ban database connection failure. Key [ckeytext] not checked")
log_misc("Ban database connection failure. Key [ckeytext] not checked")
return
+1 -1
View File
@@ -102,7 +102,7 @@ var/list/admin_ranks = list() //list of all ranks with associated rights
else
//The current admin system uses SQL
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
error("Failed to connect to database in load_admins(). Reverting to legacy system.")
log_misc("Failed to connect to database in load_admins(). Reverting to legacy system.")
+4 -5
View File
@@ -6,10 +6,7 @@ var/list/admin_verbs_default = list(
/client/proc/deadmin_self, /*destroys our own admin datum so we can play as a regular player*/
/client/proc/hide_verbs, /*hides all our adminverbs*/
/client/proc/hide_most_verbs, /*hides all our hideable adminverbs*/
/client/proc/debug_variables, /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/
// /client/proc/check_antagonists, /*shows all antags*/
/client/proc/cmd_mentor_check_new_players
// /client/proc/deadchat /*toggles deadchat on/off*/
)
var/list/admin_verbs_admin = list(
/client/proc/player_panel_new, /*shows an interface for all players, with links to various panels*/
@@ -85,7 +82,6 @@ var/list/admin_verbs_admin = list(
/client/proc/allow_character_respawn, /* Allows a ghost to respawn */
/client/proc/event_manager_panel,
/client/proc/empty_ai_core_toggle_latejoin,
/client/proc/empty_ai_core_toggle_latejoin,
/client/proc/aooc,
/client/proc/change_human_appearance_admin, /* Allows an admin to change the basic appearance of human-based mobs */
/client/proc/change_human_appearance_self, /* Allows the human-based mob itself change its basic appearance */
@@ -296,7 +292,10 @@ var/list/admin_verbs_mod = list(
/client/proc/jobbans,
/client/proc/cmd_admin_subtle_message, /*send an message to somebody as a 'voice in their head'*/
/datum/admins/proc/paralyze_mob,
/client/proc/toggleattacklogs
/client/proc/toggleattacklogs,
/client/proc/cmd_admin_check_contents,
/client/proc/check_words, /*displays cult-words*/
/client/proc/check_ai_laws /*shows AI and borg laws*/
)
var/list/admin_verbs_dev = list( //will need to be altered - Ryan784
+1 -1
View File
@@ -65,7 +65,7 @@ DEBUG
jobban_keylist=list()
log_admin("jobban_keylist was empty")
else
if(!establish_db_connection())
if(!establish_db_connection(dbcon))
error("Database connection failed. Reverting to the legacy ban system.")
log_misc("Database connection failed. Reverting to the legacy ban system.")
config.ban_legacy_system = 1
@@ -54,7 +54,7 @@
usr << "\red You do not have permission to do this!"
return
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
usr << "\red Failed to establish database connection"
@@ -104,7 +104,7 @@
usr << "\red You do not have permission to do this!"
return
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
usr << "\red Failed to establish database connection"
return
+5 -5
View File
@@ -12,7 +12,7 @@
else
query_details[":a_ckey"] = user.ckey
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
alert("SQL connection failed while trying to add a note!")
return
@@ -36,7 +36,7 @@
if (!note_id || !note_edit)
return
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
error("SQL connection failed while attempting to delete a note!")
return
@@ -93,7 +93,7 @@
player_ckey = ckey(player_ckey)
admin_ckey = ckey(admin_ckey)
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
error("SQL connection failed while attempting to view a player's notes!")
return
@@ -187,7 +187,7 @@
if (!ckey)
return "No ckey given!"
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
return "Unable to establish database connection! Aborting!"
@@ -231,7 +231,7 @@
note_list >> note_keys
msg_scopes("Establishing DB connection!")
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
msg_scopes("No DB connection!")
return
@@ -29,7 +29,7 @@ var/inactive_keys = "None<br>"
if(checked_for_inactives)
return
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
return
+6 -6
View File
@@ -9,7 +9,7 @@
if (!warned_ckey || !istext(warned_ckey))
return
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
usr << "<font color='red'>Error: warn(): Database Connection failed, reverting to legacy systems.</font>"
usr.client.warn_legacy(warned_ckey)
@@ -110,7 +110,7 @@
var/dcolor = "#ffaaaa" //dark colour, severity = 1
var/ecolor = "#e3e3e3" //gray colour, expired = 1
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
alert("Connection to the SQL database lost. Aborting. Please alert an Administrator or a member of staff.")
return
@@ -172,7 +172,7 @@
if (!warning_id)
return
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
alert("Connection to SQL database failed while attempting to update your warning's status!")
return
@@ -191,7 +191,7 @@
var/count = 0
var/count_expire = 0
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
return
@@ -239,7 +239,7 @@
var/dcolor = "#ffdddd" //dark colour, severity = 1
var/ecolor = "#e3e3e3" //gray colour, expired = 1
establish_db_connection()
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
alert("Connection to the SQL database lost. Aborting. Please alert the database admin!")
return
@@ -342,7 +342,7 @@
if(!warning_id || !warning_edit)
return
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
alert("Connection to the SQL database lost. Aborting. Please alert the database admin!")
return
+157 -5
View File
@@ -74,7 +74,68 @@
if(href_list["warnview"])
warnings_check()
..() //redirect to hsrc.Topic()
if(href_list["linkingrequest"])
if (!config.webint_url)
return
if (!href_list["linkingaction"])
return
var/request_id = text2num(href_list["linkingrequest"])
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
src << "\red Action failed! Database link could not be established!"
return
var/DBQuery/check_query = dbcon.NewQuery("SELECT player_ckey, status FROM ss13_player_linking WHERE id = :id")
check_query.Execute(list(":id" = request_id))
if (!check_query.NextRow())
src << "\red No request found!"
return
if (ckey(check_query.item[1]) != ckey || check_query.item[2] != "new")
src << "\red Request authentication failed!"
return
var/query_contents = ""
var/list/query_details = list(":new_status", ":id")
var/feedback_message = ""
switch (href_list["linkingaction"])
if ("accept")
query_contents = "UPDATE ss13_player_linking SET status = :new_status, updated_at = NOW() WHERE id = :id"
query_details[":new_status"] = "confirmed"
query_details[":id"] = request_id
feedback_message = "<font color='green'><b>Account successfully linked!</b></font>"
if ("deny")
query_contents = "UPDATE ss13_player_linking SET status = :new_status, deleted_at = NOW() WHERE id = :id"
query_details[":new_status"] = "rejected"
query_details[":id"] = request_id
feedback_message = "<font color='red'><b>Link request rejected!</b></font>"
else
src << "\red Invalid command sent."
return
var/DBQuery/update_query = dbcon.NewQuery(query_contents)
update_query.Execute(query_details)
if (href_list["linkingaction"] == "accept" && alert("To complete the process, you have to visit the website. Do you want to do so now?",,"Yes","No") == "Yes")
process_webint_link("interface/user/link")
src << feedback_message
check_linking_requests()
return
if (href_list["routeWebInt"])
process_webint_link(href_list["routeWebInt"], href_list["routeAttributes"])
return
..() //redirect to hsrc.()
/client/proc/handle_spam_prevention(var/message, var/mute_type)
if(config.automute_on && !holder && src.last_message == message)
@@ -175,6 +236,8 @@
log_client_to_db()
check_linking_requests()
send_resources()
nanomanager.send_resources(src)
@@ -203,7 +266,7 @@
// Returns null if no DB connection can be established, or -1 if the requested key was not found in the database
/proc/get_player_age(key)
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
return null
@@ -223,7 +286,7 @@
if ( IsGuestKey(src.key) )
return
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
return
@@ -344,12 +407,101 @@
)
mob/proc/MayRespawn()
/mob/proc/MayRespawn()
return 0
client/proc/MayRespawn()
/client/proc/MayRespawn()
if(mob)
return mob.MayRespawn()
// Something went wrong, client is usually kicked or transfered to a new mob at this point
return 0
//I honestly can't find a good place for this atm.
//If the webint interaction gets more features, I'll move it. - Skull132
/client/verb/view_linking_requests()
set name = "View Linking Requests"
set category = "OOC"
check_linking_requests()
/client/proc/check_linking_requests()
if (!config.webint_url || !config.sql_enabled)
return
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
return
var/list/requests = list()
var/list/query_details = list(":ckey" = ckey)
var/DBQuery/select_query = dbcon.NewQuery("SELECT id, forum_id, forum_username, datediff(Now(), created_at) as request_age FROM ss13_player_linking WHERE status = 'new' AND player_ckey = :ckey AND deleted_at IS NULL")
select_query.Execute(query_details)
while (select_query.NextRow())
requests.Add(list(list("id" = text2num(select_query.item[1]), "forum_id" = text2num(select_query.item[2]), "forum_username" = select_query.item[3], "request_age" = select_query.item[4])))
if (!requests.len)
return
var/dat = "<center><b>You have active requests to check!</b></center>"
var/i = 0
for (var/list/request in requests)
i++
var/linked_forum_name = null
if (config.forumurl)
var/route_attributes = list2params(list("mode" = "viewprofile", "u" = request["forum_id"]))
linked_forum_name = "<a href='byond://?src=\ref[src];routeWebInt=forums/members;routeAttributes=[route_attributes]'>[request["forum_username"]]</a>"
dat += "<hr>"
dat += "#[i] - Request to link your current key ([key]) to a forum account with the username of: <b>[linked_forum_name ? linked_forum_name : request["forum_username"]]</b>.<br>"
dat += "The request is [request["request_age"]] days old.<br>"
dat += "OPTIONS: <a href='byond://?src=\ref[src];linkingrequest=[request["id"]];linkingaction=accept'>Accept Request</a> | <a href='byond://?src=\ref[src];linkingrequest=[request["id"]];linkingaction=deny'>Deny Request</a>"
src << browse(dat, "window=LinkingRequests")
return
/client/proc/process_webint_link(var/route, var/attributes)
if (!route)
return
var/linkURL = ""
switch (route)
if ("forums/members")
if (!webint_validate_attributes(list("mode", "u"), attributes_text = attributes))
return
if (!config.forumurl)
return
linkURL = "[config.forumurl]memberlist.php?"
linkURL += attributes
if ("interface/user/link")
if (!config.webint_url)
return
linkURL = "[config.webint_url]user/link"
if ("interface/login/sso_server")
//This also validates the attributes as it runs
var/new_attributes = webint_start_singlesignon(src, attributes)
if (!new_attributes)
return
if (!config.webint_url)
return
linkURL = "[config.webint_url]login/sso_server?"
linkURL += new_attributes
else
log_debug("Unrecognized process_webint_link() call used. Route sent: '[route]'.")
return
src << link(linkURL)
return
+18
View File
@@ -110,6 +110,24 @@
prescription = 1
body_parts_covered = 0
/obj/item/clothing/glasses/regular/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/clothing/glasses/hud/health))
user.drop_item()
del(W)
user << "<span class='notice'>You attach a set of medical HUDs to your glasses.</span>"
var/turf/T = get_turf(src)
new /obj/item/clothing/glasses/hud/health/prescription(T)
user.drop_from_inventory(src)
del(src)
if(istype(W, /obj/item/clothing/glasses/hud/security))
user.drop_item()
del(W)
user << "<span class='notice'>You attach a set of security HUDs to your glasses.</span>"
var/turf/T = get_turf(src)
new /obj/item/clothing/glasses/hud/security/prescription(T)
user.drop_from_inventory(src)
del(src)
/obj/item/clothing/glasses/regular/scanners
name = "Scanning Goggles"
desc = "A very oddly shaped pair of goggles with bits of wire poking out the sides. A soft humming sound emanates from it."
+30
View File
@@ -20,6 +20,21 @@
/obj/item/clothing/glasses/hud/health/process_hud(var/mob/M)
process_med_hud(M, 1)
/obj/item/clothing/glasses/hud/health/prescription
name = "prescription glasses/HUD assembly"
desc = "A medical HUD clipped onto the side of prescription glasses."
prescription = 1
icon_state = "healthhudpresc"
item_state = "healthhudpresc"
/obj/item/clothing/glasses/hud/health/prescription/attack_self(mob/user)
user << "<span class='notice'>You detach a set of medical HUDs form your glasses.</span>"
var/turf/T = get_turf(src)
new /obj/item/clothing/glasses/hud/health(T)
new /obj/item/clothing/glasses/regular(T)
user.drop_item(src)
del(src)
/obj/item/clothing/glasses/hud/security
name = "Security HUD"
desc = "A heads-up display that scans the humans in view and provides accurate data about their ID status and security records."
@@ -27,6 +42,21 @@
body_parts_covered = 0
var/global/list/jobs[0]
/obj/item/clothing/glasses/hud/security/prescription
name = "prescription glasses/HUD assembly"
desc = "A security HUD clipped onto the side of prescription glasses."
prescription = 1
icon_state = "sechudpresc"
item_state = "sechudpresc"
/obj/item/clothing/glasses/hud/security/prescription/attack_self(mob/user)
user << "<span class='notice'>You detach a set of security HUDs form your glasses.</span>"
var/turf/T = get_turf(src)
new /obj/item/clothing/glasses/hud/health(T)
new /obj/item/clothing/glasses/regular(T)
user.drop_item(src)
del(src)
/obj/item/clothing/glasses/hud/security/jensenshades
name = "Augmented shades"
desc = "Polarized bioneural eyewear, designed to augment your vision."
@@ -34,6 +34,7 @@
usable = 1
disruptive = 0
activates_on_touch = 1
confined_use = 1
engage_string = "Eject AI"
activate_string = "Enable Dataspike"
@@ -324,6 +325,7 @@
icon_state = "ewar"
toggleable = 1
usable = 0
confined_use = 1
activate_string = "Enable Countermeasures"
deactivate_string = "Disable Countermeasures"
@@ -28,6 +28,7 @@
var/permanent // If set, the module can't be removed.
var/disruptive = 1 // Can disrupt by other effects.
var/activates_on_touch // If set, unarmed attacks will call engage() on the target.
var/confined_use = 0 // If set, can be used inside mechs and other vehicles.
var/active // Basic module status
var/disruptable // Will deactivate if some other powers are used.
@@ -169,6 +170,10 @@
if(!holder.check_power_cost(usr, use_power_cost, 0, src, (istype(usr,/mob/living/silicon ? 1 : 0) ) ) )
return 0
if(!confined_use && istype(usr.loc, /obj/mecha))
usr << "<span class='danger'>You cannot use the suit in the confined space.</span>"
return 0
next_use = world.time + module_cooldown
return 1
@@ -15,6 +15,7 @@
toggleable = 1
disruptable = 1
disruptive = 0
confined_use = 1
use_power_cost = 50
active_power_cost = 10
@@ -108,6 +108,10 @@
if(istype(T) && !T.Adjacent(get_turf(src)))
return 0
// Stop generating infinite devices please, and thank you.
if(istype(target, /obj/machinery/disposal))
return 0
var/resolved = target.attackby(device,holder.wearer)
if(!resolved && device && target)
device.afterattack(target,holder.wearer,1)
@@ -123,6 +127,7 @@
selectable = 0
toggleable = 0
disruptive = 0
confined_use = 1
engage_string = "Inject"
@@ -268,6 +273,7 @@
selectable = 0
toggleable = 0
disruptive = 0
confined_use = 1
engage_string = "Configure Synthesiser"
@@ -379,4 +385,4 @@
jets.holder = null
jets.ion_trail.set_up(jets)
/obj/item/rig_module/foam_sprayer
/obj/item/rig_module/foam_sprayer
@@ -50,6 +50,7 @@
usable = 1
toggleable = 1
disruptive = 0
confined_use = 1
engage_string = "Cycle Visor Mode"
activate_string = "Enable Visor"
@@ -188,4 +189,4 @@
if(!vision) vision = vision_datum
processed_vision += vision_datum
vision_modes = processed_vision
vision_modes = processed_vision
+2 -2
View File
@@ -249,7 +249,7 @@
M.lastattacker = user
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
msg_admin_attack("[key_name(user)] attacked [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" )
msg_admin_attack("[key_name(user)] attacked [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)" )
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
@@ -403,4 +403,4 @@ var/list/fruit_icon_cache = list()
var/image/I = image(icon,"fruit_slice")
I.color = flesh_colour
fruit_icon_cache["slice-[rind_colour]"] = I
overlays |= fruit_icon_cache["slice-[rind_colour]"]
overlays |= fruit_icon_cache["slice-[rind_colour]"]
+6 -5
View File
@@ -43,7 +43,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
<A href='?src=\ref[src];setauthor=1'>Filter by Author: [author]</A><BR>
<A href='?src=\ref[src];search=1'>\[Start Search\]</A><BR>"}
if(1)
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
dat += "<font color=red><b>ERROR</b>: Unable to contact External Archive. Please contact your system administrator for assistance.</font><BR>"
else if(!SQLquery)
@@ -189,7 +189,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
<A href='?src=\ref[src];switchscreen=0'>(Return to main menu)</A><BR>"}
if(4)
dat += "<h3>External Archive</h3>"
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
dat += "<font color=red><b>ERROR</b>: Unable to contact External Archive. Please contact your system administrator for assistance.</font>"
else
@@ -332,7 +332,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
if(scanner.cache.unique)
alert("This book has been rejected from the database. Aborting!")
else
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
alert("Connection to Archive has been severed. Aborting.")
else
@@ -346,7 +346,8 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
var/sqlauthor = sanitizeSQL(scanner.cache.author)
var/sqlcontent = sanitizeSQL(scanner.cache.dat)
var/sqlcategory = sanitizeSQL(upload_category)
var/DBQuery/query = dbcon.NewQuery("INSERT INTO ss13_library (author, title, content, category) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]')")
var/sqlckey = sanitizeSQL(ckey(usr.client.ckey))
var/DBQuery/query = dbcon.NewQuery("INSERT INTO ss13_library (author, title, content, category, uploadtime, uploader) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', NOW(), '[sqlckey]')")
if(!query.Execute())
usr << query.ErrorMsg()
else
@@ -355,7 +356,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
if(href_list["targetid"])
var/sqlid = sanitizeSQL(href_list["targetid"])
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
alert("Connection to Archive has been severed. Aborting.")
if(bibledelay)
+1 -1
View File
@@ -19,4 +19,4 @@
/datum/language/tajaran/monkey
name = "Farwa"
desc = "Meow meow meow."
key = "9"
key = "^"
+1 -1
View File
@@ -71,7 +71,7 @@
desc = "Vaurca native language made of clicks and sputters, \"It's a bugs life.\""
speech_verb = "clicks"
colour = "vaurca"
key = "m"
key = "9"
flags = WHITELISTED
syllables = list("kic","klic","\'tic","kit","lit","xic","vil","xrit","tshh","qix","qlit","zix","\'","!")
+2 -8
View File
@@ -84,14 +84,8 @@
/mob/living/carbon/attack_hand(mob/M as mob)
if(!istype(M, /mob/living/carbon)) return
if (ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
if (H.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
H << "\red You can't use your [temp.name]"
return
if (!M.can_use_hand())
return
for(var/datum/disease/D in viruses)
@@ -1419,6 +1419,7 @@
/mob/living/carbon/human/put_in_l_hand(var/obj/item/W)
if(!..() || l_hand)
return 0
W.forceMove(src)
l_hand = W
W.equipped(src,slot_l_hand)
@@ -1429,9 +1430,26 @@
/mob/living/carbon/human/put_in_r_hand(var/obj/item/W)
if(!..() || r_hand)
return 0
W.forceMove(src)
r_hand = W
W.equipped(src,slot_r_hand)
W.add_fingerprint(src)
update_inv_r_hand()
return 1
/mob/living/carbon/human/can_use_hand(var/selected_hand = hand)
var/hand_to_check = "l_hand"
if (!selected_hand)
hand_to_check = "r_hand"
var/obj/item/organ/external/temp = organs_by_name[hand_to_check]
if (temp && !temp.is_usable())
src << "<span class='notice'>You try to move your [temp.name], but cannot!"
return 0
if (!temp)
src << "<span class='notice'>You try to use your hand, but realize it is no longer attached!"
return 0
return 1
@@ -7,13 +7,8 @@
/mob/living/carbon/human/attack_hand(mob/living/carbon/M as mob)
var/mob/living/carbon/human/H = M
if(istype(H))
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
if(H.hand)
temp = H.organs_by_name["l_hand"]
if(!temp || !temp.is_usable())
H << "\red You can't use your hand."
return
if(!M.can_use_hand())
return
..()
@@ -263,7 +258,7 @@
playsound(loc, ((miss_type) ? (miss_type == 1 ? attack.miss_sound : 'sound/weapons/thudswoosh.ogg') : attack.attack_sound), 25, 1, -1)
H.attack_log += text("\[[time_stamp()]\] <font color='red'>[miss_type ? (miss_type == 1 ? "Missed" : "Blocked") : "[pick(attack.attack_verb)]"] [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>[miss_type ? (miss_type == 1 ? "Was missed by" : "Has blocked") : "Has Been [pick(attack.attack_verb)]"] by [H.name] ([H.ckey])</font>")
msg_admin_attack("[key_name(H)] [miss_type ? (miss_type == 1 ? "has missed" : "was blocked by") : "has [pick(attack.attack_verb)]"] [key_name(src)]")
msg_admin_attack("[key_name(H)] [miss_type ? (miss_type == 1 ? "has missed" : "was blocked by") : "has [pick(attack.attack_verb)]"] [key_name(src)] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[H.x];Y=[H.y];Z=[H.z]'>JMP</a>)")
if(miss_type)
return 0
@@ -291,7 +286,7 @@
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Disarmed [src.name] ([src.ckey])</font>")
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been disarmed by [M.name] ([M.ckey])</font>")
msg_admin_attack("[key_name(M)] disarmed [src.name] ([src.ckey])")
msg_admin_attack("[key_name(M)] disarmed [src.name] ([src.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[M.x];Y=[M.y];Z=[M.z]'>JMP</a>)")
M.do_attack_animation(src)
if(w_uniform)
@@ -70,7 +70,7 @@ emp_act
c_hand = r_hand
if(c_hand && (stun_amount || agony_amount > 10))
msg_admin_attack("[src.name] ([src.ckey]) was disarmed by a stun effect")
msg_admin_attack("[src.name] ([src.ckey]) was disarmed by a stun effect (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[src.x];Y=[src.y];Z=[src.z]'>JMP</a>)")
drop_from_inventory(c_hand)
if (affected.status & ORGAN_ROBOT)
+3 -3
View File
@@ -1635,13 +1635,13 @@
holder2.icon_state = "hudxeno"
else if(foundVirus)
holder.icon_state = "hudill"
else if(has_brain_worms())
var/mob/living/simple_animal/borer/B = has_brain_worms()
/* else if(has_brain_worms())
var/mob/living/simple_animal/borer/B = has_brain_worms() //Cotrical borer disable
if(B.controlling)
holder.icon_state = "hudbrainworm"
else
holder.icon_state = "hudhealthy"
holder2.icon_state = "hudbrainworm"
holder2.icon_state = "hudbrainworm" */
else
holder.icon_state = "hudhealthy"
if(virus2.len)
@@ -52,13 +52,13 @@
//Account for massive pressure differences
if(bodytemperature < (T0C + 5)) // start calculating temperature damage etc
if(bodytemperature < hurt_temperature) // start calculating temperature damage etc
if(bodytemperature <= (T0C - 50)) // hurt temperature
if(bodytemperature <= 50) // sqrting negative numbers is bad
if(bodytemperature <= die_temperature)
if(bodytemperature <= 50)
adjustToxLoss(200)
else
adjustToxLoss(round(sqrt(bodytemperature)) * 2)
adjustToxLoss(30)
updatehealth()
@@ -234,7 +234,7 @@
if(issilicon(L) && (rabid || attacked)) // They can't eat silicons, but they can glomp them in defence
targets += L // Possible target found!
if(istype(L, /mob/living/carbon/human) && dna) //Ignore slime(wo)men
if(istype(L, /mob/living/carbon/human)) //Ignore slime(wo)men
var/mob/living/carbon/human/H = L
if(H.species.name == "Slime")
continue
@@ -48,6 +48,8 @@
var/Atkcool = 0 // attack cooldown
var/SStun = 0 // NPC stun variable. Used to calm them down when they are attacked while feeding, or they will immediately re-attach
var/Discipline = 0 // if a slime has been hit with a freeze gun, or wrestled/attacked off a human, they become disciplined and don't attack anymore for a while. The part about freeze gun is a lie
var/hurt_temperature = T0C-50 // slime keeps taking damage when its bodytemperature is below this
var/die_temperature = 50 // slime dies instantly when its bodytemperature is below this
///////////TIME FOR SUBSPECIES
@@ -126,7 +126,7 @@
src << "They are no longer in range!"
return
/*
/mob/living/simple_animal/borer/verb/devour_brain()
set category = "Abilities"
set name = "Devour Brain"
@@ -150,7 +150,7 @@
src << "<span class = 'danger'>It only takes a few moments to render the dead host brain down into a nutrient-rich slurry...</span>"
replace_brain()
*/
// BRAIN WORM ZOMBIES AAAAH.
/mob/living/simple_animal/borer/proc/replace_brain()
+5
View File
@@ -641,6 +641,7 @@
if(statpanel("Status") && ticker && ticker.current_state != GAME_STATE_PREGAME)
stat("Station Time", worldtime2text())
stat("Round Duration", round_duration())
stat("Last Transfer Vote", vote.last_transfer_vote ? time2text(vote.last_transfer_vote, "hh:mm") : "Never")
if(client.holder)
if(statpanel("Status"))
@@ -1109,3 +1110,7 @@ mob/proc/yank_out_object()
feedback_add_details("admin_verb", "UNWIND")
return
//Helper proc for figuring out if the active hand (or given hand) is usable.
/mob/proc/can_use_hand()
return 1
+2 -2
View File
@@ -41,7 +41,7 @@
output += "<p><a href='byond://?src=\ref[src];observe=1'>Observe</A></p>"
if(!IsGuestKey(src.key))
establish_db_connection()
establish_db_connection(dbcon)
if(dbcon.IsConnected())
var/isadmin = 0
@@ -181,7 +181,7 @@
return
if(href_list["privacy_poll"])
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
return
var/voted = 0
+6 -6
View File
@@ -1,6 +1,6 @@
/mob/new_player/proc/handle_privacy_poll()
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected())
return
var/voted = 0
@@ -47,7 +47,7 @@
var/optiontext
/mob/new_player/proc/handle_player_polling()
establish_db_connection()
establish_db_connection(dbcon)
if(dbcon.IsConnected())
var/isadmin = 0
if(src.client && src.client.holder)
@@ -81,7 +81,7 @@
/mob/new_player/proc/poll_player(var/pollid = -1)
if(pollid == -1) return
establish_db_connection()
establish_db_connection(dbcon)
if(dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM ss13_poll_question WHERE id = [pollid]")
@@ -342,7 +342,7 @@
if(!isnum(pollid) || !isnum(optionid))
return
establish_db_connection()
establish_db_connection(dbcon)
if(dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM ss13_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
@@ -412,7 +412,7 @@
if(!isnum(pollid) || !istext(replytext))
return
establish_db_connection()
establish_db_connection(dbcon)
if(dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM ss13_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
@@ -470,7 +470,7 @@
if(!isnum(pollid) || !isnum(optionid))
return
establish_db_connection()
establish_db_connection(dbcon)
if(dbcon.IsConnected())
var/DBQuery/select_query = dbcon.NewQuery("SELECT starttime, endtime, question, polltype FROM ss13_poll_question WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime")
+2 -8
View File
@@ -22,14 +22,8 @@
return
/obj/item/weapon/paper_bin/attack_hand(mob/user as mob)
if(ishuman(user))
var/mob/living/carbon/human/H = user
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
if (H.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
user << "<span class='notice'>You try to move your [temp.name], but cannot!"
return
if(!user.can_use_hand())
return
var/response = ""
if(!papers.len > 0)
response = alert(user, "Do you take regular paper, or Carbon copy paper?", "Paper type request", "Regular", "Carbon-Copy", "Cancel")
@@ -1,18 +1,18 @@
/obj/item/weapon/gun/energy/temperature
name = "temperature gun"
name = "freeze ray"
icon_state = "freezegun"
fire_sound = 'sound/weapons/pulse3.ogg'
desc = "A gun that changes temperatures. It has a small label on the side, 'More extreme temperatures will cost more charge!'"
var/temperature = T20C
var/current_temperature = T20C
charge_cost = 100
desc = "For when somebody won't let it go."
//var/temperature = T20C
//var/current_temperature = T20C
charge_cost = 25 //20 shots, exact replica of old code (WAS 100)
origin_tech = "combat=3;materials=4;powerstorage=3;magnets=2"
slot_flags = SLOT_BELT|SLOT_BACK
projectile_type = /obj/item/projectile/temp
cell_type = /obj/item/weapon/cell/high
cell_type = /obj/item/weapon/cell/crap //WAS High, but brought down to match energy use
/*
/obj/item/weapon/gun/energy/temperature/New()
..()
processing_objects.Add(src)
@@ -38,7 +38,7 @@
user << browse(dat, "window=freezegun;size=450x300;can_resize=1;can_close=1;can_minimize=1")
onclose(user, "window=freezegun", src)
*/
/obj/item/weapon/gun/energy/temperature/Topic(href, href_list)
if (..())
@@ -47,7 +47,7 @@
src.add_fingerprint(usr)
/*
if(href_list["temp"])
var/amount = text2num(href_list["temp"])
if(amount > 0)
@@ -77,3 +77,4 @@
temperature += 10
else
temperature = current_temperature
*/
@@ -28,7 +28,7 @@
name ="high-ex round"
icon_state= "bolter"
damage = 15
on_hit(var/atom/target, var/blocked = 0)
explosion(target, -1, 0, 2)
sleep(0)
@@ -44,13 +44,13 @@
damage_type = BURN
nodamage = 1
check_armour = "energy"
var/temperature = 300
//var/temperature = 300
on_hit(var/atom/target, var/blocked = 0)//These two could likely check temp protection on the mob
if(istype(target, /mob/living))
var/mob/M = target
M.bodytemperature = temperature
M.bodytemperature = -273
return 1
/obj/item/projectile/meteor
@@ -89,7 +89,7 @@
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: [reagentlist(src)]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Fed [src.name] by [M.name] ([M.ckey]) Reagents: [reagentlist(src)]</font>")
msg_admin_attack("[key_name(user)] fed [key_name(M)] with [src.name] Reagents: [reagentlist(src)] (INTENT: [uppertext(user.a_intent)])")
msg_admin_attack("[key_name(user)] fed [key_name(M)] with [src.name] Reagents: [reagentlist(src)] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
user.visible_message("<span class='danger'>[user] feeds [M] [src].</span>")
+12 -28
View File
@@ -25,31 +25,14 @@
..(loc)
if(newdir)
set_dir(newdir)
switch(dir)
if(NORTH)
forwards = NORTH
backwards = SOUTH
if(SOUTH)
forwards = SOUTH
backwards = NORTH
if(EAST)
forwards = EAST
backwards = WEST
if(WEST)
forwards = WEST
backwards = EAST
if(NORTHEAST)
forwards = EAST
backwards = SOUTH
if(NORTHWEST)
forwards = SOUTH
backwards = WEST
if(SOUTHEAST)
forwards = NORTH
backwards = EAST
if(SOUTHWEST)
forwards = WEST
backwards = NORTH
if(dir & (dir-1)) // Diagonal. Forwards is *away* from dir, curving to the right.
forwards = turn(dir, 135)
backwards = turn(dir, 45)
else
forwards = dir
backwards = turn(dir, 180)
if(on)
operating = 1
setmove()
@@ -57,8 +40,9 @@
/obj/machinery/conveyor/proc/setmove()
if(operating == 1)
movedir = forwards
else
else if(operating == -1)
movedir = backwards
else operating = 0
update()
/obj/machinery/conveyor/proc/update()
@@ -96,8 +80,8 @@
/obj/machinery/conveyor/attackby(var/obj/item/I, mob/user)
if(isrobot(user)) return //Carn: fix for borgs dropping their modules on conveyor belts
if(I.loc != user) return // This should stop mounted modules ending up outside the module.
user.drop_item(src)
user.drop_item(get_turf(src))
return
// attack with hand, move pulled object onto conveyor
+1 -1
View File
@@ -297,7 +297,7 @@ var/obj/machinery/blackbox_recorder/blackbox
if(!feedback) return
round_end_data_gathering() //round_end time logging and some other data processing
establish_db_connection()
establish_db_connection(dbcon)
if(!dbcon.IsConnected()) return
var/round_id
@@ -212,4 +212,4 @@
if(inserted_battery.battery_effect)
user.attack_log += "\[[time_stamp()]\]<font color='red'> Tapped [M.name] ([M.ckey]) with [name] (EFFECT: [inserted_battery.battery_effect.effecttype])</font>"
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Tapped by [user.name] ([user.ckey]) with [name] (EFFECT: [inserted_battery.battery_effect.effecttype])</font>"
msg_admin_attack("[key_name(user)] tapped [key_name(M)] with [name] (EFFECT: [inserted_battery.battery_effect.effecttype])" )
msg_admin_attack("[key_name(user)] tapped [key_name(M)] with [name] (EFFECT: [inserted_battery.battery_effect.effecttype]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)" )
+2 -3
View File
@@ -24,7 +24,7 @@
var/teleport_cooldown = 0 // every index requires a bluespace crystal
var/list/power_options = list(5, 10, 20, 25, 30, 40, 50, 80, 100)
var/teleporting = 0
var/starting_crystals = 3
var/starting_crystals = 0 //Edit this on the map, seriously.
var/max_crystals = 4
var/list/crystals = list()
var/obj/item/device/gps/inserted_gps
@@ -54,8 +54,7 @@
if(crystals.len >= max_crystals)
user << "<span class='warning'>There are not enough crystal slots.</span>"
return
if(!user.drop_item())
return
user.drop_item(src)
crystals += W
W.loc = null
user.visible_message("[user] inserts [W] into \the [src]'s crystal slot.", "<span class='notice'>You insert [W] into \the [src]'s crystal slot.</span>")
@@ -0,0 +1,96 @@
/*
* Contains general purpose procs used with Aurora's web interface and related functions.
*/
/*
* /proc/validate_webint_attributes()
* Used to validate parametres sent to procs that are meant to communicate with the web interface.
* Most commonly in Topic() calls, so that href tomfoolery is negated.
*
* Arguments:
* - var/list/required_attributes - A list of required attributes. This is what the other arguments will be tested against. Cannot be null.
* - var/list/attributes_list - The attributes to be validated, passed in a list form. Can be null.
* - var/attributes_text - The attributes to be validated, passed in a text form. (Formatted according to list2params() convention.)
* This overrides attributes_list if both are present. Can be null.
*
* Returns:
* 1 - if all required attributes are present, and no erronious ones exist.
* 0 - if certain required attributes are missing, or there are extras.
*/
/proc/webint_validate_attributes(var/list/required_attributes, var/list/attributes_list, var/attributes_text)
if (!required_attributes || !istype(required_attributes) || !required_attributes.len)
return 0
if (attributes_text)
attributes_list = params2list(attributes_text)
if (!attributes_list || !attributes_list.len)
return 0
for (var/attribute in attributes_list)
if (!(attribute in required_attributes))
return 0
if (attributes_list[attribute] && required_attributes[attribute])
if (istype(required_attributes, /list))
if (!(attributes_list[attribute] in required_attributes[attribute]))
return 0
else
if (attributes_list[attribute] != required_attributes[attribute])
return 0
return 1
/*
* /proc/webint_start_singlesignon()
* Used to insert a token into the web_sso database and to enable a user to navigate to a page on the website and be automatically logged in. Hashes the user's save file for a unique token. Additional security managed on the website's end.
*
* Arguments:
* - var/user - Must be a mob or a client. The player object that's going to be using the request.
* - var/list/attributes - The attributes to which we route the URL as we call user.process_webint_link().
* Validated here with webint_validate_attributes().
* Must contain the 'location' key.
*
* Returns:
* 0 - if one of the checks is failed and the operation cancelled.
* string - if everything works, it will return the attributes with the added token and ckey value.
*/
/proc/webint_start_singlesignon(var/client/user, var/attributes)
if (!istype(user))
return 0
var/list/permitted_locations = list("user_dashboard", "contract_overview", "contract_details")
if (!webint_validate_attributes(list("location" = permitted_locations, "contract"), attributes_text = attributes))
return 0
var/token = ""
var/list/alphabet = alphabet_uppercase
alphabet.Add(list("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"))
alphabet.Add(list("1", "2", "3", "4", "5", "6", "7", "8", "9", "0"))
for (var/i = 0, i <= 24, i++)
token += alphabet[rand(1, alphabet.len)]
attributes += "&"
attributes += list2params(list("ckey" = user.ckey, "token" = token))
establish_db_connection(dbcon)
if (!dbcon.IsConnected())
alert("An error occured while attempting to connect to the database!")
return 0
var/DBQuery/insert_query = dbcon.NewQuery("INSERT INTO ss13_web_sso (ckey, token, ip, created_at) VALUES (:ckey, :token, :ip, NOW())")
insert_query.Execute(list(":ckey" = user.ckey, ":token" = token, ":ip" = user.address))
if (insert_query.ErrorMsg())
alert("An error occured while trying to upload the session data!")
return 0
if (alert("This will take you to the webpage and log you in. Do you wish to proceed?",,"Yes","No") == "No")
return 0
return attributes