Merge remote-tracking branch 'upstream/master' into progressbars

This commit is contained in:
Yoshax
2016-03-30 00:31:03 +01:00
247 changed files with 3239 additions and 1978 deletions

View File

@@ -16,7 +16,7 @@ var/global/floorIsLava = 0
var/rendered = "<span class=\"log_message\"><span class=\"prefix\">ATTACK:</span> <span class=\"message\">[text]</span></span>"
for(var/client/C in admins)
if((R_ADMIN|R_MOD) & C.holder.rights)
if(C.prefs.toggles & CHAT_ATTACKLOGS)
if(C.is_preference_enabled(/datum/client_preference/admin/show_attack_logs))
var/msg = rendered
C << msg

View File

@@ -1,98 +1,93 @@
//admin verb groups - They can overlap if you so wish. Only one of each verb will exist in the verbs list regardless
var/list/admin_verbs_default = list(
/datum/admins/proc/show_player_panel, /*shows an interface for individual players, with various links (links require additional flags*/
/datum/admins/proc/show_player_panel, //shows an interface for individual players, with various links (links require additional flags,
/client/proc/player_panel,
/client/proc/toggleadminhelpsound, /*toggles whether we hear a sound when adminhelps/PMs are used*/
/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/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_mod_say,
/client/proc/cmd_mentor_check_new_players
// /client/proc/deadchat /*toggles deadchat on/off*/
// /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*/
/client/proc/player_panel_new, //shows an interface for all players, with links to various panels,
/datum/admins/proc/set_tcrystals,
/datum/admins/proc/add_tcrystals,
/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/force_mode_latespawn, /*Force the mode to try a latespawn proc*/
/datum/admins/proc/force_antag_latespawn, /*Force a specific template to try a latespawn proc*/
/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.*/
/client/proc/colorooc, /*allows us to set a custom colour for everythign we say in ooc*/
/client/proc/admin_ghost, /*allows us to ghost/reenter body at will*/
/client/proc/toggle_view_range, /*changes how far we can see*/
/datum/admins/proc/view_txt_log, /*shows the server log (diary) for today*/
/datum/admins/proc/view_atk_log, /*shows the server combat-log, doesn't do anything presently*/
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
/client/proc/cmd_admin_subtle_message, /*send an message to somebody as a 'voice in their head'*/
/client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/
/client/proc/cmd_admin_check_contents, /*displays the contents of an instance*/
/datum/admins/proc/access_news_network, /*allows access of newscasters*/
/client/proc/giveruntimelog, /*allows us to give access to runtime logs to somebody*/
/client/proc/getserverlog, /*allows us to fetch server logs (diary) for other days*/
/client/proc/jumptocoord, /*we ghost and jump to a coordinate*/
/client/proc/Getmob, /*teleports a mob to our location*/
/client/proc/Getkey, /*teleports a mob with a certain ckey to our location*/
// /client/proc/sendmob, /*sends a mob somewhere*/ -Removed due to it needing two sorting procs to work, which were executed every time an admin right-clicked. ~Errorage
/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/force_mode_latespawn, //Force the mode to try a latespawn proc,
/datum/admins/proc/force_antag_latespawn, //Force a specific template to try a latespawn proc,
/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.,
/client/proc/colorooc, //allows us to set a custom colour for everythign we say in ooc,
/client/proc/admin_ghost, //allows us to ghost/reenter body at will,
/client/proc/toggle_view_range, //changes how far we can see,
/datum/admins/proc/view_txt_log, //shows the server log (diary) for today,
/datum/admins/proc/view_atk_log, //shows the server combat-log, doesn't do anything presently,
/client/proc/cmd_admin_pm_context, //right-click adminPM interface,
/client/proc/cmd_admin_pm_panel, //admin-pm list,
/client/proc/cmd_admin_subtle_message, //send an message to somebody as a 'voice in their head',
/client/proc/cmd_admin_delete, //delete an instance/object/mob/etc,
/client/proc/cmd_admin_check_contents, //displays the contents of an instance,
/datum/admins/proc/access_news_network, //allows access of newscasters,
/client/proc/giveruntimelog, //allows us to give access to runtime logs to somebody,
/client/proc/getserverlog, //allows us to fetch server logs (diary) for other days,
/client/proc/jumptocoord, //we ghost and jump to a coordinate,
/client/proc/Getmob, //teleports a mob to our location,
/client/proc/Getkey, //teleports a mob with a certain ckey to our location,
// /client/proc/sendmob, //sends a mob somewhere, -Removed due to it needing two sorting procs to work, which were executed every time an admin right-clicked. ~Errorage,
/client/proc/Jump,
/client/proc/jumptokey, /*allows us to jump to the location of a mob with a certain ckey*/
/client/proc/jumptomob, /*allows us to jump to a specific mob*/
/client/proc/jumptoturf, /*allows us to jump to a specific turf*/
/client/proc/admin_call_shuttle, /*allows us to call the emergency shuttle*/
/client/proc/admin_cancel_shuttle, /*allows us to cancel the emergency shuttle, sending it back to centcomm*/
/client/proc/cmd_admin_direct_narrate, /*send text directly to a player with no padding. Useful for narratives and fluff-text*/
/client/proc/cmd_admin_world_narrate, /*sends text to all players with no padding*/
/client/proc/jumptokey, //allows us to jump to the location of a mob with a certain ckey,
/client/proc/jumptomob, //allows us to jump to a specific mob,
/client/proc/jumptoturf, //allows us to jump to a specific turf,
/client/proc/admin_call_shuttle, //allows us to call the emergency shuttle,
/client/proc/admin_cancel_shuttle, //allows us to cancel the emergency shuttle, sending it back to centcomm,
/client/proc/cmd_admin_direct_narrate, //send text directly to a player with no padding. Useful for narratives and fluff-text,
/client/proc/cmd_admin_world_narrate, //sends text to all players with no padding,
/client/proc/cmd_admin_create_centcom_report,
/client/proc/check_words, /*displays cult-words*/
/client/proc/check_ai_laws, /*shows AI and borg laws*/
/client/proc/rename_silicon, /*properly renames silicons*/
/client/proc/manage_silicon_laws, /* Allows viewing and editing silicon laws. */
/client/proc/check_words, //displays cult-words,
/client/proc/check_ai_laws, //shows AI and borg laws,
/client/proc/rename_silicon, //properly renames silicons,
/client/proc/manage_silicon_laws, // Allows viewing and editing silicon laws. ,
/client/proc/check_antagonists,
/client/proc/admin_memo, /*admin memo system. show/delete/write. +SERVER needed to delete admin memos of others*/
/client/proc/dsay, /*talk in deadchat using our ckey/fakekey*/
/client/proc/toggleprayers, /*toggles prayers on/off*/
// /client/proc/toggle_hear_deadcast, /*toggles whether we hear deadchat*/
/client/proc/toggle_hear_radio, /*toggles whether we hear the radio*/
/client/proc/investigate_show, /*various admintools for investigation. Such as a singulo grief-log*/
/client/proc/admin_memo, //admin memo system. show/delete/write. +SERVER needed to delete admin memos of others,
/client/proc/dsay, //talk in deadchat using our ckey/fakekey,
// /client/proc/toggle_hear_deadcast, //toggles whether we hear deadchat,
/client/proc/investigate_show, //various admintools for investigation. Such as a singulo grief-log,
/client/proc/secrets,
/datum/admins/proc/toggleooc, /*toggles ooc on/off for everyone*/
/datum/admins/proc/togglelooc, /*toggles looc on/off for everyone*/
/datum/admins/proc/toggleoocdead, /*toggles ooc on/off for everyone who is dead*/
/datum/admins/proc/togglehubvisibility, /*toggles visibility on the BYOND Hub.*/
/datum/admins/proc/toggledsay, /*toggles dsay on/off for everyone*/
/client/proc/game_panel, /*game panel, allows to change game-mode etc*/
/client/proc/cmd_admin_say, /*admin-only ooc chat*/
/datum/admins/proc/toggleooc, //toggles ooc on/off for everyone,
/datum/admins/proc/togglelooc, //toggles looc on/off for everyone,
/datum/admins/proc/toggleoocdead, //toggles ooc on/off for everyone who is dead,
/datum/admins/proc/togglehubvisibility, //toggles visibility on the BYOND Hub.,
/datum/admins/proc/toggledsay, //toggles dsay on/off for everyone,
/client/proc/game_panel, //game panel, allows to change game-mode etc,
/client/proc/cmd_admin_say, //admin-only ooc chat,
/datum/admins/proc/PlayerNotes,
/client/proc/cmd_mod_say,
/datum/admins/proc/show_player_info,
/client/proc/free_slot, /*frees slot for chosen job*/
/client/proc/free_slot, //frees slot for chosen job,
/client/proc/cmd_admin_change_custom_event,
/client/proc/cmd_admin_rejuvenate,
/client/proc/toggleattacklogs,
/client/proc/toggledebuglogs,
/client/proc/toggleghostwriters,
/client/proc/toggledrones,
/datum/admins/proc/show_skills,
/client/proc/check_customitem_activity,
/client/proc/man_up,
/client/proc/global_man_up,
/client/proc/response_team, // Response Teams admin verb
/client/proc/response_team, // Response Teams admin verb,
/client/proc/toggle_antagHUD_use,
/client/proc/toggle_antagHUD_restrictions,
/client/proc/allow_character_respawn, /* Allows a ghost to respawn */
/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 */
/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 ,
/client/proc/change_security_level,
/client/proc/view_chemical_reaction_logs,
/client/proc/makePAI,
@@ -131,7 +126,7 @@ var/list/admin_verbs_spawn = list(
/datum/admins/proc/spawn_custom_item,
/datum/admins/proc/check_custom_items,
/datum/admins/proc/spawn_plant,
/datum/admins/proc/spawn_atom, /*allows us to spawn instances*/
/datum/admins/proc/spawn_atom, //allows us to spawn instances,
/client/proc/respawn_character,
/client/proc/virus2_editor,
/client/proc/spawn_chemdisp_cartridge
@@ -149,7 +144,7 @@ var/list/admin_verbs_server = list(
/datum/admins/proc/immreboot,
/client/proc/everyone_random,
/datum/admins/proc/toggleAI,
/client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/
/client/proc/cmd_admin_delete, //delete an instance/object/mob/etc,
/client/proc/cmd_debug_del_all,
/datum/admins/proc/adrev,
/datum/admins/proc/adspawn,
@@ -161,7 +156,7 @@ var/list/admin_verbs_server = list(
/client/proc/nanomapgen_DumpImage
)
var/list/admin_verbs_debug = list(
/client/proc/getruntimelog, /*allows us to access runtime logs to somebody*/
/client/proc/getruntimelog, //allows us to access runtime logs to somebody,
/client/proc/cmd_admin_list_open_jobs,
/client/proc/Debug2,
/client/proc/kill_air,
@@ -187,14 +182,13 @@ var/list/admin_verbs_debug = list(
/client/proc/enable_debug_verbs,
/client/proc/callproc,
/client/proc/callproc_target,
/client/proc/toggledebuglogs,
/client/proc/SDQL_query,
/client/proc/SDQL2_query,
/client/proc/Jump,
/client/proc/jumptomob,
/client/proc/jumptocoord,
/client/proc/dsay,
/client/proc/admin_ghost /*allows us to ghost/reenter body at will*/
/client/proc/admin_ghost //allows us to ghost/reenter body at will,
)
var/list/admin_verbs_paranoid_debug = list(
@@ -218,8 +212,6 @@ var/list/admin_verbs_rejuv = list(
var/list/admin_verbs_hideable = list(
/client/proc/deadmin_self,
// /client/proc/deadchat,
/client/proc/toggleprayers,
/client/proc/toggle_hear_radio,
/datum/admins/proc/show_traitor_panel,
/datum/admins/proc/toggleenter,
/datum/admins/proc/toggleguests,
@@ -288,14 +280,12 @@ var/list/admin_verbs_hideable = list(
/datum/admins/proc/set_tcrystals
)
var/list/admin_verbs_mod = list(
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
/client/proc/debug_variables, /*allows us to -see- the variables of any instance in the game.*/
/client/proc/toggledebuglogs,
/client/proc/cmd_admin_pm_context, //right-click adminPM interface,
/client/proc/cmd_admin_pm_panel, //admin-pm list,
/client/proc/debug_variables, //allows us to -see- the variables of any instance in the game.,
/datum/admins/proc/PlayerNotes,
/client/proc/admin_ghost, /*allows us to ghost/reenter body at will*/
/client/proc/admin_ghost, //allows us to ghost/reenter body at will,
/client/proc/cmd_mod_say,
/client/proc/toggleattacklogs,
/datum/admins/proc/show_player_info,
/client/proc/player_panel_new,
/client/proc/dsay,
@@ -304,10 +294,10 @@ var/list/admin_verbs_mod = list(
/client/proc/check_antagonists,
/client/proc/aooc,
/client/proc/jobbans,
/client/proc/cmd_admin_subtle_message, /*send an message to somebody as a 'voice in their head'*/
/client/proc/cmd_admin_subtle_message, //send an message to somebody as a 'voice in their head',
/datum/admins/proc/paralyze_mob,
/client/proc/cmd_admin_direct_narrate,
/client/proc/allow_character_respawn /* Allows a ghost to respawn */
/client/proc/allow_character_respawn // Allows a ghost to respawn ,
)
var/list/admin_verbs_mentor = list(
@@ -903,17 +893,6 @@ var/list/admin_verbs_mentor = list(
message_admins("A job slot for [job] has been opened by [key_name_admin(usr)]")
return
/client/proc/toggleattacklogs()
set name = "Toggle Attack Log Messages"
set category = "Preferences"
prefs.toggles ^= CHAT_ATTACKLOGS
if (prefs.toggles & CHAT_ATTACKLOGS)
usr << "You now will get attack log messages"
else
usr << "You now won't get attack log messages"
/client/proc/toggleghostwriters()
set name = "Toggle ghost writers"
set category = "Server"
@@ -942,17 +921,6 @@ var/list/admin_verbs_mentor = list(
src << "<b>Enabled maint drones.</b>"
message_admins("Admin [key_name_admin(usr)] has enabled maint drones.", 1)
/client/proc/toggledebuglogs()
set name = "Toggle Debug Log Messages"
set category = "Preferences"
prefs.toggles ^= CHAT_DEBUGLOGS
if (prefs.toggles & CHAT_DEBUGLOGS)
usr << "You now will get debug log messages"
else
usr << "You now won't get debug log messages"
/client/proc/man_up(mob/T as mob in mob_list)
set category = "Fun"
set name = "Man Up"

View File

@@ -100,7 +100,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
if((R_ADMIN|R_MOD|R_MENTOR|R_SERVER) & X.holder.rights)
if(X.is_afk())
admin_number_afk++
if(X.prefs.toggles & SOUND_ADMINHELP)
if(X.is_preference_enabled(/datum/client_preference/holder/play_adminhelp_ping))
X << 'sound/effects/adminhelp.ogg'
if(X.holder.rights == R_MENTOR)
X << mentor_msg // Mentors won't see coloring of names on people with special_roles (Antags, etc.)

View File

@@ -104,7 +104,7 @@
//play the recieving admin the adminhelp sound (if they have them enabled)
//non-admins shouldn't be able to disable this
if(C.prefs && C.prefs.toggles & SOUND_ADMINHELP)
if(C.is_preference_enabled(/datum/client_preference/holder/play_adminhelp_ping))
C << 'sound/effects/adminhelp.ogg'
log_admin("PM: [key_name(src)]->[key_name(C)]: [msg]")

View File

@@ -8,11 +8,11 @@
if(!src.mob)
return
if(prefs.muted & MUTE_DEADCHAT)
src << "\red You cannot send DSAY messages (muted)."
src << "<span class='warning'>You cannot send DSAY messages (muted).</span>"
return
if(!(prefs.toggles & CHAT_DEAD))
src << "\red You have deadchat muted."
if(!is_preference_enabled(/datum/client_preference/show_dsay))
src << "<span class='warning'>You have deadchat muted.</span>"
return
if (src.handle_spam_prevention(msg,MUTE_DEADCHAT))

View File

@@ -1,7 +1,7 @@
var/list/forbidden_varedit_object_types = list(
/datum/admins, //Admins editing their own admin-power object? Yup, sounds like a good idea.
/obj/machinery/blackbox_recorder, //Prevents people messing with feedback gathering
/datum/feedback_variable //Prevents people messing with feedback gathering
/datum/admins, //Admins editing their own admin-power object? Yup, sounds like a good idea,
/obj/machinery/blackbox_recorder, //Prevents people messing with feedback gathering,
/datum/feedback_variable //Prevents people messing with feedback gathering,
)
var/list/VVlocked = list("vars", "client", "virus", "viruses", "cuffed", "last_eaten", "unlock_content", "bound_x", "bound_y", "step_x", "step_y", "force_ending")

View File

@@ -16,7 +16,7 @@ var/list/sounds_cache = list()
log_admin("[key_name(src)] played sound [S]")
message_admins("[key_name_admin(src)] played sound [S]", 1)
for(var/mob/M in player_list)
if(M.client.prefs.toggles & SOUND_MIDI)
if(M.is_preference_enabled(/datum/client_preference/play_admin_midis))
M << uploaded_sound
feedback_add_details("admin_verb","PGS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

View File

@@ -21,7 +21,7 @@
for(var/client/C in admins)
if(R_ADMIN & C.holder.rights)
if(C.prefs.toggles & CHAT_PRAYER)
if(C.is_preference_enabled(/datum/client_preference/admin/show_chat_prayers))
C << msg
usr << "Your prayers have been received by the gods."

View File

@@ -234,9 +234,9 @@ Ccomp's first proc.
var/list/mobs = list()
var/list/ghosts = list()
var/list/sortmob = sortAtom(mob_list) // get the mob list.
/var/any=0
for(var/mob/observer/dead/M in sortmob)
var/list/sortmob = sortAtom(mob_list) // get the mob list.
var/any=0
for(var/mob/observer/dead/M in sortmob)
mobs.Add(M) //filter it where it's only ghosts
any = 1 //if no ghosts show up, any will just be 0
if(!any)

View File

@@ -94,7 +94,7 @@
..()
on_found(mob/finder as mob)
on_found(mob/living/finder as mob)
if(armed)
finder.visible_message("<span class='warning'>[finder] accidentally sets off [src], breaking their fingers.</span>", \
"<span class='warning'>You accidentally trigger [src]!</span>")

View File

@@ -21,7 +21,7 @@
/datum/category_item/player_setup_item/general/basic/sanitize_character()
if(!pref.species) pref.species = "Human"
var/datum/species/S = all_species[pref.species]
var/datum/species/S = all_species[pref.species ? pref.species : "Human"]
pref.age = sanitize_integer(pref.age, S.min_age, S.max_age, initial(pref.age))
pref.gender = sanitize_inlist(pref.gender, valid_player_genders, pick(valid_player_genders))
pref.real_name = sanitize_name(pref.real_name, pref.species)

View File

@@ -1,38 +1,126 @@
/datum/preferences
var/preferences_enabled = null
var/preferences_disabled = null
/datum/category_item/player_setup_item/player_global/settings
name = "Settings"
sort_order = 2
/datum/category_item/player_setup_item/player_global/settings/load_preferences(var/savefile/S)
S["lastchangelog"] >> pref.lastchangelog
S["default_slot"] >> pref.default_slot
S["toggles"] >> pref.toggles
S["lastchangelog"] >> pref.lastchangelog
S["default_slot"] >> pref.default_slot
S["preferences"] >> pref.preferences_enabled
S["preferences_disabled"] >> pref.preferences_disabled
/datum/category_item/player_setup_item/player_global/settings/save_preferences(var/savefile/S)
S["lastchangelog"] << pref.lastchangelog
S["default_slot"] << pref.default_slot
S["toggles"] << pref.toggles
S["lastchangelog"] << pref.lastchangelog
S["default_slot"] << pref.default_slot
S["preferences"] << pref.preferences_enabled
S["preferences_disabled"] << pref.preferences_disabled
/datum/category_item/player_setup_item/player_global/settings/sanitize_preferences()
// Ensure our preferences are lists.
if(!istype(pref.preferences_enabled, /list))
pref.preferences_enabled = list()
if(!istype(pref.preferences_disabled, /list))
pref.preferences_disabled = list()
// Arrange preferences that have never been enabled/disabled.
var/list/client_preference_keys = list()
for(var/cp in get_client_preferences())
var/datum/client_preference/client_pref = cp
client_preference_keys += client_pref.key
if((client_pref.key in pref.preferences_enabled) || (client_pref.key in pref.preferences_disabled))
continue
if(client_pref.enabled_by_default)
pref.preferences_enabled += client_pref.key
else
pref.preferences_disabled += client_pref.key
// Clean out preferences that no longer exist.
for(var/key in pref.preferences_enabled)
if(!(key in client_preference_keys))
pref.preferences_enabled -= key
for(var/key in pref.preferences_disabled)
if(!(key in client_preference_keys))
pref.preferences_disabled -= key
pref.lastchangelog = sanitize_text(pref.lastchangelog, initial(pref.lastchangelog))
pref.default_slot = sanitize_integer(pref.default_slot, 1, config.character_slots, initial(pref.default_slot))
pref.toggles = sanitize_integer(pref.toggles, 0, 65535, initial(pref.toggles))
/datum/category_item/player_setup_item/player_global/settings/content(var/mob/user)
. += "<b>Play admin midis:</b> <a href='?src=\ref[src];toggle=[SOUND_MIDI]'><b>[(pref.toggles & SOUND_MIDI) ? "Yes" : "No"]</b></a><br>"
. += "<b>Play lobby music:</b> <a href='?src=\ref[src];toggle=[SOUND_LOBBY]'><b>[(pref.toggles & SOUND_LOBBY) ? "Yes" : "No"]</b></a><br>"
. += "<b>Ghost ears:</b> <a href='?src=\ref[src];toggle=[CHAT_GHOSTEARS]'><b>[(pref.toggles & CHAT_GHOSTEARS) ? "All Speech" : "Nearest Creatures"]</b></a><br>"
. += "<b>Ghost sight:</b> <a href='?src=\ref[src];toggle=[CHAT_GHOSTSIGHT]'><b>[(pref.toggles & CHAT_GHOSTSIGHT) ? "All Emotes" : "Nearest Creatures"]</b></a><br>"
. += "<b>Ghost radio:</b> <a href='?src=\ref[src];toggle=[CHAT_GHOSTRADIO]'><b>[(pref.toggles & CHAT_GHOSTRADIO) ? "All Chatter" : "Nearest Speakers"]</b></a><br>"
. = list()
. += "<b>Preferences</b><br>"
. += "<table>"
var/mob/pref_mob = preference_mob()
for(var/cp in get_client_preferences())
var/datum/client_preference/client_pref = cp
if(!client_pref.may_toggle(pref_mob))
continue
. += "<tr><td>[client_pref.description]: </td>"
if(pref_mob.is_preference_enabled(client_pref.key))
. += "<td><b>[client_pref.enabled_description]</b></td> <td><a href='?src=\ref[src];toggle_off=[client_pref.key]'>[client_pref.disabled_description]</a></td>"
else
. += "<td><a href='?src=\ref[src];toggle_on=[client_pref.key]'>[client_pref.enabled_description]</a></td> <td><b>[client_pref.disabled_description]</b></td>"
. += "</tr>"
. += "</table>"
return jointext(., "")
/datum/category_item/player_setup_item/player_global/settings/OnTopic(var/href,var/list/href_list, var/mob/user)
if(href_list["toggle"])
var/toggle_flag = text2num(href_list["toggle"])
pref.toggles ^= toggle_flag
if(toggle_flag == SOUND_LOBBY && isnewplayer(user))
if(pref.toggles & SOUND_LOBBY)
user << sound(ticker.login_music, repeat = 0, wait = 0, volume = 85, channel = 1)
else
user << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1)
var/mob/pref_mob = preference_mob()
if(href_list["toggle_on"])
. = pref_mob.set_preference(href_list["toggle_on"], TRUE)
else if(href_list["toggle_off"])
. = pref_mob.set_preference(href_list["toggle_off"], FALSE)
if(.)
return TOPIC_REFRESH
return ..()
/client/proc/is_preference_enabled(var/preference)
if(ispath(preference))
var/datum/client_preference/cp = get_client_preference_by_type(preference)
preference = cp.key
return (preference in prefs.preferences_enabled)
/client/proc/set_preference(var/preference, var/set_preference)
var/datum/client_preference/cp
if(ispath(preference))
cp = get_client_preference_by_type(preference)
else
cp = get_client_preference_by_key(preference)
if(!cp)
return FALSE
var/enabled
if(set_preference && !(preference in prefs.preferences_enabled))
prefs.preferences_enabled += preference
prefs.preferences_disabled -= preference
enabled = TRUE
. = TRUE
else if(!set_preference && (preference in prefs.preferences_enabled))
prefs.preferences_enabled -= preference
prefs.preferences_disabled |= preference
enabled = FALSE
. = TRUE
if(.)
cp.toggled(mob, enabled)
/mob/proc/is_preference_enabled(var/preference)
if(!client)
return FALSE
return client.is_preference_enabled(preference)
/mob/proc/set_preference(var/preference, var/set_preference)
if(!client)
return FALSE
if(!client.prefs)
log_debug("Client prefs found to be null for mob [src] and client [ckey], this should be investigated.")
return FALSE
return client.set_preference(preference, set_preference)

View File

@@ -124,7 +124,6 @@ var/list/_client_preferences_by_type
key = "SHOW_PROGRESS"
enabled_description = "Show"
disabled_description = "Hide"
/********************
* Admin Preferences *
********************/

View File

@@ -28,6 +28,10 @@
display_name = "armband, science"
path = /obj/item/clothing/accessory/armband/science
/datum/gear/accessory/wallet
display_name = "wallet"
path = /obj/item/weapon/storage/wallet/random
/datum/gear/accessory/holster
display_name = "holster, armpit"
path = /obj/item/clothing/accessory/holster/armpit

View File

@@ -212,13 +212,13 @@
/datum/category_item/player_setup_item/Topic(var/href,var/list/href_list)
if(..())
return 1
var/mob/user = usr
if(!user.client)
var/mob/pref_mob = preference_mob()
if(!pref_mob || !pref_mob.client)
return 1
. = OnTopic(href, href_list, user)
. = OnTopic(href, href_list, usr)
if(. == TOPIC_REFRESH)
user.client.prefs.ShowChoices(user)
pref_mob.client.prefs.ShowChoices(usr)
/datum/category_item/player_setup_item/CanUseTopic(var/mob/user)
return 1
@@ -227,5 +227,11 @@
return TOPIC_NOACTION
/datum/category_item/player_setup_item/proc/preference_mob()
if(pref && pref.client && pref.client.mob)
if(!pref.client)
for(var/client/C)
if(C.ckey == pref.client_ckey)
pref.client = C
break
if(pref.client)
return pref.client.mob

View File

@@ -19,7 +19,6 @@ datum/preferences
var/ooccolor = "#010000" //Whatever this is set to acts as 'reset' color and is thus unusable as an actual custom color
var/be_special = 0 //Special role selection
var/UI_style = "Midnight"
var/toggles = TOGGLES_DEFAULT
var/UI_style_color = "#ffffff"
var/UI_style_alpha = 255
@@ -110,11 +109,12 @@ datum/preferences
// OOC Metadata:
var/metadata = ""
var/client/client = null
var/client_ckey = null
// Communicator identity data
var/communicator_visibility = 0
var/client/client = null
var/datum/category_collection/player_setup_collection/player_setup
/datum/preferences/New(client/C)
@@ -127,6 +127,7 @@ datum/preferences
if(istype(C))
client = C
client_ckey = C.ckey
if(!IsGuestKey(C.key))
load_path(C.ckey)
if(load_preferences())
@@ -187,6 +188,12 @@ datum/preferences
/datum/preferences/proc/ShowChoices(mob/user)
if(!user || !user.client) return
if(!get_mob_by_key(client_ckey))
user << "<span class='danger'>No mob exists for the given client!</span>"
close_load_dialog(user)
return
var/dat = "<html><body><center>"
if(path)
@@ -204,7 +211,7 @@ datum/preferences
dat += player_setup.content(user)
dat += "</html></body>"
user << browse(dat, "window=preferences;size=625x736")
user << browse(dat, "window=preferences;size=635x736")
/datum/preferences/proc/process_link(mob/user, list/href_list)
if(!user) return

View File

@@ -1,159 +0,0 @@
//toggles
/client/verb/toggle_ghost_ears()
set name = "Show/Hide GhostEars"
set category = "Preferences"
set desc = ".Toggle Between seeing all mob speech, and only speech of nearby mobs"
prefs.toggles ^= CHAT_GHOSTEARS
src << "As a ghost, you will now [(prefs.toggles & CHAT_GHOSTEARS) ? "see all speech in the world" : "only see speech from nearby mobs"]."
prefs.save_preferences()
feedback_add_details("admin_verb","TGE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/toggle_ghost_sight()
set name = "Show/Hide GhostSight"
set category = "Preferences"
set desc = ".Toggle Between seeing all mob emotes, and only emotes of nearby mobs"
prefs.toggles ^= CHAT_GHOSTSIGHT
src << "As a ghost, you will now [(prefs.toggles & CHAT_GHOSTSIGHT) ? "see all emotes in the world" : "only see emotes from nearby mobs"]."
prefs.save_preferences()
feedback_add_details("admin_verb","TGS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/toggle_ghost_radio()
set name = "Enable/Disable GhostRadio"
set category = "Preferences"
set desc = ".Toggle between hearing all radio chatter, or only from nearby speakers"
prefs.toggles ^= CHAT_GHOSTRADIO
src << "As a ghost, you will now [(prefs.toggles & CHAT_GHOSTRADIO) ? "hear all radio chat in the world" : "only hear from nearby speakers"]."
prefs.save_preferences()
feedback_add_details("admin_verb","TGR")
/client/proc/toggle_hear_radio()
set name = "Show/Hide RadioChatter"
set category = "Preferences"
set desc = "Toggle seeing radiochatter from radios and speakers"
if(!holder) return
prefs.toggles ^= CHAT_RADIO
prefs.save_preferences()
usr << "You will [(prefs.toggles & CHAT_RADIO) ? "now" : "no longer"] see radio chatter from radios or speakers"
feedback_add_details("admin_verb","THR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/toggleadminhelpsound()
set name = "Hear/Silence Adminhelps"
set category = "Preferences"
set desc = "Toggle hearing a notification when admin PMs are recieved"
if(!holder) return
prefs.toggles ^= SOUND_ADMINHELP
prefs.save_preferences()
usr << "You will [(prefs.toggles & SOUND_ADMINHELP) ? "now" : "no longer"] hear a sound when adminhelps arrive."
feedback_add_details("admin_verb","AHS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/deadchat() // Deadchat toggle is usable by anyone.
set name = "Show/Hide Deadchat"
set category = "Preferences"
set desc ="Toggles seeing deadchat"
prefs.toggles ^= CHAT_DEAD
prefs.save_preferences()
if(src.holder)
src << "You will [(prefs.toggles & CHAT_DEAD) ? "now" : "no longer"] see deadchat."
else
src << "As a ghost, you will [(prefs.toggles & CHAT_DEAD) ? "now" : "no longer"] see deadchat."
feedback_add_details("admin_verb","TDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/toggleprayers()
set name = "Show/Hide Prayers"
set category = "Preferences"
set desc = "Toggles seeing prayers"
prefs.toggles ^= CHAT_PRAYER
prefs.save_preferences()
src << "You will [(prefs.toggles & CHAT_PRAYER) ? "now" : "no longer"] see prayerchat."
feedback_add_details("admin_verb","TP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/toggletitlemusic()
set name = "Hear/Silence LobbyMusic"
set category = "Preferences"
set desc = "Toggles hearing the GameLobby music"
prefs.toggles ^= SOUND_LOBBY
prefs.save_preferences()
if(prefs.toggles & SOUND_LOBBY)
src << "You will now hear music in the game lobby."
if(istype(mob, /mob/new_player))
playtitlemusic()
else
src << "You will no longer hear music in the game lobby."
if(istype(mob, /mob/new_player))
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // stop the jamsz
feedback_add_details("admin_verb","TLobby") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/togglemidis()
set name = "Hear/Silence Midis"
set category = "Preferences"
set desc = "Toggles hearing sounds uploaded by admins"
prefs.toggles ^= SOUND_MIDI
prefs.save_preferences()
if(prefs.toggles & SOUND_MIDI)
src << "You will now hear any sounds uploaded by admins."
var/sound/break_sound = sound(null, repeat = 0, wait = 0, channel = 777)
break_sound.priority = 250
src << break_sound //breaks the client's sound output on channel 777
else
src << "You will no longer hear sounds uploaded by admins; any currently playing midis have been disabled."
feedback_add_details("admin_verb","TMidi") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/listen_ooc()
set name = "Show/Hide OOC"
set category = "Preferences"
set desc = "Toggles seeing OutOfCharacter chat"
prefs.toggles ^= CHAT_OOC
prefs.save_preferences()
src << "You will [(prefs.toggles & CHAT_OOC) ? "now" : "no longer"] see messages on the OOC channel."
feedback_add_details("admin_verb","TOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/listen_looc()
set name = "Show/Hide LOOC"
set category = "Preferences"
set desc = "Toggles seeing Local OutOfCharacter chat"
prefs.toggles ^= CHAT_LOOC
prefs.save_preferences()
src << "You will [(prefs.toggles & CHAT_LOOC) ? "now" : "no longer"] see messages on the LOOC channel."
feedback_add_details("admin_verb","TLOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/toggle_chattags()
set name = "Show/Hide Chat Tags"
set category = "Preferences"
set desc = "Toggles seeing chat tags/icons"
prefs.toggles ^= CHAT_NOICONS
prefs.save_preferences()
src << "You will [!(prefs.toggles & CHAT_NOICONS) ? "now" : "no longer"] see chat tag icons."
feedback_add_details("admin_verb","TCTAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/Toggle_Soundscape() //All new ambience should be added here so it works with this verb until someone better at things comes up with a fix that isn't awful
set name = "Hear/Silence Ambience"
set category = "Preferences"
set desc = "Toggles hearing ambient sound effects"
prefs.toggles ^= SOUND_AMBIENCE
prefs.save_preferences()
if(prefs.toggles & SOUND_AMBIENCE)
src << "You will now hear ambient sounds."
else
src << "You will no longer hear ambient sounds."
src << sound(null, repeat = 0, wait = 0, volume = 0, channel = 1)
src << sound(null, repeat = 0, wait = 0, volume = 0, channel = 2)
feedback_add_details("admin_verb","TAmbi") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
//be special
/client/verb/toggle_be_special(role in be_special_flags)
set name = "Toggle SpecialRole Candidacy"
set category = "Preferences"
set desc = "Toggles which special roles you would like to be a candidate for, during events."
var/role_flag = be_special_flags[role]
if(!role_flag) return
prefs.be_special ^= role_flag
prefs.save_preferences()
src << "You will [(prefs.be_special & role_flag) ? "now" : "no longer"] be considered for [role] events (where possible)."
feedback_add_details("admin_verb","TBeSpecial") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

View File

@@ -25,21 +25,14 @@
flags_inv = HIDEEARS
siemens_coefficient = 0.7
action_button_name = "Toggle Visor"
var/flipped = 0 //Piggybacked from cap flipping.
/obj/item/clothing/head/helmet/riot/dropped()
src.icon_state = initial(icon_state)
src.flipped=0
..()
/obj/item/clothing/head/helmet/riot/attack_self(mob/user)
src.flipped = !src.flipped
if(src.flipped)
icon_state = "[icon_state]up"
user << "You flip the visor up."
/obj/item/clothing/head/helmet/riot/attack_self(mob/user as mob)
if(src.icon_state == initial(icon_state))
src.icon_state = "[icon_state]up"
user << "You raise the visor on the riot helmet."
else
src.icon_state = initial(icon_state)
user << "You flip the visor down."
user << "You lower the visor on the riot helmet."
update_clothing_icon() //so our mob-overlays update
/obj/item/clothing/head/helmet/laserproof

View File

@@ -76,7 +76,7 @@
var/turf/location = src.loc
if(istype(location, /mob/))
var/mob/living/carbon/human/M = location
if(M.l_hand == src || M.r_hand == src || M.head == src)
if(M.item_is_in_hands(src) || M.head == src)
location = M.loc
if (istype(location, /turf))

View File

@@ -22,7 +22,7 @@
say_verbs = list("mumbles", "says")
// Clumsy folks can't take the mask off themselves.
/obj/item/clothing/mask/muzzle/attack_hand(mob/user as mob)
/obj/item/clothing/mask/muzzle/attack_hand(mob/living/user as mob)
if(user.wear_mask == src && !user.IsAdvancedToolUser())
return 0
..()

View File

@@ -3,6 +3,7 @@
desc = "These will protect your legs and feet."
body_parts_covered = LEGS|FEET
slowdown = 0 //Shoes have a slowdown of -1, so this needs to be 0 in order for it to effectively be 1 slowdown.
species_restricted = null //Unathi and Taj can wear leg armor now
w_class = 3
/obj/item/clothing/shoes/leg_guard/mob_can_equip(var/mob/living/carbon/human/H, slot, disable_warning = 0)
@@ -25,14 +26,14 @@
desc = "These will protect your legs and feet from ballistic weapons."
icon_state = "leg_guards_bullet"
siemens_coefficient = 0.7
armor = list(melee = 10, bullet = 10, laser = 80, energy = 50, bomb = 0, bio = 0, rad = 0)
armor = list(melee = 10, bullet = 80, laser = 10, energy = 10, bomb = 0, bio = 0, rad = 0)
/obj/item/clothing/shoes/leg_guard/riot
name = "riot leg guards"
desc = "These will protect your legs and feet from close combat weapons."
icon_state = "leg_guards_riot"
siemens_coefficient = 0.5
armor = list(melee = 10, bullet = 10, laser = 80, energy = 50, bomb = 0, bio = 0, rad = 0)
armor = list(melee = 80, bullet = 10, laser = 10, energy = 10, bomb = 0, bio = 0, rad = 0)
/obj/item/clothing/shoes/leg_guard/combat
name = "combat leg guards"

View File

@@ -139,7 +139,7 @@
list("dexalin plus", "dexalinp", 0, 80),
list("antibiotics", "spaceacillin", 0, 80),
list("antitoxins", "anti_toxin", 0, 80),
list("nutrients", "nutriment", 0, 80),
list("nutrients", "glucose", 0, 80),
list("hyronalin", "hyronalin", 0, 80),
list("radium", "radium", 0, 80)
)
@@ -156,7 +156,7 @@
list("dexalin plus", "dexalinp", 0, 20),
list("antibiotics", "spaceacillin", 0, 20),
list("antitoxins", "anti_toxin", 0, 20),
list("nutrients", "nutriment", 0, 80),
list("nutrients", "glucose", 0, 80),
list("hyronalin", "hyronalin", 0, 20),
list("radium", "radium", 0, 20)
)
@@ -245,7 +245,7 @@
list("synaptizine", "synaptizine", 0, 30),
list("hyperzine", "hyperzine", 0, 30),
list("oxycodone", "oxycodone", 0, 30),
list("nutrients", "nutriment", 0, 80),
list("nutrients", "glucose", 0, 80),
)
interface_name = "combat chem dispenser"

View File

@@ -1,6 +1,6 @@
/obj/item/weapon/rig/attackby(obj/item/W as obj, mob/user as mob)
/obj/item/weapon/rig/attackby(obj/item/W as obj, mob/living/user as mob)
if(!istype(user,/mob/living)) return 0
if(!istype(user)) return 0
if(electrified != 0)
if(shock(user)) //Handles removing charge from the cell, as well. No need to do that here.

View File

@@ -1,6 +1,6 @@
/obj/item/clothing/suit/armor
allowed = list(/obj/item/weapon/gun/energy,/obj/item/weapon/reagent_containers/spray/pepper,/obj/item/weapon/gun/projectile,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs)
allowed = list(/obj/item/weapon/gun/energy,/obj/item/weapon/reagent_containers/spray/pepper,/obj/item/weapon/gun/projectile,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/device/flashlight/maglight)
body_parts_covered = UPPER_TORSO|LOWER_TORSO
item_flags = THICKMATERIAL
@@ -263,7 +263,7 @@
icon_state = "kvest"
item_state = "kvest"
armor = list(melee = 40, bullet = 30, laser = 30, energy = 10, bomb = 10, bio = 0, rad = 0)
allowed = list(/obj/item/weapon/gun,/obj/item/weapon/reagent_containers/spray/pepper,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs)
allowed = list(/obj/item/weapon/gun,/obj/item/weapon/reagent_containers/spray/pepper,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/device/flashlight/maglight)
body_parts_covered = UPPER_TORSO|LOWER_TORSO
item_flags = THICKMATERIAL

View File

@@ -96,7 +96,7 @@
item_state = "det_suit"
blood_overlay_type = "coat"
body_parts_covered = UPPER_TORSO|ARMS
allowed = list(/obj/item/weapon/tank/emergency_oxygen, /obj/item/device/flashlight,/obj/item/weapon/gun/energy,/obj/item/weapon/gun/projectile,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/storage/fancy/cigarettes,/obj/item/weapon/flame/lighter,/obj/item/device/taperecorder)
allowed = list(/obj/item/weapon/tank/emergency_oxygen, /obj/item/device/flashlight,/obj/item/weapon/gun/energy,/obj/item/weapon/gun/projectile,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/storage/fancy/cigarettes,/obj/item/weapon/flame/lighter,/obj/item/device/taperecorder,/obj/item/device/uv_light)
armor = list(melee = 50, bullet = 10, laser = 25, energy = 10, bomb = 0, bio = 0, rad = 0)
/obj/item/clothing/suit/storage/det_trench/grey
@@ -109,7 +109,7 @@
desc = "A forensics technician jacket."
item_state = "det_suit"
body_parts_covered = UPPER_TORSO|ARMS
allowed = list(/obj/item/weapon/tank/emergency_oxygen, /obj/item/device/flashlight,/obj/item/weapon/gun/energy,/obj/item/weapon/gun/projectile,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/device/taperecorder)
allowed = list(/obj/item/weapon/tank/emergency_oxygen, /obj/item/device/flashlight,/obj/item/weapon/gun/energy,/obj/item/weapon/gun/projectile,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/device/taperecorder,/obj/item/device/uv_light)
armor = list(melee = 10, bullet = 10, laser = 15, energy = 10, bomb = 0, bio = 0, rad = 0)
/obj/item/clothing/suit/storage/forensics/red

View File

@@ -223,8 +223,8 @@
/obj/item/clothing/suit/armor/hos/jensen
name = "armored trenchcoat"
desc = "A trenchcoat augmented with a special alloy for some protection and style."
icon_state = "jensencoat"
item_state = "jensencoat"
icon_state = "hostrench"
item_state = "hostrench"
flags_inv = 0
siemens_coefficient = 0.6
body_parts_covered = UPPER_TORSO|ARMS

View File

@@ -11,9 +11,9 @@
/obj/item/clothing/under/syndicate/combat //ERT tactleneck
name = "combat turtleneck"
desc = "It's some non-descript, slightly suspicious looking, civilian clothing."
icon_state = "syndicate"
icon_state = "combat"
item_state = "bl_suit"
worn_state = "syndicate"
worn_state = "combat"
has_sensor = 1
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
siemens_coefficient = 0.9

View File

@@ -15,7 +15,7 @@
var/mob/living/carbon/human/user = usr
if (!(user.l_hand == src || user.r_hand == src))
if(!user.item_is_in_hands(src))
return //bag must be in your hands to use
if (isturf(I.loc))
@@ -31,10 +31,8 @@
var/obj/item/weapon/storage/U = I.loc
user.client.screen -= I
U.contents.Remove(I)
else if(user.l_hand == I) //in a hand
user.drop_l_hand()
else if(user.r_hand == I) //in a hand
user.drop_r_hand()
else if(user.item_is_in_hands(I))
user.drop_from_inventory(I)
else
return

View File

@@ -22,6 +22,7 @@ log transactions
anchored = 1
use_power = 1
idle_power_usage = 10
circuit = /obj/item/weapon/circuitboard/atm
var/datum/money_account/authenticated_account
var/number_incorrect_tries = 0
var/previous_account_number = 0
@@ -79,6 +80,25 @@ log transactions
return 1
/obj/machinery/atm/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/weapon/screwdriver) && circuit)
user << "<span class='notice'>You start disconnecting the monitor.</span>"
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 20))
var/obj/structure/frame/A = new /obj/structure/frame( src.loc )
var/obj/item/weapon/circuitboard/M = new circuit( A )
A.frame_type = "atm"
A.pixel_x = pixel_x
A.pixel_y = pixel_y
A.circuit = M
A.anchored = 1
for (var/obj/C in src)
C.forceMove(loc)
user << "<span class='notice'>You disconnect the monitor.</span>"
A.state = 4
A.icon_state = "atm_4"
M.deconstruct(src)
qdel(src)
return
if(istype(I, /obj/item/weapon/card))
if(emagged > 0)
//prevent inserting id into an emagged ATM

View File

@@ -21,8 +21,7 @@
if(istype(W, /obj/item/weapon/spacecash/ewallet)) return 0
var/obj/item/weapon/spacecash/SC = W
SC.worth += src.worth
SC.update_icon()
SC.adjust_worth(src.worth)
if(istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/h_user = user
h_user.drop_from_inventory(src)
@@ -59,26 +58,32 @@
src.overlays += banknote
src.desc = "They are worth [worth] Thalers."
/obj/item/weapon/spacecash/proc/adjust_worth(var/adjust_worth = 0, var/update = 1)
worth += adjust_worth
if(worth > 0)
if(update)
update_icon()
return worth
else
qdel(src)
return 0
/obj/item/weapon/spacecash/proc/set_worth(var/new_worth = 0, var/update = 1)
worth = max(0, new_worth)
if(update)
update_icon()
return worth
/obj/item/weapon/spacecash/attack_self()
var/amount = input(usr, "How many Thalers do you want to take? (0 to [src.worth])", "Take Money", 20) as num
amount = round(Clamp(amount, 0, src.worth))
if(amount==0) return 0
if(!amount)
return
src.worth -= amount
src.update_icon()
if(!worth)
usr.drop_from_inventory(src)
if(amount in list(1000,500,200,100,50,20,1))
var/cashtype = text2path("/obj/item/weapon/spacecash/c[amount]")
var/obj/cash = new cashtype (usr.loc)
usr.put_in_hands(cash)
else
var/obj/item/weapon/spacecash/SC = new (usr.loc)
SC.worth = amount
SC.update_icon()
usr.put_in_hands(SC)
if(!worth)
qdel(src)
adjust_worth(-amount)
var/obj/item/weapon/spacecash/SC = new (usr.loc)
SC.set_worth(amount)
usr.put_in_hands(SC)
/obj/item/weapon/spacecash/c1
name = "1 Thaler"
@@ -130,8 +135,7 @@
proc/spawn_money(var/sum, spawnloc, mob/living/carbon/human/human_user as mob)
var/obj/item/weapon/spacecash/SC = new (spawnloc)
SC.worth = sum
SC.update_icon()
SC.set_worth(sum)
if (ishuman(human_user) && !human_user.get_active_hand())
human_user.put_in_hands(SC)
return

View File

@@ -50,7 +50,7 @@
/var/list/economic_species_modifier = list(
/datum/species/human = 10,
/datum/species/skrell = 12,
/datum/species/teshari = 9, // Skrell sponsored!
/datum/species/teshari = 9, // Skrell sponsored,
/datum/species/tajaran = 7,
/datum/species/unathi = 7
)

View File

@@ -61,9 +61,12 @@
/datum/event/prison_break/tick()
if(activeFor == releaseWhen)
if(areas && areas.len > 0)
var/obj/machinery/power/apc/theAPC = null
for(var/area/A in areas)
for(var/obj/machinery/light/L in A)
L.flicker(10)
theAPC = A.get_apc()
if(theAPC.operating) //If the apc's off, it's a little hard to overload the lights.
for(var/obj/machinery/light/L in A)
L.flicker(10)
/datum/event/prison_break/end()

View File

@@ -77,12 +77,8 @@
usr << "There are no cards in the deck."
return
var/obj/item/weapon/hand/H
if(user.l_hand && istype(user.l_hand,/obj/item/weapon/hand))
H = user.l_hand
else if(user.r_hand && istype(user.r_hand,/obj/item/weapon/hand))
H = user.r_hand
else
var/obj/item/weapon/hand/H = user.get_type_in_hands(/obj/item/weapon/hand)
if(!H)
H = new(get_turf(src))
user.put_in_hands(H)

View File

@@ -172,7 +172,7 @@
if(seed) seed.thrown_at(src,hit_atom)
..()
/obj/item/weapon/reagent_containers/food/snacks/grown/attackby(var/obj/item/weapon/W, var/mob/user)
/obj/item/weapon/reagent_containers/food/snacks/grown/attackby(var/obj/item/weapon/W, var/mob/living/user)
if(seed)
if(seed.get_trait(TRAIT_PRODUCES_POWER) && istype(W, /obj/item/stack/cable_coil))
@@ -181,7 +181,7 @@
//TODO: generalize this.
user << "<span class='notice'>You add some cable to the [src.name] and slide it inside the battery casing.</span>"
var/obj/item/weapon/cell/potato/pocell = new /obj/item/weapon/cell/potato(get_turf(user))
if(src.loc == user && !(user.l_hand && user.r_hand) && istype(user,/mob/living/carbon/human))
if(src.loc == user && istype(user,/mob/living/carbon/human))
user.put_in_hands(pocell)
pocell.maxcharge = src.potency * 10
pocell.charge = pocell.maxcharge

View File

@@ -150,7 +150,7 @@
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)
if(target.item_is_in_hands(clothes))
continue
body_coverage &= ~(clothes.body_parts_covered)
@@ -182,7 +182,7 @@
continue
var/body_coverage = HEAD|FACE|EYES|UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
for(var/obj/item/clothing/clothes in M)
if(M.l_hand == clothes || M.r_hand == clothes)
if(M.item_is_in_hands(clothes))
continue
body_coverage &= ~(clothes.body_parts_covered)
if(!body_coverage)

View File

@@ -94,16 +94,10 @@
user << "You load [W] into [src]."
return
if(istype(W,/obj/item/weapon/screwdriver))
open = !open
user << "<span class='notice'>You [open ? "open" : "close"] the maintenance panel.</span>"
if(default_deconstruction_screwdriver(user, W))
return
if(default_deconstruction_crowbar(user, W))
return
if(open)
if(istype(W, /obj/item/weapon/crowbar))
dismantle()
return
if(istype(W,/obj/item/weapon/disk/botany))
if(loaded_disk)
user << "There is already a data disk loaded."

View File

@@ -152,7 +152,7 @@
return
if(weedlevel > 0)
nymph.reagents.add_reagent("nutriment", weedlevel)
nymph.reagents.add_reagent("glucose", weedlevel)
weedlevel = 0
nymph.visible_message("<font color='blue'><b>[nymph]</b> begins rooting through [src], ripping out weeds and eating them noisily.</font>","<font color='blue'>You begin rooting through [src], ripping out weeds and eating them noisily.</font>")
else if(nymph.nutrition > 100 && nutrilevel < 10)

View File

@@ -34,7 +34,7 @@
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(get_turf(src))
P.name = "paper - [form_title]"
P.info = "[last_data]"
if(istype(user,/mob/living/carbon/human) && !(user.l_hand && user.r_hand))
if(istype(user,/mob/living/carbon/human))
user.put_in_hands(P)
user.visible_message("\The [src] spits out a piece of paper.")
return

View File

@@ -45,7 +45,7 @@
user << "<span class='notice'>You begin dismantling \the [src].</span>"
if(do_after(user,25))
user << "<span class='notice'>You dismantle \the [src].</span>"
new /obj/item/stack/material/wood(get_turf(src), amount = 3)
new /obj/item/stack/material/wood(get_turf(src), 3)
for(var/obj/item/weapon/book/b in contents)
b.loc = (get_turf(src))
qdel(src)

View File

@@ -419,8 +419,8 @@ swapmap
Build procs: Take 2 turfs as corners, plus an item type.
An item may be like:
/turf/wall
/obj/fence{icon_state="iron"}
turf/wall
obj/fence{icon_state="iron"}
*/
proc/BuildFilledRectangle(turf/T1,turf/T2,item)
if(!Contains(T1) || !Contains(T2)) return

View File

@@ -47,9 +47,11 @@
recipes += new/datum/stack_recipe("cannon frame", /obj/item/weapon/cannonframe, 10, time = 15, one_per_turf = 0, on_floor = 0)
recipes += new/datum/stack_recipe("regular floor tile", /obj/item/stack/tile/floor, 1, 4, 20)
recipes += new/datum/stack_recipe("metal rod", /obj/item/stack/rods, 1, 2, 60)
recipes += new/datum/stack_recipe("computer frame", /obj/structure/computerframe, 5, time = 25, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("frame", /obj/item/frame, 5, time = 25, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("mirror frame", /obj/item/frame/mirror, 1, time = 5, one_per_turf = 0, on_floor = 1)
recipes += new/datum/stack_recipe("fire extinguisher cabinet frame", /obj/item/frame/extinguisher_cabinet, 4, time = 5, one_per_turf = 0, on_floor = 1)
//recipes += new/datum/stack_recipe("fire axe cabinet frame", /obj/item/frame/fireaxe_cabinet, 4, time = 5, one_per_turf = 0, on_floor = 1)
recipes += new/datum/stack_recipe("wall girders", /obj/structure/girder, 2, time = 50, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("machine frame", /obj/machinery/constructable_frame/machine_frame, 5, time = 25, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("turret frame", /obj/machinery/porta_turret_construct, 5, time = 25, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe_list("airlock assemblies", list( \
new/datum/stack_recipe("standard airlock assembly", /obj/structure/door_assembly, 4, time = 50, one_per_turf = 1, on_floor = 1), \
@@ -70,13 +72,17 @@
new/datum/stack_recipe("emergency shutter", /obj/structure/firedoor_assembly, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("multi-tile airlock assembly", /obj/structure/door_assembly/multi_tile, 4, time = 50, one_per_turf = 1, on_floor = 1), \
))
recipes += new/datum/stack_recipe("IV drip", /obj/machinery/iv_drip, 4, time = 20, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("conveyor switch", /obj/machinery/conveyor_switch, 2, time = 20, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("grenade casing", /obj/item/weapon/grenade/chem_grenade)
recipes += new/datum/stack_recipe("light fixture frame", /obj/item/frame/light, 2)
recipes += new/datum/stack_recipe("small light fixture frame", /obj/item/frame/light/small, 1)
recipes += new/datum/stack_recipe("apc frame", /obj/item/frame/apc, 2)
recipes += new/datum/stack_recipe("air alarm frame", /obj/item/frame/air_alarm, 2)
recipes += new/datum/stack_recipe("fire alarm frame", /obj/item/frame/fire_alarm, 2)
recipes += new/datum/stack_recipe_list("filing cabinets", list( \
new/datum/stack_recipe("filing cabinet", /obj/structure/filingcabinet, 4, time = 20, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("tall filing cabinet", /obj/structure/filingcabinet/filingcabinet, 4, time = 20, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("chest drawer", /obj/structure/filingcabinet/chestdrawer, 4, time = 20, one_per_turf = 1, on_floor = 1), \
))
/material/plasteel/generate_recipes()
..()
@@ -84,6 +90,7 @@
recipes += new/datum/stack_recipe("Metal crate", /obj/structure/closet/crate, 10, time = 50, one_per_turf = 1)
recipes += new/datum/stack_recipe("knife grip", /obj/item/weapon/material/butterflyhandle, 4, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = "[name]")
recipes += new/datum/stack_recipe("dark floor tile", /obj/item/stack/tile/floor_dark, 1, 4, 20)
recipes += new/datum/stack_recipe("roller bed", /obj/item/roller, 5, time = 30, on_floor = 1)
/material/sandstone/generate_recipes()
..()
@@ -99,6 +106,10 @@
recipes += new/datum/stack_recipe("reagent dispenser cartridge (small)", /obj/item/weapon/reagent_containers/chem_disp_cartridge/small, 1, on_floor=0) // 100u
recipes += new/datum/stack_recipe("white floor tile", /obj/item/stack/tile/floor_white, 1, 4, 20)
recipes += new/datum/stack_recipe("freezer floor tile", /obj/item/stack/tile/floor_freezer, 1, 4, 20)
recipes += new/datum/stack_recipe("shower curtain", /obj/structure/curtain, 4, time = 15, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("plastic flaps", /obj/structure/plasticflaps, 4, time = 25, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("airtight plastic flaps", /obj/structure/plasticflaps/mining, 5, time = 25, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("water-cooler", /obj/structure/reagent_dispensers/water_cooler, 4, time = 1, one_per_turf = 1, on_floor = 1)
/material/wood/generate_recipes()
..()
@@ -110,6 +121,7 @@
recipes += new/datum/stack_recipe("beehive assembly", /obj/item/beehive_assembly, 4)
recipes += new/datum/stack_recipe("beehive frame", /obj/item/honey_frame, 1)
recipes += new/datum/stack_recipe("book shelf", /obj/structure/bookcase, 5, time = 15, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("noticeboard frame", /obj/item/frame/noticeboard, 4, time = 5, one_per_turf = 0, on_floor = 1)
/material/cardboard/generate_recipes()
..()

View File

@@ -5,11 +5,11 @@
self-explanatory but the various object types may have their own documentation. ~Z
PATHS THAT USE DATUMS
/turf/simulated/wall
/obj/item/weapon/material
/obj/structure/barricade
/obj/item/stack/material
/obj/structure/table
turf/simulated/wall
obj/item/weapon/material
obj/structure/barricade
obj/item/stack/material
obj/structure/table
VALID ICONS
WALLS
@@ -128,7 +128,7 @@ var/list/name_to_material
S.add_fingerprint(user)
S.add_to_stacks(user)
/material/proc/build_wired_product(var/mob/user, var/obj/item/stack/used_stack, var/obj/item/stack/target_stack)
/material/proc/build_wired_product(var/mob/living/user, var/obj/item/stack/used_stack, var/obj/item/stack/target_stack)
if(!wire_product)
user << "<span class='warning'>You cannot make anything out of \the [target_stack]</span>"
return
@@ -140,8 +140,7 @@ var/list/name_to_material
target_stack.use(1)
user << "<span class='notice'>You attach wire to the [name].</span>"
var/obj/item/product = new wire_product(get_turf(user))
if(!(user.l_hand && user.r_hand))
user.put_in_hands(product)
user.put_in_hands(product)
// Make sure we have a display name and shard icon even if they aren't explicitly set.
/material/New()
@@ -356,7 +355,7 @@ var/list/name_to_material
hardness = 80
weight = 23
stack_origin_tech = list(TECH_MATERIAL = 2)
composite_material = list(DEFAULT_WALL_MATERIAL = 3750, "platinum" = 3750) //todo
composite_material = list(DEFAULT_WALL_MATERIAL = SHEET_MATERIAL_AMOUNT, "platinum" = SHEET_MATERIAL_AMOUNT) //todo
/material/plasteel/titanium
name = "titanium"
@@ -467,7 +466,7 @@ var/list/name_to_material
hardness = 40
weight = 30
stack_origin_tech = "materials=2"
composite_material = list(DEFAULT_WALL_MATERIAL = 1875,"glass" = 3750)
composite_material = list(DEFAULT_WALL_MATERIAL = SHEET_MATERIAL_AMOUNT / 2, "glass" = SHEET_MATERIAL_AMOUNT)
window_options = list("One Direction" = 1, "Full Window" = 4, "Windoor" = 5)
created_window = /obj/structure/window/reinforced
wire_product = null

View File

@@ -9,6 +9,7 @@
name = "mining drill head"
desc = "An enormous drill."
icon_state = "mining_drill"
circuit = /obj/item/weapon/circuitboard/miningdrill
var/braces_needed = 2
var/list/supports = list()
var/supported = 0
@@ -43,7 +44,6 @@
..()
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)

View File

@@ -172,10 +172,9 @@ var/list/mining_overlay_cache = list()
if(istype(AM,/mob/living/carbon/human))
var/mob/living/carbon/human/H = AM
if((istype(H.l_hand,/obj/item/weapon/pickaxe)) && (!H.hand))
attackby(H.l_hand,H)
else if((istype(H.r_hand,/obj/item/weapon/pickaxe)) && H.hand)
attackby(H.r_hand,H)
var/obj/item/weapon/pickaxe/P = H.get_inactive_hand()
if(istype(P))
src.attackby(P, H)
else if(istype(AM,/mob/living/silicon/robot))
var/mob/living/silicon/robot/R = AM

View File

@@ -33,7 +33,7 @@
continue
if(findtext(message," snores.")) //Because we have so many sleeping people.
break
if(M.stat == 2 && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_sight) && !(M in viewers(src,null)))
M.show_message(message, m_type)
if (m_type & 1)
@@ -66,7 +66,7 @@
src << "<span class='danger'>You cannot send deadchat emotes (muted).</span>"
return
if(!(client.prefs.toggles & CHAT_DEAD))
if(!is_preference_enabled(/datum/client_preference/show_dsay))
src << "<span class='danger'>You have deadchat muted.</span>"
return

View File

@@ -4,7 +4,7 @@
if(!client)
return
if(speaker && !speaker.client && istype(src,/mob/observer/dead) && client.prefs.toggles & CHAT_GHOSTEARS && !speaker in view(src))
if(speaker && !speaker.client && istype(src,/mob/observer/dead) && is_preference_enabled(/datum/client_preference/ghost_ears) && !(speaker in view(src)))
//Does the speaker have a client? It's either random stuff that observers won't care about (Experiment 97B says, 'EHEHEHEHEHEHEHE')
//Or someone snoring. So we make it where they won't hear it.
return
@@ -51,12 +51,12 @@
var/track = null
if(istype(src, /mob/observer/dead))
if(italics && client.prefs.toggles & CHAT_GHOSTRADIO)
if(italics && is_preference_enabled(/datum/client_preference/ghost_radio))
return
if(speaker_name != speaker.real_name && speaker.real_name)
speaker_name = "[speaker.real_name] ([speaker_name])"
track = "([ghost_follow_link(speaker, src)]) "
if(client.prefs.toggles & CHAT_GHOSTEARS && speaker in view(src))
if(is_preference_enabled(/datum/client_preference/ghost_ears) && (speaker in view(src)))
message = "<b>[message]</b>"
if((sdisabilities & DEAF) || ear_deaf)

View File

@@ -1,43 +1,3 @@
//This proc is called whenever someone clicks an inventory ui slot.
/mob/proc/attack_ui(slot)
var/obj/item/W = get_active_hand()
if(istype(W))
equip_to_slot_if_possible(W, slot)
/mob/proc/put_in_any_hand_if_possible(obj/item/W as obj, del_on_fail = 0, disable_warning = 1, redraw_mob = 1)
if(equip_to_slot_if_possible(W, slot_l_hand, del_on_fail, disable_warning, redraw_mob))
return 1
else if(equip_to_slot_if_possible(W, slot_r_hand, del_on_fail, disable_warning, redraw_mob))
return 1
return 0
//This is a SAFE proc. Use this instead of equip_to_slot()!
//set del_on_fail to have it delete W if it fails to equip
//set disable_warning to disable the 'you are unable to equip that' warning.
//unset redraw_mob to prevent the mob from being redrawn at the end.
/mob/proc/equip_to_slot_if_possible(obj/item/W as obj, slot, del_on_fail = 0, disable_warning = 0, redraw_mob = 1)
if(!istype(W)) return 0
if(!W.mob_can_equip(src, slot))
if(del_on_fail)
qdel(W)
else
if(!disable_warning)
src << "\red You are unable to equip that." //Only print if del_on_fail is false
return 0
equip_to_slot(W, slot, redraw_mob) //This proc should not ever fail.
return 1
//This is an UNSAFE proc. It merely handles the actual job of equipping. All the checks on whether you can or can't eqip need to be done before! Use mob_can_equip() for that task.
//In most cases you will want to use equip_to_slot_if_possible()
/mob/proc/equip_to_slot(obj/item/W as obj, slot)
return
//This is just a commonly used configuration for the equip_to_slot_if_possible() proc, used to equip people when the rounds tarts and when events happen and such.
/mob/proc/equip_to_slot_or_del(obj/item/W as obj, slot)
return equip_to_slot_if_possible(W, slot, 1, 1, 0)
//The list of slots by priority. equip_to_appropriate_slot() uses this list. Doesn't matter if a mob type doesn't have a slot.
var/list/slot_equipment_priority = list( \
slot_back,\
@@ -58,6 +18,49 @@ var/list/slot_equipment_priority = list( \
slot_r_store\
)
/mob
var/obj/item/weapon/storage/s_active = null // Even ghosts can/should be able to peek into boxes on the ground
//This proc is called whenever someone clicks an inventory ui slot.
/mob/proc/attack_ui(var/slot)
var/obj/item/W = get_active_hand()
if(istype(W))
equip_to_slot_if_possible(W, slot)
/* Inventory manipulation */
/mob/proc/put_in_any_hand_if_possible(obj/item/W as obj, del_on_fail = 0, disable_warning = 1, redraw_mob = 1)
if(equip_to_slot_if_possible(W, slot_l_hand, del_on_fail, disable_warning, redraw_mob))
return 1
else if(equip_to_slot_if_possible(W, slot_r_hand, del_on_fail, disable_warning, redraw_mob))
return 1
return 0
//This is a SAFE proc. Use this instead of equip_to_slot()!
//set del_on_fail to have it delete W if it fails to equip
//set disable_warning to disable the 'you are unable to equip that' warning.
//unset redraw_mob to prevent the mob from being redrawn at the end.
/mob/proc/equip_to_slot_if_possible(obj/item/W as obj, slot, del_on_fail = 0, disable_warning = 0, redraw_mob = 1)
if(!W.mob_can_equip(src, slot))
if(del_on_fail)
qdel(W)
else
if(!disable_warning)
src << "\red You are unable to equip that." //Only print if del_on_fail is false
return 0
equip_to_slot(W, slot, redraw_mob) //This proc should not ever fail.
return 1
//This is an UNSAFE proc. It merely handles the actual job of equipping. All the checks on whether you can or can't eqip need to be done before! Use mob_can_equip() for that task.
//In most cases you will want to use equip_to_slot_if_possible()
/mob/proc/equip_to_slot(obj/item/W as obj, slot)
return
//This is just a commonly used configuration for the equip_to_slot_if_possible() proc, used to equip people when the rounds tarts and when events happen and such.
/mob/proc/equip_to_slot_or_del(obj/item/W as obj, slot)
return equip_to_slot_if_possible(W, slot, 1, 1, 0)
//Checks if a given slot can be accessed at this time, either to equip or unequip I
/mob/proc/slot_is_accessible(var/slot, var/obj/item/I, mob/user=null)
return 1
@@ -65,8 +68,6 @@ var/list/slot_equipment_priority = list( \
//puts the item "W" into an appropriate slot in a human's inventory
//returns 0 if it cannot, 1 if successful
/mob/proc/equip_to_appropriate_slot(obj/item/W)
if(!istype(W)) return 0
for(var/slot in slot_equipment_priority)
if(equip_to_slot_if_possible(W, slot, del_on_fail=0, disable_warning=1, redraw_mob=1))
return 1
@@ -74,32 +75,15 @@ var/list/slot_equipment_priority = list( \
return 0
/mob/proc/equip_to_storage(obj/item/newitem)
// Try put it in their backpack
if(istype(src.back,/obj/item/weapon/storage))
var/obj/item/weapon/storage/backpack = src.back
if(backpack.contents.len < backpack.storage_slots)
newitem.forceMove(src.back)
return 1
// Try to place it in any item that can store stuff, on the mob.
for(var/obj/item/weapon/storage/S in src.contents)
if (S.contents.len < S.storage_slots)
newitem.forceMove(S)
return 1
return 0
//These procs handle putting s tuff in your hand. It's probably best to use these rather than setting l_hand = ...etc
//as they handle all relevant stuff like adding it to the player's screen and updating their overlays.
/* Hands */
//Returns the thing in our active hand
/mob/proc/get_active_hand()
if(hand) return l_hand
else return r_hand
//Returns the thing in our inactive hand
/mob/proc/get_inactive_hand()
if(hand) return r_hand
else return l_hand
//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_l_hand(var/obj/item/W)
@@ -150,16 +134,15 @@ var/list/slot_equipment_priority = list( \
//Drops the item in our left hand
/mob/proc/drop_l_hand(var/atom/Target)
return drop_from_inventory(l_hand, Target)
return 0
//Drops the item in our right hand
/mob/proc/drop_r_hand(var/atom/Target)
return drop_from_inventory(r_hand, Target)
return 0
//Drops the item in our active hand. TODO: rename this to drop_active_hand or something
/mob/proc/drop_item(var/atom/Target)
if(hand) return drop_l_hand(Target)
else return drop_r_hand(Target)
return
/*
Removes the object from any slots the mob might have, calling the appropriate icon update proc.
@@ -173,19 +156,6 @@ var/list/slot_equipment_priority = list( \
the search through all the slots, without having to duplicate the rest of the item dropping.
*/
/mob/proc/u_equip(obj/W as obj)
if (W == r_hand)
r_hand = null
update_inv_r_hand(0)
else if (W == l_hand)
l_hand = null
update_inv_l_hand(0)
else if (W == back)
back = null
update_inv_back(0)
else if (W == wear_mask)
wear_mask = null
update_inv_wear_mask(0)
return
/mob/proc/isEquipped(obj/item/I)
if(!I)
@@ -229,11 +199,6 @@ var/list/slot_equipment_priority = list( \
//Returns the item equipped to the specified slot, if any.
/mob/proc/get_equipped_item(var/slot)
switch(slot)
if(slot_l_hand) return l_hand
if(slot_r_hand) return r_hand
if(slot_back) return back
if(slot_wear_mask) return wear_mask
return null
//Outdated but still in use apparently. This should at least be a human proc.

View File

@@ -288,7 +288,7 @@
/* Assembly */
/obj/item/weapon/storage/toolbox/mechanical/attackby(var/obj/item/stack/tile/floor/T, mob/user as mob)
/obj/item/weapon/storage/toolbox/mechanical/attackby(var/obj/item/stack/tile/floor/T, mob/living/user as mob)
if(!istype(T, /obj/item/stack/tile/floor))
..()
return

View File

@@ -2,7 +2,7 @@
var/mob/living/carbon/human/H = over_object
if(!istype(H) || !Adjacent(H))
return ..()
if(H.a_intent == "grab" && hat && !(H.l_hand && H.r_hand))
if(H.a_intent == "grab" && hat && !H.hands_are_full())
hat.loc = get_turf(src)
H.put_in_hands(hat)
H.visible_message("<span class='danger'>\The [H] removes \the [src]'s [hat].</span>")

View File

@@ -70,7 +70,7 @@
for(var/mob/M in dead_mob_list)
if (!M.client || istype(M, /mob/new_player))
continue //skip monkeys, leavers, and new_players
if(M.stat == DEAD && (M.client.prefs.toggles & CHAT_GHOSTSIGHT) && !(M in viewers(src,null)))
if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_sight) && !(M in viewers(src,null)))
M.show_message(message)

View File

@@ -3,40 +3,40 @@
set name = "Give"
// TODO : Change to incapacitated() on merge.
if(usr.stat || usr.lying || usr.resting || usr.buckled)
if(src.stat || src.lying || src.resting || src.buckled)
return
if(!istype(target) || target.stat || target.lying || target.resting || target.buckled || target.client == null)
return
var/obj/item/I = usr.get_active_hand()
var/obj/item/I = src.get_active_hand()
if(!I)
I = usr.get_inactive_hand()
I = src.get_inactive_hand()
if(!I)
usr << "<span class='warning'>You don't have anything in your hands to give to \the [target].</span>"
src << "<span class='warning'>You don't have anything in your hands to give to \the [target].</span>"
return
if(alert(target,"[usr] wants to give you \a [I]. Will you accept it?",,"No","Yes") == "No")
target.visible_message("<span class='notice'>\The [usr] tried to hand \the [I] to \the [target], \
if(alert(target,"[src] wants to give you \a [I]. Will you accept it?",,"No","Yes") == "No")
target.visible_message("<span class='notice'>\The [src] tried to hand \the [I] to \the [target], \
but \the [target] didn't want it.</span>")
return
if(!I) return
if(!Adjacent(target))
usr << "<span class='warning'>You need to stay in reaching distance while giving an object.</span>"
target << "<span class='warning'>\The [usr] moved too far away.</span>"
src << "<span class='warning'>You need to stay in reaching distance while giving an object.</span>"
target << "<span class='warning'>\The [src] moved too far away.</span>"
return
if(I.loc != usr || (usr.l_hand != I && usr.r_hand != I))
usr << "<span class='warning'>You need to keep the item in your hands.</span>"
target << "<span class='warning'>\The [usr] seems to have given up on passing \the [I] to you.</span>"
if(I.loc != src || !src.item_is_in_hands(I))
src << "<span class='warning'>You need to keep the item in your hands.</span>"
target << "<span class='warning'>\The [src] seems to have given up on passing \the [I] to you.</span>"
return
if(target.r_hand != null && target.l_hand != null)
if(target.hands_are_full())
target << "<span class='warning'>Your hands are full.</span>"
usr << "<span class='warning'>Their hands are full.</span>"
src << "<span class='warning'>Their hands are full.</span>"
return
if(usr.unEquip(I))
if(src.unEquip(I))
target.put_in_hands(I) // If this fails it will just end up on the floor, but that's fitting for things like dionaea.
target.visible_message("<span class='notice'>\The [usr] handed \the [I] to \the [target].</span>")
target.visible_message("<span class='notice'>\The [src] handed \the [I] to \the [target].</span>")

View File

@@ -538,9 +538,9 @@
if ("handshake")
m_type = 1
if (!src.restrained() && !src.r_hand)
var/mob/M = null
var/mob/living/M = null
if (param)
for (var/mob/A in view(1, null))
for (var/mob/living/A in view(1, null))
if (param == A.name)
M = A
break

View File

@@ -48,7 +48,7 @@
else if(gender == FEMALE)
use_gender = "a gynoid"
msg += ", <font color='#555555'>[use_gender]!</font></b>"
msg += ", <b><font color='#555555'>[use_gender]!</font></b>"
else if(species.name != "Human")
msg += ", <b><font color='[species.get_flesh_colour(src)]'>\a [species.name]!</font></b>"

View File

@@ -1115,9 +1115,11 @@
spawn(0)
regenerate_icons()
if(vessel.total_volume < species.blood_volume)
vessel.maximum_volume = species.blood_volume
vessel.add_reagent("blood", species.blood_volume - vessel.total_volume)
else if(vessel.total_volume > species.blood_volume)
vessel.remove_reagent("blood", vessel.total_volume - species.blood_volume)
vessel.maximum_volume = species.blood_volume
fixblood()
// Rebuild the HUD. If they aren't logged in then login() should reinstantiate it for them.

View File

@@ -149,6 +149,23 @@
return ONE_ATMOSPHERE + pressure_difference
/mob/living/carbon/human/handle_disabilities()
..()
//Vision
if(species.vision_organ)
if(internal_organs_by_name[species.vision_organ]) // Vision organs cut out? Permablind.
eye_blind = 0
blinded = 0
eye_blurry = 0
else
eye_blind = 1
blinded = 1
eye_blurry = 1
else // Presumably if a species has no vision organs, they see via some other means.
eye_blind = 0
blinded = 0
eye_blurry = 0
if (disabilities & EPILEPSY)
if ((prob(1) && paralysis < 1))
src << "\red You have a seizure!"
@@ -174,13 +191,7 @@
emote("twitch")
if(2 to 3)
say("[prob(50) ? ";" : ""][pick("SHIT", "PISS", "FUCK", "CUNT", "COCKSUCKER", "MOTHERFUCKER", "TITS")]")
var/old_x = pixel_x
var/old_y = pixel_y
pixel_x += rand(-2,2)
pixel_y += rand(-1,1)
sleep(2)
pixel_x = old_x
pixel_y = old_y
make_jittery(100)
return
if (disabilities & NERVOUS)
speech_problem_flag = 1
@@ -601,31 +612,32 @@
//Body temperature is too hot.
fire_alert = max(fire_alert, 1)
if(status_flags & GODMODE) return 1 //godmode
if(bodytemperature < species.heat_level_2)
take_overall_damage(burn=HEAT_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2)
else if(bodytemperature < species.heat_level_3)
take_overall_damage(burn=HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2)
else
take_overall_damage(burn=HEAT_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2)
var/burn_dam = 0
switch(bodytemperature)
if(species.heat_level_1 to species.heat_level_2)
burn_dam = HEAT_DAMAGE_LEVEL_1
if(species.heat_level_2 to species.heat_level_3)
burn_dam = HEAT_DAMAGE_LEVEL_2
if(species.heat_level_3 to INFINITY)
burn_dam = HEAT_DAMAGE_LEVEL_3
take_overall_damage(burn=burn_dam, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2)
else if(bodytemperature <= species.cold_level_1)
fire_alert = max(fire_alert, 1)
if(status_flags & GODMODE) return 1 //godmode
if(!istype(loc, /obj/machinery/atmospherics/unary/cryo_cell))
if(bodytemperature > species.cold_level_2)
take_overall_damage(burn=COLD_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 1)
else if(bodytemperature > species.cold_level_3)
take_overall_damage(burn=COLD_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 1)
else
take_overall_damage(burn=COLD_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 1)
var/burn_dam = 0
switch(bodytemperature)
if(-INFINITY to species.cold_level_3)
burn_dam = COLD_DAMAGE_LEVEL_1
if(species.cold_level_3 to species.cold_level_2)
burn_dam = COLD_DAMAGE_LEVEL_2
if(species.cold_level_2 to species.cold_level_1)
burn_dam = COLD_DAMAGE_LEVEL_3
take_overall_damage(burn=burn_dam, used_weapon = "Low Body Temperature")
fire_alert = max(fire_alert, 1)
// Account for massive pressure differences. Done by Polymorph
// Made it possible to actually have something that can protect against high pressure... Done by Errorage. Polymorph now has an axe sticking from his head for his previous hardcoded nonsense!
@@ -711,85 +723,25 @@
//This proc returns a number made up of the flags for body parts which you are protected on. (such as HEAD, UPPER_TORSO, LOWER_TORSO, etc. See setup.dm for the full list)
/mob/living/carbon/human/proc/get_heat_protection_flags(temperature) //Temperature is the temperature you're being exposed to.
var/thermal_protection_flags = 0
. = 0
//Handle normal clothing
if(head)
if(head.max_heat_protection_temperature && head.max_heat_protection_temperature >= temperature)
thermal_protection_flags |= head.heat_protection
if(wear_suit)
if(wear_suit.max_heat_protection_temperature && wear_suit.max_heat_protection_temperature >= temperature)
thermal_protection_flags |= wear_suit.heat_protection
if(w_uniform)
if(w_uniform.max_heat_protection_temperature && w_uniform.max_heat_protection_temperature >= temperature)
thermal_protection_flags |= w_uniform.heat_protection
if(shoes)
if(shoes.max_heat_protection_temperature && shoes.max_heat_protection_temperature >= temperature)
thermal_protection_flags |= shoes.heat_protection
if(gloves)
if(gloves.max_heat_protection_temperature && gloves.max_heat_protection_temperature >= temperature)
thermal_protection_flags |= gloves.heat_protection
if(wear_mask)
if(wear_mask.max_heat_protection_temperature && wear_mask.max_heat_protection_temperature >= temperature)
thermal_protection_flags |= wear_mask.heat_protection
return thermal_protection_flags
/mob/living/carbon/human/get_heat_protection(temperature) //Temperature is the temperature you're being exposed to.
var/thermal_protection_flags = get_heat_protection_flags(temperature)
var/thermal_protection = 0.0
if(thermal_protection_flags)
if(thermal_protection_flags & HEAD)
thermal_protection += THERMAL_PROTECTION_HEAD
if(thermal_protection_flags & UPPER_TORSO)
thermal_protection += THERMAL_PROTECTION_UPPER_TORSO
if(thermal_protection_flags & LOWER_TORSO)
thermal_protection += THERMAL_PROTECTION_LOWER_TORSO
if(thermal_protection_flags & LEG_LEFT)
thermal_protection += THERMAL_PROTECTION_LEG_LEFT
if(thermal_protection_flags & LEG_RIGHT)
thermal_protection += THERMAL_PROTECTION_LEG_RIGHT
if(thermal_protection_flags & FOOT_LEFT)
thermal_protection += THERMAL_PROTECTION_FOOT_LEFT
if(thermal_protection_flags & FOOT_RIGHT)
thermal_protection += THERMAL_PROTECTION_FOOT_RIGHT
if(thermal_protection_flags & ARM_LEFT)
thermal_protection += THERMAL_PROTECTION_ARM_LEFT
if(thermal_protection_flags & ARM_RIGHT)
thermal_protection += THERMAL_PROTECTION_ARM_RIGHT
if(thermal_protection_flags & HAND_LEFT)
thermal_protection += THERMAL_PROTECTION_HAND_LEFT
if(thermal_protection_flags & HAND_RIGHT)
thermal_protection += THERMAL_PROTECTION_HAND_RIGHT
return min(1,thermal_protection)
for(var/obj/item/clothing/C in list(head,wear_suit,w_uniform,shoes,gloves,wear_mask))
if(C)
if(C.max_heat_protection_temperature && C.max_heat_protection_temperature >= temperature)
. |= C.heat_protection
//See proc/get_heat_protection_flags(temperature) for the description of this proc.
/mob/living/carbon/human/proc/get_cold_protection_flags(temperature)
var/thermal_protection_flags = 0
. = 0
//Handle normal clothing
for(var/obj/item/clothing/C in list(head,wear_suit,w_uniform,shoes,gloves,wear_mask))
if(C)
if(C.min_cold_protection_temperature && C.min_cold_protection_temperature <= temperature)
. |= C.cold_protection
if(head)
if(head.min_cold_protection_temperature && head.min_cold_protection_temperature <= temperature)
thermal_protection_flags |= head.cold_protection
if(wear_suit)
if(wear_suit.min_cold_protection_temperature && wear_suit.min_cold_protection_temperature <= temperature)
thermal_protection_flags |= wear_suit.cold_protection
if(w_uniform)
if(w_uniform.min_cold_protection_temperature && w_uniform.min_cold_protection_temperature <= temperature)
thermal_protection_flags |= w_uniform.cold_protection
if(shoes)
if(shoes.min_cold_protection_temperature && shoes.min_cold_protection_temperature <= temperature)
thermal_protection_flags |= shoes.cold_protection
if(gloves)
if(gloves.min_cold_protection_temperature && gloves.min_cold_protection_temperature <= temperature)
thermal_protection_flags |= gloves.cold_protection
if(wear_mask)
if(wear_mask.min_cold_protection_temperature && wear_mask.min_cold_protection_temperature <= temperature)
thermal_protection_flags |= wear_mask.cold_protection
return thermal_protection_flags
/mob/living/carbon/human/get_heat_protection(temperature) //Temperature is the temperature you're being exposed to.
var/thermal_protection_flags = get_heat_protection_flags(temperature)
return get_thermal_protection(thermal_protection_flags)
/mob/living/carbon/human/get_cold_protection(temperature)
if(COLD_RESISTANCE in mutations)
@@ -797,33 +749,34 @@
temperature = max(temperature, 2.7) //There is an occasional bug where the temperature is miscalculated in ares with a small amount of gas on them, so this is necessary to ensure that that bug does not affect this calculation. Space's temperature is 2.7K and most suits that are intended to protect against any cold, protect down to 2.0K.
var/thermal_protection_flags = get_cold_protection_flags(temperature)
return get_thermal_protection(thermal_protection_flags)
var/thermal_protection = 0.0
if(thermal_protection_flags)
if(thermal_protection_flags & HEAD)
thermal_protection += THERMAL_PROTECTION_HEAD
if(thermal_protection_flags & UPPER_TORSO)
thermal_protection += THERMAL_PROTECTION_UPPER_TORSO
if(thermal_protection_flags & LOWER_TORSO)
thermal_protection += THERMAL_PROTECTION_LOWER_TORSO
if(thermal_protection_flags & LEG_LEFT)
thermal_protection += THERMAL_PROTECTION_LEG_LEFT
if(thermal_protection_flags & LEG_RIGHT)
thermal_protection += THERMAL_PROTECTION_LEG_RIGHT
if(thermal_protection_flags & FOOT_LEFT)
thermal_protection += THERMAL_PROTECTION_FOOT_LEFT
if(thermal_protection_flags & FOOT_RIGHT)
thermal_protection += THERMAL_PROTECTION_FOOT_RIGHT
if(thermal_protection_flags & ARM_LEFT)
thermal_protection += THERMAL_PROTECTION_ARM_LEFT
if(thermal_protection_flags & ARM_RIGHT)
thermal_protection += THERMAL_PROTECTION_ARM_RIGHT
if(thermal_protection_flags & HAND_LEFT)
thermal_protection += THERMAL_PROTECTION_HAND_LEFT
if(thermal_protection_flags & HAND_RIGHT)
thermal_protection += THERMAL_PROTECTION_HAND_RIGHT
return min(1,thermal_protection)
/mob/living/carbon/human/proc/get_thermal_protection(var/flags)
.=0
if(flags)
if(flags & HEAD)
. += THERMAL_PROTECTION_HEAD
if(flags & UPPER_TORSO)
. += THERMAL_PROTECTION_UPPER_TORSO
if(flags & LOWER_TORSO)
. += THERMAL_PROTECTION_LOWER_TORSO
if(flags & LEG_LEFT)
. += THERMAL_PROTECTION_LEG_LEFT
if(flags & LEG_RIGHT)
. += THERMAL_PROTECTION_LEG_RIGHT
if(flags & FOOT_LEFT)
. += THERMAL_PROTECTION_FOOT_LEFT
if(flags & FOOT_RIGHT)
. += THERMAL_PROTECTION_FOOT_RIGHT
if(flags & ARM_LEFT)
. += THERMAL_PROTECTION_ARM_LEFT
if(flags & ARM_RIGHT)
. += THERMAL_PROTECTION_ARM_RIGHT
if(flags & HAND_LEFT)
. += THERMAL_PROTECTION_HAND_LEFT
if(flags & HAND_RIGHT)
. += THERMAL_PROTECTION_HAND_RIGHT
return min(1,.)
/mob/living/carbon/human/handle_chemicals_in_body()

View File

@@ -48,7 +48,7 @@
// Combat vars.
var/total_health = 100 // Point at which the mob will enter crit.
var/list/unarmed_types = list( // Possible unarmed attacks that the mob will use in combat.
var/list/unarmed_types = list( // Possible unarmed attacks that the mob will use in combat,
/datum/unarmed_attack,
/datum/unarmed_attack/bite
)
@@ -207,7 +207,7 @@
var/covered = 0 // Basic coverage can help.
for(var/obj/item/clothing/clothes in H)
if(H.l_hand == clothes|| H.r_hand == clothes)
if(H.item_is_in_hands(clothes))
continue
if((clothes.body_parts_covered & UPPER_TORSO) && (clothes.body_parts_covered & LOWER_TORSO))
covered = 1

View File

@@ -116,7 +116,7 @@
for (var/mob/M in dead_mob_list) //does this include players who joined as observers as well?
if (!(M.client))
continue
if(M.stat == DEAD && M.client && (M.client.prefs.toggles & CHAT_GHOSTEARS))
if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears))
listening |= M
//Pass whispers on to anything inside the immediate listeners.

View File

@@ -19,12 +19,12 @@
ExtinguishMob()
return
..()
if(handcuffed)
else if(handcuffed)
spawn() escape_handcuffs()
else if(legcuffed)
spawn() escape_legcuffs()
else
..()
/mob/living/carbon/proc/escape_handcuffs()
//if(!(last_special <= world.time)) return

View File

@@ -0,0 +1,172 @@
/mob/living
var/hand = null
var/obj/item/l_hand = null
var/obj/item/r_hand = null
var/obj/item/weapon/back = null//Human/Monkey
var/obj/item/weapon/tank/internal = null//Human/Monkey
var/obj/item/clothing/mask/wear_mask = null//Carbon
/mob/living/equip_to_storage(obj/item/newitem)
// Try put it in their backpack
if(istype(src.back,/obj/item/weapon/storage))
var/obj/item/weapon/storage/backpack = src.back
if(backpack.contents.len < backpack.storage_slots)
newitem.forceMove(src.back)
return 1
// Try to place it in any item that can store stuff, on the mob.
for(var/obj/item/weapon/storage/S in src.contents)
if (S.contents.len < S.storage_slots)
newitem.forceMove(S)
return 1
return 0
//Returns the thing in our active hand
/mob/living/get_active_hand()
if(hand) return l_hand
else return r_hand
//Returns the thing in our inactive hand
/mob/living/get_inactive_hand()
if(hand) return r_hand
else return l_hand
//Drops the item in our active hand. TODO: rename this to drop_active_hand or something
/mob/living/drop_item(var/atom/Target)
if(hand) return drop_l_hand(Target)
else return drop_r_hand(Target)
//Drops the item in our left hand
/mob/living/drop_l_hand(var/atom/Target)
return drop_from_inventory(l_hand, Target)
//Drops the item in our right hand
/mob/living/drop_r_hand(var/atom/Target)
return drop_from_inventory(r_hand, Target)
/mob/living/proc/hands_are_full()
return (r_hand && l_hand)
/mob/living/proc/item_is_in_hands(var/obj/item/I)
return (I == r_hand || I == l_hand)
/mob/living/proc/update_held_icons()
if(l_hand)
l_hand.update_held_icon()
if(r_hand)
r_hand.update_held_icon()
/mob/living/proc/get_type_in_hands(var/T)
if(istype(l_hand, T))
return l_hand
if(istype(r_hand, T))
return r_hand
return null
/mob/living/proc/get_left_hand()
return l_hand
/mob/living/proc/get_right_hand()
return r_hand
/mob/living/u_equip(obj/W as obj)
if (W == r_hand)
r_hand = null
update_inv_r_hand(0)
else if (W == l_hand)
l_hand = null
update_inv_l_hand(0)
else if (W == back)
back = null
update_inv_back(0)
else if (W == wear_mask)
wear_mask = null
update_inv_wear_mask(0)
return
/mob/living/get_equipped_item(var/slot)
switch(slot)
if(slot_l_hand) return l_hand
if(slot_r_hand) return r_hand
if(slot_back) return back
if(slot_wear_mask) return wear_mask
return null
/mob/living/show_inv(mob/user as mob)
user.set_machine(src)
var/dat = {"
<B><HR><FONT size=3>[name]</FONT></B>
<BR><HR>
<BR><B>Head(Mask):</B> <A href='?src=\ref[src];item=mask'>[(wear_mask ? wear_mask : "Nothing")]</A>
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=l_hand'>[(l_hand ? l_hand : "Nothing")]</A>
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=r_hand'>[(r_hand ? r_hand : "Nothing")]</A>
<BR><B>Back:</B> <A href='?src=\ref[src];item=back'>[(back ? back : "Nothing")]</A> [((istype(wear_mask, /obj/item/clothing/mask) && istype(back, /obj/item/weapon/tank) && !( internal )) ? text(" <A href='?src=\ref[];item=internal'>Set Internal</A>", src) : "")]
<BR>[(internal ? text("<A href='?src=\ref[src];item=internal'>Remove Internal</A>") : "")]
<BR><A href='?src=\ref[src];item=pockets'>Empty Pockets</A>
<BR><A href='?src=\ref[user];refresh=1'>Refresh</A>
<BR><A href='?src=\ref[user];mach_close=mob[name]'>Close</A>
<BR>"}
user << browse(dat, text("window=mob[];size=325x500", name))
onclose(user, "mob[name]")
return
/mob/living/ret_grab(obj/effect/list_container/mobl/L as obj, flag)
if ((!( istype(l_hand, /obj/item/weapon/grab) ) && !( istype(r_hand, /obj/item/weapon/grab) )))
if (!( L ))
return null
else
return L.container
else
if (!( L ))
L = new /obj/effect/list_container/mobl( null )
L.container += src
L.master = src
if (istype(l_hand, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = l_hand
if (!( L.container.Find(G.affecting) ))
L.container += G.affecting
if (G.affecting)
G.affecting.ret_grab(L, 1)
if (istype(r_hand, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = r_hand
if (!( L.container.Find(G.affecting) ))
L.container += G.affecting
if (G.affecting)
G.affecting.ret_grab(L, 1)
if (!( flag ))
if (L.master == src)
var/list/temp = list( )
temp += L.container
//L = null
qdel(L)
return temp
else
return L.container
return
/mob/living/mode()
set name = "Activate Held Object"
set category = "Object"
set src = usr
if(istype(loc,/obj/mecha)) return
if(hand)
var/obj/item/W = l_hand
if (W)
W.attack_self(src)
update_inv_l_hand()
else
var/obj/item/W = r_hand
if (W)
W.attack_self(src)
update_inv_r_hand()
return
/mob/living/abiotic(var/full_body = 0)
if(full_body && ((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )) || (src.back || src.wear_mask)))
return 1
if((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )))
return 1
return 0

View File

@@ -865,3 +865,63 @@ default behaviour is:
sleep(350)
lastpuke = 0
/mob/living/update_canmove()
if(!resting && cannot_stand() && can_stand_overridden())
lying = 0
canmove = 1
else
if(istype(buckled, /obj/vehicle))
var/obj/vehicle/V = buckled
if(cannot_stand())
lying = 0
canmove = 1
pixel_y = V.mob_offset_y - 5
else
if(buckled.buckle_lying != -1) lying = buckled.buckle_lying
canmove = 1
pixel_y = V.mob_offset_y
else if(buckled)
anchored = 1
canmove = 0
if(istype(buckled))
if(buckled.buckle_lying != -1)
lying = buckled.buckle_lying
if(buckled.buckle_movable)
anchored = 0
canmove = 1
else if(cannot_stand())
lying = 1
canmove = 0
else if(stunned)
canmove = 0
else if(captured)
anchored = 1
canmove = 0
lying = 0
else
lying = 0
canmove = 1
if(lying)
density = 0
if(l_hand) unEquip(l_hand)
if(r_hand) unEquip(r_hand)
else
density = initial(density)
for(var/obj/item/weapon/grab/G in grabbed_by)
if(G.state >= GRAB_AGGRESSIVE)
canmove = 0
break
//Temporarily moved here from the various life() procs
//I'm fixing stuff incrementally so this will likely find a better home.
//It just makes sense for now. ~Carn
if( update_icon ) //forces a full overlay update
update_icon = 0
regenerate_icons()
else if( lying != lying_prev )
update_icons()
return canmove

View File

@@ -248,7 +248,7 @@ proc/get_radio_key_from_channel(var/channel)
for(var/mob/M in player_list)
if(M.stat == DEAD && M.client && (M.client.prefs.toggles & CHAT_GHOSTEARS))
if(M.stat == DEAD && M.client && M.is_preference_enabled(/datum/client_preference/ghost_ears))
listening |= M
continue
if(M.loc && M.locs[1] in hearturfs)

View File

@@ -20,7 +20,7 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/proc/toggle_hidden_verbs,
)
var/list/ai_verbs_hidden = list( // For why this exists, refer to https://xkcd.com/1172/
var/list/ai_verbs_hidden = list( // For why this exists, refer to https://xkcd.com/1172/,
/mob/living/silicon/ai/proc/ai_announcement,
/mob/living/silicon/ai/proc/ai_call_shuttle,
/mob/living/silicon/ai/proc/ai_camera_track,

View File

@@ -121,11 +121,11 @@
toggle = 0
on_ui_interact(mob/living/silicon/pai/user, datum/nanoui/ui=null, force_open=1)
data_core.get_manifest_json()
data_core.get_manifest_list()
var/data[0]
// This is dumb, but NanoUI breaks if it has no data to send
data["manifest"] = list("__json_cache" = ManifestJSON)
data["manifest"] = PDA_Manifest
ui = nanomanager.try_update_ui(user, user, id, ui, data, force_open)
if(!ui)

View File

@@ -11,8 +11,6 @@
//Has a list of items that it can hold.
var/list/can_hold = list(
/obj/item/weapon/cell,
/obj/item/weapon/firealarm_electronics,
/obj/item/weapon/airalarm_electronics,
/obj/item/weapon/airlock_electronics,
/obj/item/weapon/tracker_electronics,
/obj/item/weapon/module/power_control,
@@ -63,9 +61,9 @@
/obj/item/device/mmi,
/obj/item/robot_parts,
/obj/item/borg/upgrade,
/obj/item/device/flash, //to build borgs
/obj/item/organ/internal/brain, //to insert into MMIs.
/obj/item/stack/cable_coil, //again, for borg building
/obj/item/device/flash, //to build borgs,
/obj/item/organ/internal/brain, //to insert into MMIs,
/obj/item/stack/cable_coil, //again, for borg building,
/obj/item/weapon/circuitboard,
/obj/item/slime_extract,
/obj/item/weapon/reagent_containers/glass,

View File

@@ -9,7 +9,7 @@
message = sanitize(message)
if (stat == 2)
if (stat == DEAD)
return say_dead(message)
if(copytext(message,1,2) == "*")
@@ -34,7 +34,7 @@
for (var/mob/M in player_list)
if (istype(M, /mob/new_player))
continue
else if(M.stat == 2 && M.client.prefs.toggles & CHAT_GHOSTEARS)
else if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears))
if(M.client) M << "<b>[src]</b> transmits, \"[message]\""
return 1
return ..(message, 0)

View File

@@ -28,7 +28,7 @@
for (var/mob/M in player_list)
if (istype(M, /mob/new_player))
continue
else if(M.stat == 2 && M.client.prefs.toggles & CHAT_GHOSTEARS)
else if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears))
M << "The captive mind of [src] whispers, \"[message]\""
/mob/living/captive_brain/emote(var/message)

View File

@@ -38,5 +38,5 @@
for (var/mob/M in player_list)
if (istype(M, /mob/new_player))
continue
else if(M.stat == 2 && M.client.prefs.toggles & CHAT_GHOSTEARS)
else if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears))
M << "[src.truename] whispers to [host], \"[message]\""

View File

@@ -71,7 +71,7 @@
//Parrots will generally sit on their pertch unless something catches their eye.
//These vars store their preffered perch and if they dont have one, what they can use as a perch
var/obj/parrot_perch = null
var/obj/desired_perches = list(/obj/structure/computerframe, /obj/structure/displaycase, \
var/obj/desired_perches = list(/obj/structure/frame, /obj/structure/displaycase, \
/obj/structure/filingcabinet, /obj/machinery/teleport, \
/obj/machinery/computer, /obj/machinery/clonepod, \
/obj/machinery/dna_scannernew, /obj/machinery/telecomms, \

View File

@@ -110,7 +110,7 @@
turns_since_move++
if(turns_since_move >= turns_per_move)
if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled
/var/moving_to = 0 // otherwise it always picks 4, fuck if I know. Did I mention fuck BYOND
var/moving_to = 0 // otherwise it always picks 4, fuck if I know. Did I mention fuck BYOND
moving_to = pick(cardinal)
dir = moving_to //How about we turn them the direction they are moving, yay.
Move(get_step(src,moving_to))

View File

@@ -154,7 +154,9 @@
/mob/proc/buckled()
// Preliminary work for a future buckle rewrite,
// where one might be fully restrained (like an elecrical chair), or merely secured (shuttle chair, keeping you safe but not otherwise restrained from acting)
return buckled ? FULLY_BUCKLED : UNBUCKLED
if(!buckled)
return UNBUCKLED
return restrained() ? FULLY_BUCKLED : PARTIALLY_BUCKLED
/mob/proc/incapacitated(var/incapacitation_flags = INCAPACITATION_DEFAULT)
if (stat || paralysis || stunned || weakened || resting || sleeping || (status_flags & FAKEDEATH))
@@ -195,21 +197,6 @@
/mob/proc/show_inv(mob/user as mob)
user.set_machine(src)
var/dat = {"
<B><HR><FONT size=3>[name]</FONT></B>
<BR><HR>
<BR><B>Head(Mask):</B> <A href='?src=\ref[src];item=mask'>[(wear_mask ? wear_mask : "Nothing")]</A>
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=l_hand'>[(l_hand ? l_hand : "Nothing")]</A>
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=r_hand'>[(r_hand ? r_hand : "Nothing")]</A>
<BR><B>Back:</B> <A href='?src=\ref[src];item=back'>[(back ? back : "Nothing")]</A> [((istype(wear_mask, /obj/item/clothing/mask) && istype(back, /obj/item/weapon/tank) && !( internal )) ? text(" <A href='?src=\ref[];item=internal'>Set Internal</A>", src) : "")]
<BR>[(internal ? text("<A href='?src=\ref[src];item=internal'>Remove Internal</A>") : "")]
<BR><A href='?src=\ref[src];item=pockets'>Empty Pockets</A>
<BR><A href='?src=\ref[user];refresh=1'>Refresh</A>
<BR><A href='?src=\ref[user];mach_close=mob[name]'>Close</A>
<BR>"}
user << browse(dat, text("window=mob[];size=325x500", name))
onclose(user, "mob[name]")
return
//mob verbs are faster than object verbs. See http://www.byond.com/forum/?post=1326139&page=2#comment8198716 for why this isn't atom/verb/examine()
@@ -248,37 +235,6 @@
/mob/proc/ret_grab(obj/effect/list_container/mobl/L as obj, flag)
if ((!( istype(l_hand, /obj/item/weapon/grab) ) && !( istype(r_hand, /obj/item/weapon/grab) )))
if (!( L ))
return null
else
return L.container
else
if (!( L ))
L = new /obj/effect/list_container/mobl( null )
L.container += src
L.master = src
if (istype(l_hand, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = l_hand
if (!( L.container.Find(G.affecting) ))
L.container += G.affecting
if (G.affecting)
G.affecting.ret_grab(L, 1)
if (istype(r_hand, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = r_hand
if (!( L.container.Find(G.affecting) ))
L.container += G.affecting
if (G.affecting)
G.affecting.ret_grab(L, 1)
if (!( flag ))
if (L.master == src)
var/list/temp = list( )
temp += L.container
//L = null
qdel(L)
return temp
else
return L.container
return
/mob/verb/mode()
@@ -286,18 +242,6 @@
set category = "Object"
set src = usr
if(istype(loc,/obj/mecha)) return
if(hand)
var/obj/item/W = l_hand
if (W)
W.attack_self(src)
update_inv_l_hand()
else
var/obj/item/W = r_hand
if (W)
W.attack_self(src)
update_inv_r_hand()
return
/*
@@ -735,65 +679,6 @@
//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
/mob/proc/update_canmove()
if(!resting && cannot_stand() && can_stand_overridden())
lying = 0
canmove = 1
else
if(istype(buckled, /obj/vehicle))
var/obj/vehicle/V = buckled
if(cannot_stand())
lying = 0
canmove = 1
pixel_y = V.mob_offset_y - 5
else
if(buckled.buckle_lying != -1) lying = buckled.buckle_lying
canmove = 1
pixel_y = V.mob_offset_y
else if(buckled)
anchored = 1
canmove = 0
if(istype(buckled))
if(buckled.buckle_lying != -1)
lying = buckled.buckle_lying
if(buckled.buckle_movable)
anchored = 0
canmove = 1
else if(cannot_stand())
lying = 1
canmove = 0
else if(stunned)
canmove = 0
else if(captured)
anchored = 1
canmove = 0
lying = 0
else
lying = 0
canmove = 1
if(lying)
density = 0
if(l_hand) unEquip(l_hand)
if(r_hand) unEquip(r_hand)
else
density = initial(density)
for(var/obj/item/weapon/grab/G in grabbed_by)
if(G.state >= GRAB_AGGRESSIVE)
canmove = 0
break
//Temporarily moved here from the various life() procs
//I'm fixing stuff incrementally so this will likely find a better home.
//It just makes sense for now. ~Carn
if( update_icon ) //forces a full overlay update
update_icon = 0
regenerate_icons()
else if( lying != lying_prev )
update_icons()
return canmove
@@ -1007,8 +892,7 @@ mob/proc/yank_out_object()
R.adjustFireLoss(10)
selection.forceMove(get_turf(src))
if(!(U.l_hand && U.r_hand))
U.put_in_hands(selection)
U.put_in_hands(selection)
for(var/obj/item/weapon/O in pinned)
if(O == selection)

View File

@@ -60,7 +60,6 @@
var/next_move = null
var/transforming = null //Carbon
var/other = 0.0
var/hand = null
var/eye_blind = null //Carbon
var/eye_blurry = null //Carbon
var/ear_deaf = null //Carbon
@@ -119,12 +118,6 @@
var/m_intent = "run"//Living
var/lastKnownIP = null
var/obj/buckled = null//Living
var/obj/item/l_hand = null//Living
var/obj/item/r_hand = null//Living
var/obj/item/weapon/back = null//Human/Monkey
var/obj/item/weapon/tank/internal = null//Human/Monkey
var/obj/item/weapon/storage/s_active = null//Carbon
var/obj/item/clothing/mask/wear_mask = null//Carbon
var/seer = 0 //for cult//Carbon, probably Human

View File

@@ -5,8 +5,10 @@
///Called by client/Move()
///Checks to see if you are grabbing anything and if moving will affect your grab.
/client/proc/Process_Grab()
for(var/obj/item/weapon/grab/G in list(mob.l_hand, mob.r_hand))
G.reset_kill_state() //no wandering across the station/asteroid while choking someone
if(istype(mob, /mob/living))
var/mob/living/L = mob
for(var/obj/item/weapon/grab/G in list(L.l_hand, L.r_hand))
G.reset_kill_state() //no wandering across the station/asteroid while choking someone
/obj/item/weapon/grab
name = "grab"

View File

@@ -288,12 +288,6 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
/mob/proc/abiotic(var/full_body = 0)
if(full_body && ((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )) || (src.back || src.wear_mask)))
return 1
if((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )))
return 1
return 0
//converts intent-strings into numbers and back
@@ -391,7 +385,7 @@ proc/is_blind(A)
name = realname
for(var/mob/M in player_list)
if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || (M.client.holder && !is_mentor(M.client))) && (M.client.prefs.toggles & CHAT_DEAD))
if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || (M.client.holder && !is_mentor(M.client))) && M.is_preference_enabled(/datum/client_preference/show_dsay))
var/follow
var/lname
if(subject)

View File

@@ -54,7 +54,7 @@
src << "<span class='danger'>Deadchat is globally muted.</span>"
return
if(client && !(client.prefs.toggles & CHAT_DEAD))
if(!is_preference_enabled(/datum/client_preference/show_dsay))
usr << "<span class='danger'>You have deadchat muted.</span>"
return

View File

@@ -15,8 +15,8 @@ mob/var/obj/effect/decal/typing_indicator
typing_indicator.icon_state = "typing"
if(client && !stat)
typing_indicator.invisibility = invisibility
if(client.prefs.toggles & SHOW_TYPING)
typing_indicator.invisibility = invisibility
if(!is_preference_enabled(/datum/client_preference/show_typing_indicator))
overlays -= typing_indicator
else
if(state)
@@ -54,35 +54,20 @@ mob/var/obj/effect/decal/typing_indicator
me_verb(message)
/mob/proc/handle_typing_indicator()
if(client)
if(!(client.prefs.toggles & SHOW_TYPING) && !hud_typing)
var/temp = winget(client, "input", "text")
if(is_preference_enabled(/datum/client_preference/show_typing_indicator) && !hud_typing)
var/temp = winget(client, "input", "text")
if (temp != last_typed)
last_typed = temp
last_typed_time = world.time
if (temp != last_typed)
last_typed = temp
last_typed_time = world.time
if (world.time > last_typed_time + TYPING_INDICATOR_LIFETIME)
set_typing_indicator(0)
return
if(length(temp) > 5 && findtext(temp, "Say \"", 1, 7))
set_typing_indicator(1)
else if(length(temp) > 3 && findtext(temp, "Me ", 1, 5))
set_typing_indicator(1)
if (world.time > last_typed_time + TYPING_INDICATOR_LIFETIME)
set_typing_indicator(0)
return
if(length(temp) > 5 && findtext(temp, "Say \"", 1, 7))
set_typing_indicator(1)
else if(length(temp) > 3 && findtext(temp, "Me ", 1, 5))
set_typing_indicator(1)
else
set_typing_indicator(0)
/client/verb/typing_indicator()
set name = "Show/Hide Typing Indicator"
set category = "Preferences"
set desc = "Toggles showing an indicator when you are typing emote or say message."
prefs.toggles ^= SHOW_TYPING
prefs.save_preferences()
src << "You will [(prefs.toggles & SHOW_TYPING) ? "no longer" : "now"] display a typing indicator."
// Clear out any existing typing indicator.
if(prefs.toggles & SHOW_TYPING)
if(istype(mob)) mob.set_typing_indicator(0)
feedback_add_details("admin_verb","TID") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
else
set_typing_indicator(0)

View File

@@ -19,6 +19,15 @@
/mob/proc/update_inv_back()
return
/mob/proc/update_inv_active_hand()
return
/mob/living/update_inv_active_hand(var/A)
if(hand)
update_inv_l_hand(A)
else
update_inv_r_hand(A)
/mob/proc/update_inv_l_hand()
return

View File

@@ -98,7 +98,7 @@
if (2)
take_damage(4)
/obj/item/organ/external/attack_self(var/mob/user)
/obj/item/organ/external/attack_self(var/mob/living/user)
if(!contents.len)
return ..()
var/list/removable_objects = list()
@@ -113,8 +113,7 @@
var/obj/item/I = pick(removable_objects)
I.loc = get_turf(user) //just in case something was embedded that is not an item
if(istype(I))
if(!(user.l_hand && user.r_hand))
user.put_in_hands(I)
user.put_in_hands(I)
user.visible_message("<span class='danger'>\The [user] rips \the [I] out of \the [src]!</span>")
return //no eating the limb until everything's been removed
return ..()
@@ -128,7 +127,7 @@
usr << "<span class='danger'>There is \a [I] sticking out of it.</span>"
return
/obj/item/organ/external/attackby(obj/item/weapon/W as obj, mob/user as mob)
/obj/item/organ/external/attackby(obj/item/weapon/W as obj, mob/living/user as mob)
switch(stage)
if(0)
if(istype(W,/obj/item/weapon/scalpel))
@@ -145,8 +144,7 @@
if(contents.len)
var/obj/item/removing = pick(contents)
removing.loc = get_turf(user.loc)
if(!(user.l_hand && user.r_hand))
user.put_in_hands(removing)
user.put_in_hands(removing)
user.visible_message("<span class='danger'><b>[user]</b> extracts [removing] from [src] with [W]!</span>")
else
user.visible_message("<span class='danger'><b>[user]</b> fishes around fruitlessly in [src] with [W].</span>")

View File

@@ -14,6 +14,7 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
use_power = 1
idle_power_usage = 30
active_power_usage = 200
frame_type = "fax"
var/obj/item/weapon/card/id/scan = null // identification
var/authenticated = 0

View File

@@ -17,12 +17,10 @@
density = 1
anchored = 1
/obj/structure/filingcabinet/chestdrawer
name = "chest drawer"
icon_state = "chestdrawer"
/obj/structure/filingcabinet/filingcabinet //not changing the path to avoid unecessary map issues, but please don't name stuff like this in the future -Pete
icon_state = "tallcabinet"
@@ -46,6 +44,16 @@
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
anchored = !anchored
user << "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>"
else if(istype(P, /obj/item/weapon/screwdriver))
user << "<span class='notice'>You begin taking the [name] apart.</span>"
if(do_after(user, 10))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You take the [name] apart.</span>"
new /obj/item/stack/material/steel( src.loc, 4 )
for(var/obj/item/I in contents)
I.forceMove(loc)
qdel(src)
return
else
user << "<span class='notice'>You can't put [P] in [src]!</span>"
@@ -151,7 +159,7 @@
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src)
P.info = "<CENTER><B>Medical Record</B></CENTER><BR>"
P.info += "Name: [G.fields["name"]] ID: [G.fields["id"]]<BR>\nSex: [G.fields["sex"]]<BR>\nAge: [G.fields["age"]]<BR>\nFingerprint: [G.fields["fingerprint"]]<BR>\nPhysical Status: [G.fields["p_stat"]]<BR>\nMental Status: [G.fields["m_stat"]]<BR>"
P.info += "<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: [M.fields["b_type"]]<BR>\nDNA: [M.fields["b_dna"]]<BR>\n<BR>\nMinor Disabilities: [M.fields["mi_dis"]]<BR>\nDetails: [M.fields["mi_dis_d"]]<BR>\n<BR>\nMajor Disabilities: [M.fields["ma_dis"]]<BR>\nDetails: [M.fields["ma_dis_d"]]<BR>\n<BR>\nAllergies: [M.fields["alg"]]<BR>\nDetails: [M.fields["alg_d"]]<BR>\n<BR>\nCurrent Diseases: [M.fields["cdi"]] (per disease info placed in log/comment section)<BR>\nDetails: [M.fields["cdi_d"]]<BR>\n<BR>\nImportant Notes:<BR>\n\t[M.fields["notes"]]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>"
var/counter = 1
while(M.fields["com_[counter]"])

View File

@@ -337,8 +337,9 @@
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))
if(usr.back && istype(usr.back,/obj/item/weapon/rig))
var/obj/item/weapon/rig/r = usr.back
var/mob/living/M = usr
if(istype(M) && M.back && istype(M.back,/obj/item/weapon/rig))
var/obj/item/weapon/rig/r = M.back
var/obj/item/rig_module/device/pen/m = locate(/obj/item/rig_module/device/pen) in r.installed_modules
if(!r.offline && m)
i = m.device

View File

@@ -111,8 +111,8 @@
/*
* Parapens
*/
/obj/item/weapon/pen/reagent/paralysis
origin_tech = "materials=2;syndicate=5"
/obj/item/weapon/pen/reagent/paralysis
origin_tech = list(TECH_MATERIAL = 2, TECH_ILLEGAL = 5)
/obj/item/weapon/pen/reagent/paralysis/New()
..()

View File

@@ -9,11 +9,21 @@
idle_power_usage = 30
active_power_usage = 200
power_channel = EQUIP
circuit = /obj/item/weapon/circuitboard/photocopier
frame_type = "photocopier"
var/obj/item/copyitem = null //what's in the copier!
var/copies = 1 //how many copies to print!
var/toner = 30 //how much toner is left! woooooo~
var/maxcopies = 10 //how many copies can be copied at once- idea shamelessly stolen from bs12's copier!
/obj/machinery/photocopier/New()
component_parts = list()
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
component_parts += new /obj/item/weapon/stock_parts/motor(src)
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
RefreshParts()
/obj/machinery/photocopier/attack_ai(mob/user as mob)
return attack_hand(user)
@@ -126,6 +136,12 @@
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
anchored = !anchored
user << "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>"
else if(default_deconstruction_screwdriver(user, O))
return
else if(default_deconstruction_crowbar(user, O))
return
return
/obj/machinery/photocopier/ex_act(severity)

View File

@@ -91,7 +91,7 @@ var/global/photo_count = 0
/obj/item/weapon/storage/photo_album/MouseDrop(obj/over_object as obj)
if((istype(usr, /mob/living/carbon/human)))
var/mob/M = usr
var/mob/living/carbon/human/M = usr
if(!( istype(over_object, /obj/screen) ))
return ..()
playsound(loc, "rustle", 50, 1, -5)

View File

@@ -52,6 +52,10 @@
name = "centcomm rubber stamp"
icon_state = "stamp-cent"
/obj/item/weapon/stamp/qm
name = "quartermaster's stamp"
icon_state = "stamp-qm"
// Syndicate stamp to forge documents.
/obj/item/weapon/stamp/chameleon/attack_self(mob/user as mob)

View File

@@ -9,6 +9,7 @@
input_level_max = 0
output_level_max = 0
icon_state = "gsmes"
circuit = /obj/item/weapon/circuitboard/batteryrack
var/cells_amount = 0
var/capacitors_amount = 0
var/global/list/br_cache = null
@@ -22,7 +23,6 @@
//Maybe this should be moved up to obj/machinery
/obj/machinery/power/smes/batteryrack/proc/add_parts()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/batteryrack
component_parts += new /obj/item/weapon/cell/high
component_parts += new /obj/item/weapon/cell/high
component_parts += new /obj/item/weapon/cell/high
@@ -49,7 +49,7 @@
/obj/machinery/power/smes/batteryrack/update_icon()
overlays.Cut()
if(stat & BROKEN) return
if(!br_cache)
br_cache = list()
br_cache.len = 7
@@ -60,7 +60,7 @@
br_cache[5] = image('icons/obj/power.dmi', "gsmes_og2")
br_cache[6] = image('icons/obj/power.dmi', "gsmes_og3")
br_cache[7] = image('icons/obj/power.dmi', "gsmes_og4")
if (output_attempt)
overlays += br_cache[1]
if(inputting)
@@ -83,9 +83,10 @@
if (charge < (capacity / 100))
if (!output_attempt && !input_attempt)
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
var/obj/structure/frame/M = new /obj/structure/frame(src.loc)
M.frame_type = "machine"
M.state = 2
M.icon_state = "box_1"
M.icon_state = "machine_1"
for(var/obj/I in component_parts)
I.loc = src.loc
qdel(src)
@@ -117,12 +118,12 @@
/obj/machinery/power/smes/batteryrack/makeshift
name = "makeshift PSU"
desc = "A rack of batteries connected by a mess of wires posing as a PSU."
circuit = /obj/item/weapon/circuitboard/ghettosmes
var/overcharge_percent = 0
/obj/machinery/power/smes/batteryrack/makeshift/add_parts()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/ghettosmes
component_parts += new /obj/item/weapon/cell/high
component_parts += new /obj/item/weapon/cell/high
component_parts += new /obj/item/weapon/cell/high

View File

@@ -12,7 +12,7 @@
9 1 5
\ | /
8 - 0 - 4
8 - 0 - 4,
/ | \
10 2 6

View File

@@ -287,14 +287,15 @@
else
user << "\blue You close the access panel."
else if(istype(O, /obj/item/weapon/crowbar) && open)
var/obj/machinery/constructable_frame/machine_frame/new_frame = new /obj/machinery/constructable_frame/machine_frame(src.loc)
var/obj/structure/frame/new_frame = new /obj/structure/frame(src.loc)
for(var/obj/item/I in component_parts)
I.loc = src.loc
while ( sheets > 0 )
DropFuel()
new_frame.frame_type = "machine"
new_frame.state = 2
new_frame.icon_state = "box_1"
new_frame.icon_state = "machine_1"
qdel(src)
/obj/machinery/power/port_gen/pacman/attack_hand(mob/user as mob)

View File

@@ -12,6 +12,7 @@
density = 1
anchored = 1
use_power = 0
circuit = /obj/item/weapon/circuitboard/smes
var/capacity = 5e6 // maximum charge
var/charge = 1e6 // actual charge

View File

@@ -116,7 +116,6 @@
/obj/machinery/power/smes/buildable/New(var/install_coils = 1)
component_parts = list()
component_parts += new /obj/item/stack/cable_coil(src,30)
component_parts += new /obj/item/weapon/circuitboard/smes(src)
src.wires = new /datum/wires/smes(src)
// Allows for mapped-in SMESs with larger capacity/IO
@@ -345,9 +344,10 @@
return
usr << "\red You have disassembled the SMES cell!"
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
var/obj/structure/frame/M = new /obj/structure/frame(src.loc)
M.frame_type = "machine"
M.state = 2
M.icon_state = "box_1"
M.icon_state = "machine_1"
for(var/obj/I in component_parts)
I.loc = src.loc
component_parts -= I

View File

@@ -407,25 +407,27 @@ var/list/solars_list = list()
if(do_after(user, 20))
if (src.stat & BROKEN)
user << "\blue The broken glass falls out."
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
var/obj/structure/frame/A = new /obj/structure/frame( src.loc )
new /obj/item/weapon/material/shard( src.loc )
var/obj/item/weapon/circuitboard/solar_control/M = new /obj/item/weapon/circuitboard/solar_control( A )
for (var/obj/C in src)
C.loc = src.loc
A.circuit = M
A.frame_type = "computer"
A.state = 3
A.icon_state = "3"
A.icon_state = "computer_3"
A.anchored = 1
qdel(src)
else
user << "\blue You disconnect the monitor."
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
var/obj/structure/frame/A = new /obj/structure/frame( src.loc )
var/obj/item/weapon/circuitboard/solar_control/M = new /obj/item/weapon/circuitboard/solar_control( A )
for (var/obj/C in src)
C.loc = src.loc
A.circuit = M
A.frame_type = "computer"
A.state = 4
A.icon_state = "4"
A.icon_state = "computer_4"
A.anchored = 1
qdel(src)
else

View File

@@ -93,7 +93,7 @@
if(requires_two_hands)
var/mob/living/M = loc
if(istype(M))
if((M.l_hand == src && !M.r_hand) || (M.r_hand == src && !M.l_hand))
if(M.item_is_in_hands(src) && !M.hands_are_full())
name = "[initial(name)] (wielded)"
item_state = wielded_icon
else
@@ -179,7 +179,7 @@
var/held_acc_mod = 0
var/held_disp_mod = 0
if(requires_two_hands)
if((user.l_hand == src && user.r_hand) || (user.r_hand == src && user.l_hand))
if(user.item_is_in_hands(src) && user.hands_are_full())
held_acc_mod = -3
held_disp_mod = 3

View File

@@ -1,6 +1,6 @@
/obj/item/weapon/gun/projectile/colt
var/unique_reskin
name = "vintage .45 pistol"
name = ".45 pistol"
desc = "A cheap Martian knock-off of a Colt M1911. Uses .45 rounds."
magazine_type = /obj/item/ammo_magazine/c45m
icon_state = "colt"
@@ -171,10 +171,10 @@
name = "holdout signal pistol"
magazine_type = /obj/item/ammo_magazine/mc9mm/flash
/obj/item/weapon/gun/projectile/pistol/attack_hand(mob/user as mob)
/obj/item/weapon/gun/projectile/pistol/attack_hand(mob/living/user as mob)
if(user.get_inactive_hand() == src)
if(silenced)
if(user.l_hand != src && user.r_hand != src)
if(!user.item_is_in_hands(src))
..()
return
user << "<span class='notice'>You unscrew [silenced] from [src].</span>"
@@ -185,9 +185,9 @@
return
..()
/obj/item/weapon/gun/projectile/pistol/attackby(obj/item/I as obj, mob/user as mob)
/obj/item/weapon/gun/projectile/pistol/attackby(obj/item/I as obj, mob/living/user as mob)
if(istype(I, /obj/item/weapon/silencer))
if(user.l_hand != src && user.r_hand != src) //if we're not in his hands
if(!user.item_is_in_hands(src)) //if we're not in his hands
user << "<span class='notice'>You'll need [src] in your hands to do that.</span>"
return
user.drop_item()

View File

@@ -113,7 +113,8 @@ obj/aiming_overlay/proc/update_aiming_deferred()
var/cancel_aim = 1
if(!(aiming_with in owner) || (istype(owner, /mob/living/carbon/human) && (owner.l_hand != aiming_with && owner.r_hand != aiming_with)))
var/mob/living/carbon/human/H = owner
if(!(aiming_with in owner) || (istype(H) && !H.item_is_in_hands(aiming_with)))
owner << "<span class='warning'>You must keep hold of your weapon!</span>"
else if(owner.eye_blind)
owner << "<span class='warning'>You are blind and cannot see your target!</span>"

View File

@@ -310,6 +310,7 @@
use_power = 1
idle_power_usage = 5
active_power_usage = 100
circuit = /obj/item/weapon/circuitboard/grinder
var/inuse = 0
var/obj/item/weapon/reagent_containers/beaker = null
var/limit = 10
@@ -326,6 +327,10 @@
/obj/machinery/reagentgrinder/New()
..()
beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
component_parts = list()
component_parts += new /obj/item/weapon/stock_parts/motor(src)
component_parts += new /obj/item/weapon/stock_parts/gear(src)
RefreshParts()
return
/obj/machinery/reagentgrinder/update_icon()
@@ -333,6 +338,11 @@
return
/obj/machinery/reagentgrinder/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(beaker)
if(default_deconstruction_screwdriver(user, O))
return
if(default_deconstruction_crowbar(user, O))
return
if (istype(O,/obj/item/weapon/reagent_containers/glass) || \
istype(O,/obj/item/weapon/reagent_containers/food/drinks/drinkingglass) || \

View File

@@ -127,7 +127,7 @@ About the Holder:
trans_to_obj(var/turf/target, var/amount = 1, var/multiplier = 1, var/copy = 0)
If target has reagents, transfers [amount] to it. Otherwise, same as trans_to_turf().
/atom/proc/create_reagents(var/max_vol)
atom/proc/create_reagents(var/max_vol)
Creates a new reagent datum.
About Reagents:
@@ -285,7 +285,7 @@ About the Tools:
By default, all atom have a reagents var - but its empty. if you want to use an object for the chem.
system you'll need to add something like this in its new proc:
/atom/proc/create_reagents(var/max_volume)
atom/proc/create_reagents(var/max_volume)
Other important stuff:

View File

@@ -22,6 +22,13 @@
M.nutrition += nutriment_factor * removed // For hunger and fatness
M.add_chemical_effect(CE_BLOODRESTORE, 4 * removed)
/datum/reagent/nutriment/glucose
name = "Glucose"
id = "glucose"
color = "#FFFFFF"
injectable = 1
/datum/reagent/nutriment/protein // Bad for Skrell!
name = "animal protein"
id = "protein"

View File

@@ -145,7 +145,7 @@
group = "Reagents"
#define SEC_PACK(_tname, _type, _name, _cname, _cost, _access)\
/datum/supply_packs/dispenser_cartridges{\
datum/supply_packs/dispenser_cartridges{\
_tname {\
name = _name ;\
containername = _cname ;\
@@ -157,7 +157,7 @@
}\
}
#define PACK(_tname, _type, _name, _cname, _cost)\
/datum/supply_packs/dispenser_cartridges{\
datum/supply_packs/dispenser_cartridges{\
_tname {\
name = _name ;\
containername = _cname ;\

View File

@@ -40,7 +40,7 @@
/obj/machinery/sleeper,
/obj/machinery/smartfridge/,
/obj/machinery/biogenerator,
/obj/machinery/constructable_frame,
/obj/structure/frame,
/obj/machinery/radiocarbon_spectrometer
)
@@ -246,6 +246,17 @@
var/image/lid = image(icon, src, "lid_[initial(icon_state)]")
overlays += lid
/obj/item/weapon/reagent_containers/glass/cooler_bottle
desc = "A bottle for a water-cooler."
name = "water-cooler bottle"
icon = 'icons/obj/vending.dmi'
icon_state = "water_cooler_bottle"
matter = list(DEFAULT_WALL_MATERIAL = 200)
w_class = 3.0
amount_per_transfer_from_this = 20
possible_transfer_amounts = list(10,20,30,60,120)
volume = 120
/*
/obj/item/weapon/reagent_containers/glass/blender_jug
name = "Blender Jug"

View File

@@ -3,7 +3,7 @@
////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/pill
name = "pill"
desc = "a pill."
desc = "A pill."
icon = 'icons/obj/chemical.dmi'
icon_state = null
item_state = "pill"

View File

@@ -202,10 +202,69 @@
icon_state = "water_cooler"
possible_transfer_amounts = null
anchored = 1
New()
..()
reagents.add_reagent("water",500)
var/bottle = 0
/obj/structure/reagent_dispensers/water_cooler/New()
if(bottle == 1)
..()
reagents.add_reagent("water",120)
else
icon_state = "water_cooler_0"
/obj/structure/reagent_dispensers/water_cooler/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/weapon/wrench))
src.add_fingerprint(user)
if(bottle)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 20))
user << "<span class='notice'>You unfasten the jug.</span>"
var/obj/item/weapon/reagent_containers/glass/cooler_bottle/G = new /obj/item/weapon/reagent_containers/glass/cooler_bottle( src.loc )
for(var/datum/reagent/R in reagents.reagent_list)
var/total_reagent = reagents.get_reagent_amount(R.id)
G.reagents.add_reagent(R.id, total_reagent)
reagents.clear_reagents()
bottle = 0
icon_state = "water_cooler_0"
else
if(anchored)
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
else
user.visible_message("\The [user] begins securing \the [src] to the floor.", "You start securing \the [src] to the floor.")
if(do_after(user, 20, src))
if(!src) return
user << "<span class='notice'>You [anchored? "un" : ""]secured \the [src]!</span>"
anchored = !anchored
return
if(istype(I, /obj/item/weapon/screwdriver))
if(!bottle)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
user << "<span class='notice'>You take the water-cooler apart.</span>"
new /obj/item/stack/material/plastic( src.loc, 4 )
qdel(src)
return
if(istype(I, /obj/item/weapon/reagent_containers/glass/cooler_bottle))
src.add_fingerprint(user)
if(!bottle)
if(anchored)
var/obj/item/weapon/reagent_containers/glass/cooler_bottle/G = I
user << "<span class='notice'>You start to screw the bottle onto the water-cooler.</span>"
if(do_after(user, 20))
bottle = 1
icon_state = "water_cooler"
user << "<span class='notice'>You screw the bottle onto the water-cooler but accidently spill some!</span>" //you spill some because it for somereason transfers 5 units to the bottle after it gets attached but before it's deleted...
for(var/datum/reagent/R in G.reagents.reagent_list)
var/total_reagent = G.reagents.get_reagent_amount(R.id)
reagents.add_reagent(R.id, total_reagent)
qdel(G)
else
user << "<span class='warning'>You need to wrench down the cooler first.</span>"
else
user << "<span class='warning'>There is already a bottle there!</span>"
return
else
return ..()
/obj/structure/reagent_dispensers/beerkeg
name = "beer keg"

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