Merge pull request #11 from Citadel-Station-13/master

Updating
This commit is contained in:
Neri
2017-10-08 15:17:40 -07:00
committed by GitHub
219 changed files with 2688 additions and 2688 deletions
+1 -2
View File
@@ -93,7 +93,6 @@
#define BANTYPE_ADMIN_TEMP 8 #define BANTYPE_ADMIN_TEMP 8
#define BANTYPE_ANY_JOB 9 //used to remove jobbans #define BANTYPE_ANY_JOB 9 //used to remove jobbans
//Please don't edit these values without speaking to Errorage first ~Carn
//Admin Permissions //Admin Permissions
#define R_BUILDMODE 1 #define R_BUILDMODE 1
#define R_ADMIN 2 #define R_ADMIN 2
@@ -113,7 +112,7 @@
#error Remove the flag below , its been long enough #error Remove the flag below , its been long enough
#endif #endif
//legacy , remove post 512, it was replaced by R_POLL //legacy , remove post 512, it was replaced by R_POLL
#define R_REJUVINATE 2 #define R_REJUVINATE 2
#define R_MAXPERMISSION 4096 //This holds the maximum value for a permission. It is used in iteration, so keep it updated. #define R_MAXPERMISSION 4096 //This holds the maximum value for a permission. It is used in iteration, so keep it updated.
+11 -3
View File
@@ -118,8 +118,8 @@
#define PRESSURE_DAMAGE_COEFFICIENT 4 //The amount of pressure damage someone takes is equal to (pressure / HAZARD_HIGH_PRESSURE)*PRESSURE_DAMAGE_COEFFICIENT, with the maximum of MAX_PRESSURE_DAMAGE #define PRESSURE_DAMAGE_COEFFICIENT 4 //The amount of pressure damage someone takes is equal to (pressure / HAZARD_HIGH_PRESSURE)*PRESSURE_DAMAGE_COEFFICIENT, with the maximum of MAX_PRESSURE_DAMAGE
#define MAX_HIGH_PRESSURE_DAMAGE 4 //This used to be 20... I got this much random rage for some retarded decision by polymorph?! Polymorph now lies in a pool of blood with a katana jammed in his spleen. ~Errorage --PS: The katana did less than 20 damage to him :( #define MAX_HIGH_PRESSURE_DAMAGE 4
#define LOW_PRESSURE_DAMAGE 2 //The amounb of damage someone takes when in a low pressure area (The pressure threshold is so low that it doesn't make sense to do any calculations, so it just applies this flat value). #define LOW_PRESSURE_DAMAGE 2 //The amount of damage someone takes when in a low pressure area (The pressure threshold is so low that it doesn't make sense to do any calculations, so it just applies this flat value).
#define COLD_SLOWDOWN_FACTOR 20 //Humans are slowed by the difference between bodytemp and BODYTEMP_COLD_DAMAGE_LIMIT divided by this #define COLD_SLOWDOWN_FACTOR 20 //Humans are slowed by the difference between bodytemp and BODYTEMP_COLD_DAMAGE_LIMIT divided by this
@@ -175,4 +175,12 @@
#define LAVALAND_EQUIPMENT_EFFECT_PRESSURE 50 //what pressure you have to be under to increase the effect of equipment meant for lavaland #define LAVALAND_EQUIPMENT_EFFECT_PRESSURE 50 //what pressure you have to be under to increase the effect of equipment meant for lavaland
#define LAVALAND_DEFAULT_ATMOS "o2=14;n2=23;TEMP=300" #define LAVALAND_DEFAULT_ATMOS "o2=14;n2=23;TEMP=300"
#define THERMAL_ENERGY(gas) (gas.temperature * gas.heat_capacity()) #define THERMAL_ENERGY(gas) (gas.temperature * gas.heat_capacity())
#define ADD_GAS(gas_id, out_list)\
var/list/tmp_gaslist = GLOB.gaslist_cache[gas_id];\
out_list[gas_id] = tmp_gaslist.Copy();
//ASSERT_GAS(gas_id, gas_mixture) - used to guarantee that the gas list for this id exists in gas_mixture.gases.
//Must be used before adding to a gas. May be used before reading from a gas.
#define ASSERT_GAS(gas_id, gas_mixture) if (!gas_mixture.gases[gas_id]) { ADD_GAS(gas_id, gas_mixture.gases) };
+1 -1
View File
@@ -70,4 +70,4 @@
#define ADMIN_MARKREAD(client) "(<a href='?_src_=holder;markedread=\ref[client]'>MARK READ</a>)"//marks an adminhelp as read and under investigation #define ADMIN_MARKREAD(client) "(<a href='?_src_=holder;markedread=\ref[client]'>MARK READ</a>)"//marks an adminhelp as read and under investigation
#define ADMIN_IC(client) "(<a href='?_src_=holder;icissue=\ref[client]'>IC</a>)"//marks and adminhelp as an IC issue #define ADMIN_IC(client) "(<a href='?_src_=holder;icissue=\ref[client]'>IC</a>)"//marks and adminhelp as an IC issue
#define ADMIN_REJECT(client) "(<a href='?_src_=holder;rejectadminhelp=\ref[client]'>REJT</a>)"//Rejects an adminhelp for being unclear or otherwise unhelpful. resets their adminhelp timer #define ADMIN_REJECT(client) "(<a href='?_src_=holder;rejectadminhelp=\ref[client]'>REJT</a>)"//Rejects an adminhelp for being unclear or otherwise unhelpful. resets their adminhelp timer
+1
View File
@@ -2,6 +2,7 @@
#define CONFIG_DEF(X) /datum/config_entry/##X { resident_file = CURRENT_RESIDENT_FILE }; /datum/config_entry/##X #define CONFIG_DEF(X) /datum/config_entry/##X { resident_file = CURRENT_RESIDENT_FILE }; /datum/config_entry/##X
#define CONFIG_GET(X) global.config.Get(/datum/config_entry/##X) #define CONFIG_GET(X) global.config.Get(/datum/config_entry/##X)
#define CONFIG_SET(X, Y) global.config.Set(/datum/config_entry/##X, ##Y) #define CONFIG_SET(X, Y) global.config.Set(/datum/config_entry/##X, ##Y)
#define CONFIG_TWEAK(X) /datum/config_entry/##X
#define CONFIG_MAPS_FILE "maps.txt" #define CONFIG_MAPS_FILE "maps.txt"
+2
View File
@@ -133,6 +133,8 @@
#define isovermind(A) (istype(A, /mob/camera/blob)) #define isovermind(A) (istype(A, /mob/camera/blob))
#define iscameramob(A) (istype(A, /mob/camera))
//Objects //Objects
#define isobj(A) istype(A, /obj) //override the byond proc because it returns true on children of /atom/movable that aren't objs #define isobj(A) istype(A, /obj) //override the byond proc because it returns true on children of /atom/movable that aren't objs
+3 -1
View File
@@ -24,6 +24,7 @@
#define ROLE_SERVANT_OF_RATVAR "servant of Ratvar" #define ROLE_SERVANT_OF_RATVAR "servant of Ratvar"
#define ROLE_BORER "borer" #define ROLE_BORER "borer"
#define ROLE_BROTHER "blood brother" #define ROLE_BROTHER "blood brother"
#define ROLE_MISCREANT "miscreant"
//Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR. //Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR.
//The gamemode specific ones are just so the gamemodes can query whether a player is old enough //The gamemode specific ones are just so the gamemodes can query whether a player is old enough
@@ -46,7 +47,8 @@ GLOBAL_LIST_INIT(special_roles, list(
ROLE_ABDUCTOR = /datum/game_mode/abduction, ROLE_ABDUCTOR = /datum/game_mode/abduction,
ROLE_DEVIL = /datum/game_mode/devil, ROLE_DEVIL = /datum/game_mode/devil,
ROLE_BORER, ROLE_BORER,
ROLE_SERVANT_OF_RATVAR = /datum/game_mode/clockwork_cult ROLE_SERVANT_OF_RATVAR = /datum/game_mode/clockwork_cult,
ROLE_MISCREANT
)) ))
//Job defines for what happens when you fail to qualify for any job during job selection //Job defines for what happens when you fail to qualify for any job during job selection
+1 -1
View File
@@ -289,7 +289,7 @@ Turf and target are separate in case you want to teleport some distance from a t
var/list/pois = list() var/list/pois = list()
for(var/mob/M in mobs) for(var/mob/M in mobs)
if(skip_mindless && (!M.mind && !M.ckey)) if(skip_mindless && (!M.mind && !M.ckey))
if(!isbot(M) && !istype(M, /mob/camera) && !ismegafauna(M)) if(!isbot(M) && !iscameramob(M) && !ismegafauna(M))
continue continue
if(M.client && M.client.holder && M.client.holder.fakekey) //stealthmins if(M.client && M.client.holder && M.client.holder.fakekey) //stealthmins
continue continue
-7
View File
@@ -7,13 +7,6 @@ GLOBAL_LIST_INIT(cardinals, list(NORTH, SOUTH, EAST, WEST))
GLOBAL_LIST_INIT(alldirs, list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)) GLOBAL_LIST_INIT(alldirs, list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST))
GLOBAL_LIST_INIT(diagonals, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)) GLOBAL_LIST_INIT(diagonals, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST))
//This list contains the z-level numbers which can be accessed via space travel and the percentile chances to get there.
//(Exceptions: extended, sandbox and nuke) -Errorage
//Was list("3" = 30, "4" = 70).
//Spacing should be a reliable method of getting rid of a body -- Urist.
//Go away Urist, I'm restoring this to the longer list. ~Errorage
GLOBAL_LIST_INIT(accessable_z_levels, list(1,3,4,5,6,7)) //Keep this to six maps, repeating z-levels is ok if needed
GLOBAL_LIST_INIT(station_z_levels, list(ZLEVEL_STATION_PRIMARY)) GLOBAL_LIST_INIT(station_z_levels, list(ZLEVEL_STATION_PRIMARY))
GLOBAL_LIST(global_map) GLOBAL_LIST(global_map)
+2 -1
View File
@@ -196,7 +196,8 @@
plane = HUD_PLANE plane = HUD_PLANE
/obj/screen/drop/Click() /obj/screen/drop/Click()
usr.drop_item_v() if(usr.stat == CONSCIOUS)
usr.dropItemToGround(usr.get_active_held_item())
/obj/screen/act_intent /obj/screen/act_intent
name = "intent" name = "intent"
+3 -2
View File
@@ -1,6 +1,6 @@
/datum/controller/subsystem/ticker/proc/generate_crew_objectives() /datum/controller/subsystem/ticker/proc/generate_crew_objectives()
for(var/datum/mind/crewMind in SSticker.minds) for(var/datum/mind/crewMind in SSticker.minds)
if(prob(2) && !issilicon(crewMind.current) && !jobban_isbanned(crewMind, "Syndicate") && GLOB.miscreants_allowed) if(prob(2) && !issilicon(crewMind.current) && !jobban_isbanned(crewMind, "Syndicate") && GLOB.miscreants_allowed && ROLE_MISCREANT in crewMind.current.client.prefs.be_special)
generate_miscreant_objectives(crewMind) generate_miscreant_objectives(crewMind)
else else
if(CONFIG_GET(flag/allow_crew_objectives)) if(CONFIG_GET(flag/allow_crew_objectives))
@@ -25,7 +25,8 @@
return return
newObjective.owner = crewMind newObjective.owner = crewMind
crewMind.objectives += newObjective crewMind.objectives += newObjective
to_chat(crewMind, "<B>Your objective:</B> [newObjective.explanation_text]") to_chat(crewMind, "<B>As a part of Nanotrasen's anti-tide efforts, you have been assigned an optional objective. It will be checked at the end of the shift. <font color=red>Performing traitorous acts in pursuit of your objective may result in termination of your employment.</font></B>")
to_chat(crewMind, "<B>Your optional objective:</B> [newObjective.explanation_text]")
/datum/controller/subsystem/ticker/proc/get_valid_crew_objs(var/job = "")//taken from old hippie with adjustments /datum/controller/subsystem/ticker/proc/get_valid_crew_objs(var/job = "")//taken from old hippie with adjustments
var/list/objpaths = typesof(/datum/objective/crew) var/list/objpaths = typesof(/datum/objective/crew)
+6 -1
View File
@@ -7,6 +7,8 @@
return return
if(!crewMind.assigned_role) if(!crewMind.assigned_role)
return return
if(ROLE_MISCREANT in crewMind.current.client.prefs.be_special)
return
if(jobban_isbanned(crewMind, "Syndicate")) if(jobban_isbanned(crewMind, "Syndicate"))
return return
var/list/objectiveTypes = typesof(/datum/objective/miscreant) - /datum/objective/miscreant var/list/objectiveTypes = typesof(/datum/objective/miscreant) - /datum/objective/miscreant
@@ -58,4 +60,7 @@
explanation_text = "Act as out of character as you possibly can." explanation_text = "Act as out of character as you possibly can."
/datum/objective/miscreant/racism /datum/objective/miscreant/racism
explanation_text = "Attempt to establish superiority of your race." explanation_text = "Attempt to establish superiority of your species."
/datum/objective/miscreant/cargonia
explanation_text = "Attempt to establish independence of your department."
@@ -185,29 +185,6 @@
else else
return FALSE return FALSE
/datum/objective/crew/departmentclothes
var/obj/item/clothing/under/rank/targetuniform
explanation_text = "Be wearing a (Yo, this objective broke. report this to citadels discord via the development channel) at the end of the shift."
jobs = "assistant"
/datum/objective/crew/departmentclothes/New()
. = ..()
var/list/blacklist = list(/obj/item/clothing/under/rank, /obj/item/clothing/under/rank/miner, /obj/item/clothing/under/rank/medical/blue, /obj/item/clothing/under/rank/medical/green, /obj/item/clothing/under/rank/medical/purple, /obj/item/clothing/under/rank/security/grey, /obj/item/clothing/under/rank/warden/grey, /obj/item/clothing/under/rank/head_of_security/grey, /obj/item/clothing/under/rank/mailman, /obj/item/clothing/under/rank/psyche, /obj/item/clothing/under/rank/clown/sexy, /obj/item/clothing/under/rank/centcom_officer, /obj/item/clothing/under/rank/centcom_commander, /obj/item/clothing/under/rank/security/navyblue/russian, /obj/item/clothing/under/rank/security/blueshirt)
var/list/validclothes = typesof(/obj/item/clothing/under/rank) - blacklist
targetuniform = pick(validclothes)
update_explanation_text()
/datum/objective/crew/departmentclothes/update_explanation_text()
. = ..()
explanation_text = "Be wearing a [initial(targetuniform.name)] at the end of the shift."
/datum/objective/crew/departmentclothes/check_completion()
if(owner && owner.current)
var/mob/living/carbon/human/H = owner.current
if(istype(H.w_uniform, targetuniform))
return TRUE
return FALSE
/datum/objective/crew/pwrgame //ported from Goon with adjustments /datum/objective/crew/pwrgame //ported from Goon with adjustments
var/obj/item/clothing/targettidegarb var/obj/item/clothing/targettidegarb
explanation_text = "Get your grubby hands on a (Dear god something broke. Report this to Citadel's development dicussion channel)." explanation_text = "Get your grubby hands on a (Dear god something broke. Report this to Citadel's development dicussion channel)."
@@ -215,7 +192,9 @@
/datum/objective/crew/pwrgame/New() /datum/objective/crew/pwrgame/New()
. = ..() . = ..()
var/list/muhvalids = list(/obj/item/clothing/mask/gas, /obj/item/clothing/head/welding, /obj/item/clothing/head/ushanka, /obj/item/clothing/gloves/color/yellow, /obj/item/clothing/mask/gas/owl_mask, /obj/item/clothing/suit/space) var/list/muhvalids = list(/obj/item/clothing/mask/gas, /obj/item/clothing/head/welding, /obj/item/clothing/head/ushanka, /obj/item/clothing/gloves/color/yellow, /obj/item/clothing/mask/gas/owl_mask)
if(prob(10))
muhvalids += list(/obj/item/clothing/suit/space)
targettidegarb = pick(muhvalids) targettidegarb = pick(muhvalids)
update_explanation_text() update_explanation_text()
@@ -74,7 +74,7 @@
return FALSE return FALSE
/datum/objective/crew/noinfections /datum/objective/crew/noinfections
explanation_text = "Ensure no living crew members are infected with harmful viruses at the end of the shift" explanation_text = "Make sure there are no crew members with harmful diseases at the end of the shift."
jobs = "virologist" jobs = "virologist"
/datum/objective/crew/noinfections/check_completion() /datum/objective/crew/noinfections/check_completion()
@@ -56,7 +56,6 @@ CONFIG_DEF(flag/log_twitter) // log certain expliotable parrots and other such f
CONFIG_DEF(flag/log_world_topic) // log all world.Topic() calls CONFIG_DEF(flag/log_world_topic) // log all world.Topic() calls
CONFIG_DEF(flag/allow_admin_ooccolor) // Allows admins with relevant permissions to have their own ooc colour CONFIG_DEF(flag/allow_admin_ooccolor) // Allows admins with relevant permissions to have their own ooc colour
protection = CONFIG_ENTRY_LOCKED
CONFIG_DEF(flag/allow_vote_restart) // allow votes to restart CONFIG_DEF(flag/allow_vote_restart) // allow votes to restart
@@ -351,4 +350,26 @@ CONFIG_DEF(number/error_msg_delay) // How long to wait between messaging admins
CONFIG_DEF(flag/irc_announce_new_game) CONFIG_DEF(flag/irc_announce_new_game)
CONFIG_DEF(flag/debug_admin_hrefs) CONFIG_DEF(flag/debug_admin_hrefs)
CONFIG_DEF(number/mc_tick_rate/base_mc_tick_rate)
integer = FALSE
value = 1
CONFIG_DEF(number/mc_tick_rate/high_pop_mc_tick_rate)
integer = FALSE
value = 1.1
CONFIG_DEF(number/mc_tick_rate/high_pop_mc_mode_amount)
value = 65
CONFIG_DEF(number/mc_tick_rate/disable_high_pop_mc_mode_amount)
value = 60
CONFIG_TWEAK(number/mc_tick_rate)
abstract_type = /datum/config_entry/number/mc_tick_rate
CONFIG_TWEAK(number/mc_tick_rate/ValidateAndSet(str_val))
. = ..()
if (.)
Master.UpdateTickRate()
+10
View File
@@ -573,3 +573,13 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
for(var/S in subsystems) for(var/S in subsystems)
var/datum/controller/subsystem/SS = S var/datum/controller/subsystem/SS = S
SS.StopLoadingMap() SS.StopLoadingMap()
/datum/controller/master/proc/UpdateTickRate()
if (!processing)
return
var/client_count = length(GLOB.clients)
if (client_count < CONFIG_GET(number/mc_tick_rate/disable_high_pop_mc_mode_amount))
processing = CONFIG_GET(number/mc_tick_rate/base_mc_tick_rate)
else if (client_count > CONFIG_GET(number/mc_tick_rate/high_pop_mc_mode_amount))
processing = CONFIG_GET(number/mc_tick_rate/high_pop_mc_tick_rate)
+54 -7
View File
@@ -68,10 +68,57 @@ SUBSYSTEM_DEF(ticker)
/datum/controller/subsystem/ticker/Initialize(timeofday) /datum/controller/subsystem/ticker/Initialize(timeofday)
load_mode() load_mode()
var/list/music = world.file2list(ROUND_START_MUSIC_LIST, "\n")
var/list/byond_sound_formats = list(
"mid" = TRUE,
"midi" = TRUE,
"mod" = TRUE,
"it" = TRUE,
"s3m" = TRUE,
"xm" = TRUE,
"oxm" = TRUE,
"wav" = TRUE,
"ogg" = TRUE,
"raw" = TRUE,
"wma" = TRUE,
"aiff" = TRUE
)
var/list/provisional_title_music = flist("config/title_music/sounds/")
var/list/music = list()
var/use_rare_music = prob(1)
for(var/S in provisional_title_music)
var/lower = lowertext(S)
var/list/L = splittext(lower,"+")
switch(L.len)
if(3) //rare+MAP+sound.ogg or MAP+rare.sound.ogg -- Rare Map-specific sounds
if(use_rare_music)
if(L[1] == "rare" && L[2] == SSmapping.config.map_name)
music += S
else if(L[2] == "rare" && L[1] == SSmapping.config.map_name)
music += S
if(2) //rare+sound.ogg or MAP+sound.ogg -- Rare sounds or Map-specific sounds
if((use_rare_music && L[1] == "rare") || (L[1] == SSmapping.config.map_name))
music += S
if(1) //sound.ogg -- common sound
music += S
var/old_login_music = trim(file2text("data/last_round_lobby_music.txt")) var/old_login_music = trim(file2text("data/last_round_lobby_music.txt"))
if(music.len > 1) if(music.len > 1)
music -= old_login_music music -= old_login_music
for(var/S in music)
var/list/L = splittext(S,".")
if(L.len >= 2)
var/ext = lowertext(L[L.len]) //pick the real extension, no 'honk.ogg.exe' nonsense here
if(byond_sound_formats[ext])
continue
music -= S
if(isemptylist(music))
music = world.file2list(ROUND_START_MUSIC_LIST, "\n")
login_music = pick(music) login_music = pick(music)
if(!GLOB.syndicate_code_phrase) if(!GLOB.syndicate_code_phrase)
@@ -258,7 +305,7 @@ SUBSYSTEM_DEF(ticker)
//Deleting Startpoints but we need the ai point to AI-ize people later //Deleting Startpoints but we need the ai point to AI-ize people later
if(S.name != "AI") if(S.name != "AI")
qdel(S) qdel(S)
//assign crew objectives and generate miscreants //assign crew objectives and generate miscreants
if(CONFIG_GET(flag/allow_extended_miscreants) && GLOB.master_mode == "extended") if(CONFIG_GET(flag/allow_extended_miscreants) && GLOB.master_mode == "extended")
GLOB.miscreants_allowed = TRUE GLOB.miscreants_allowed = TRUE
@@ -282,7 +329,7 @@ SUBSYSTEM_DEF(ticker)
qdel(bomb) qdel(bomb)
if(epi) if(epi)
explosion(epi, 0, 256, 512, 0, TRUE, TRUE, 0, TRUE) explosion(epi, 0, 256, 512, 0, TRUE, TRUE, 0, TRUE)
/datum/controller/subsystem/ticker/proc/create_characters() /datum/controller/subsystem/ticker/proc/create_characters()
for(var/mob/dead/new_player/player in GLOB.player_list) for(var/mob/dead/new_player/player in GLOB.player_list)
if(player.ready == PLAYER_READY_TO_PLAY && player.mind) if(player.ready == PLAYER_READY_TO_PLAY && player.mind)
@@ -472,13 +519,13 @@ SUBSYSTEM_DEF(ticker)
if(!crewMind.current || !crewMind.objectives.len) if(!crewMind.current || !crewMind.objectives.len)
continue continue
for(var/datum/objective/miscreant/MO in crewMind.objectives) for(var/datum/objective/miscreant/MO in crewMind.objectives)
miscreants += "<B>[crewMind.current.real_name]</B> (Played by: <B>[crewMind.key]</B>). <B>Objective</B>: [MO.explanation_text]" miscreants += "<B>[crewMind.current.real_name]</B> (Played by: <B>[crewMind.key]</B>)<BR><B>Objective</B>: [MO.explanation_text] <font color='grey'>(Optional)</font><BR>"
for(var/datum/objective/crew/CO in crewMind.objectives) for(var/datum/objective/crew/CO in crewMind.objectives)
if(CO.check_completion()) if(CO.check_completion())
to_chat(crewMind.current, "<br><B>Your objective</B>: [CO.explanation_text] <font color='green'><B>Success!</B></font>") to_chat(crewMind.current, "<br><B>Your optional objective</B>: [CO.explanation_text] <font color='green'><B>Success!</B></font>")
successfulCrew += "<B>[crewMind.current.real_name]</B> (Played by: <B>[crewMind.key]</B>). <B>Objective</B>: [CO.explanation_text]" successfulCrew += "<B>[crewMind.current.real_name]</B> (Played by: <B>[crewMind.key]</B>)<BR><B>Objective</B>: [CO.explanation_text] <font color='green'><B>Success!</B></font> <font color='grey'>(Optional)</font><BR>"
else else
to_chat(crewMind.current, "<br><B>Your objective</B>: [CO.explanation_text] <font color='red'><B>Failed.</B></font>") to_chat(crewMind.current, "<br><B>Your optional objective</B>: [CO.explanation_text] <font color='red'><B>Failed.</B></font>")
if (successfulCrew.len) if (successfulCrew.len)
var/completedObjectives = "<B>The following crew members completed their Crew Objectives:</B><BR>" var/completedObjectives = "<B>The following crew members completed their Crew Objectives:</B><BR>"
+3 -2
View File
@@ -290,9 +290,10 @@
if(!id) if(!id)
var/list/L = list() var/list/L = list()
for(var/datum/symptom/S in symptoms) for(var/datum/symptom/S in symptoms)
L += S.id
if(S.neutered) if(S.neutered)
L += "N" L += "[S.id]N"
else
L += S.id
L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in. L = sortList(L) // Sort the list so it doesn't matter which order the symptoms are in.
var/result = jointext(L, ":") var/result = jointext(L, ":")
id = result id = result
+68 -68
View File
@@ -1,74 +1,74 @@
/* /*
////////////////////////////////////// //////////////////////////////////////
Coughing Coughing
Noticable. Noticable.
Little Resistance. Little Resistance.
Doesn't increase stage speed much. Doesn't increase stage speed much.
Transmittable. Transmittable.
Low Level. Low Level.
BONUS BONUS
Will force the affected mob to drop small items! Will force the affected mob to drop small items!
////////////////////////////////////// //////////////////////////////////////
*/ */
/datum/symptom/cough /datum/symptom/cough
name = "Cough" name = "Cough"
desc = "The virus irritates the throat of the host, causing occasional coughing." desc = "The virus irritates the throat of the host, causing occasional coughing."
stealth = -1 stealth = -1
resistance = 3 resistance = 3
stage_speed = 1 stage_speed = 1
transmittable = 2 transmittable = 2
level = 1 level = 1
severity = 1 severity = 1
base_message_chance = 15 base_message_chance = 15
symptom_delay_min = 2 symptom_delay_min = 2
symptom_delay_max = 15 symptom_delay_max = 15
var/infective = FALSE var/infective = FALSE
threshold_desc = "<b>Resistance 3:</b> Host will drop small items when coughing.<br>\ threshold_desc = "<b>Resistance 3:</b> Host will drop small items when coughing.<br>\
<b>Resistance 10:</b> Occasionally causes coughing fits that stun the host.<br>\ <b>Resistance 10:</b> Occasionally causes coughing fits that stun the host.<br>\
<b>Stage Speed 6:</b> Increases cough frequency.<br>\ <b>Stage Speed 6:</b> Increases cough frequency.<br>\
<b>If Airborne:</b> Coughing will infect bystanders.<br>\ <b>If Airborne:</b> Coughing will infect bystanders.<br>\
<b>Stealth 4:</b> The symptom remains hidden until active." <b>Stealth 4:</b> The symptom remains hidden until active."
/datum/symptom/cough/Start(datum/disease/advance/A) /datum/symptom/cough/Start(datum/disease/advance/A)
..() ..()
if(A.properties["stealth"] >= 4) if(A.properties["stealth"] >= 4)
suppress_warning = TRUE suppress_warning = TRUE
if(A.spread_flags &= AIRBORNE) //infect bystanders if(A.spread_flags &= AIRBORNE) //infect bystanders
infective = TRUE infective = TRUE
if(A.properties["resistance"] >= 3) //strong enough to drop items if(A.properties["resistance"] >= 3) //strong enough to drop items
power = 1.5 power = 1.5
if(A.properties["resistance"] >= 10) //strong enough to stun (rarely) if(A.properties["resistance"] >= 10) //strong enough to stun (rarely)
power = 2 power = 2
if(A.properties["stage_rate"] >= 6) //cough more often if(A.properties["stage_rate"] >= 6) //cough more often
symptom_delay_max = 10 symptom_delay_max = 10
/datum/symptom/cough/Activate(datum/disease/advance/A) /datum/symptom/cough/Activate(datum/disease/advance/A)
if(!..()) if(!..())
return return
var/mob/living/M = A.affected_mob var/mob/living/M = A.affected_mob
switch(A.stage) switch(A.stage)
if(1, 2, 3) if(1, 2, 3)
if(prob(base_message_chance) && !suppress_warning) if(prob(base_message_chance) && !suppress_warning)
to_chat(M, "<span notice='warning'>[pick("You swallow excess mucus.", "You lightly cough.")]</span>") to_chat(M, "<span notice='warning'>[pick("You swallow excess mucus.", "You lightly cough.")]</span>")
else else
M.emote("cough") M.emote("cough")
if(power >= 1.5) if(power >= 1.5)
var/obj/item/I = M.get_active_held_item() var/obj/item/I = M.get_active_held_item()
if(I && I.w_class == WEIGHT_CLASS_TINY) if(I && I.w_class == WEIGHT_CLASS_TINY)
M.drop_item() M.dropItemToGround(I)
if(power >= 2 && prob(10)) if(power >= 2 && prob(10))
to_chat(M, "<span notice='userdanger'>[pick("You have a coughing fit!", "You can't stop coughing!")]</span>") to_chat(M, "<span notice='userdanger'>[pick("You have a coughing fit!", "You can't stop coughing!")]</span>")
M.Stun(20) M.Stun(20)
M.emote("cough") M.emote("cough")
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 6) addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 6)
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 12) addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 12)
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 18) addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 18)
if(infective) if(infective)
A.spread(1) A.spread(1)
+3 -4
View File
@@ -85,7 +85,7 @@
"<span class='userdanger'>[A] strikes your abdomen, neck and back consecutively!</span>") "<span class='userdanger'>[A] strikes your abdomen, neck and back consecutively!</span>")
playsound(get_turf(D), 'sound/weapons/cqchit2.ogg', 50, 1, -1) playsound(get_turf(D), 'sound/weapons/cqchit2.ogg', 50, 1, -1)
var/obj/item/I = D.get_active_held_item() var/obj/item/I = D.get_active_held_item()
if(I && D.drop_item()) if(I && D.temporarilyRemoveItemFromInventory(I))
A.put_in_hands(I) A.put_in_hands(I)
D.adjustStaminaLoss(50) D.adjustStaminaLoss(50)
D.apply_damage(25, BRUTE) D.apply_damage(25, BRUTE)
@@ -145,7 +145,7 @@
D.visible_message("<span class='warning'>[A] strikes [D]'s jaw with their hand!</span>", \ D.visible_message("<span class='warning'>[A] strikes [D]'s jaw with their hand!</span>", \
"<span class='userdanger'>[A] strikes your jaw, disorienting you!</span>") "<span class='userdanger'>[A] strikes your jaw, disorienting you!</span>")
playsound(get_turf(D), 'sound/weapons/cqchit1.ogg', 50, 1, -1) playsound(get_turf(D), 'sound/weapons/cqchit1.ogg', 50, 1, -1)
if(I && D.drop_item()) if(I && D.temporarilyRemoveItemFromInventory(I))
A.put_in_hands(I) A.put_in_hands(I)
D.Jitter(2) D.Jitter(2)
D.apply_damage(5, BRUTE) D.apply_damage(5, BRUTE)
@@ -193,7 +193,6 @@
to_chat(user, "<span class='boldannounce'>You remember the basics of CQC.</span>") to_chat(user, "<span class='boldannounce'>You remember the basics of CQC.</span>")
var/datum/martial_art/cqc/D = new(null) var/datum/martial_art/cqc/D = new(null)
D.teach(user) D.teach(user)
user.drop_item()
visible_message("<span class='warning'>[src] beeps ominously, and a moment later it bursts up in flames.</span>") visible_message("<span class='warning'>[src] beeps ominously, and a moment later it bursts up in flames.</span>")
new /obj/effect/decal/cleanable/ash(get_turf(src))
qdel(src) qdel(src)
new /obj/effect/decal/cleanable/ash(user.drop_location())
+1 -1
View File
@@ -150,7 +150,7 @@
if(prob(60)) if(prob(60))
I = D.get_active_held_item() I = D.get_active_held_item()
if(I) if(I)
if(D.drop_item()) if(D.temporarilyRemoveItemFromInventory(I))
A.put_in_hands(I) A.put_in_hands(I)
D.visible_message("<span class='danger'>[A] has disarmed [D]!</span>", \ D.visible_message("<span class='danger'>[A] has disarmed [D]!</span>", \
"<span class='userdanger'>[A] has disarmed [D]!</span>") "<span class='userdanger'>[A] has disarmed [D]!</span>")
+4 -5
View File
@@ -41,7 +41,7 @@
"<span class='userdanger'>[A] grabs your wrist and violently wrenches it to the side!</span>") "<span class='userdanger'>[A] grabs your wrist and violently wrenches it to the side!</span>")
playsound(get_turf(A), 'sound/weapons/thudswoosh.ogg', 50, 1, -1) playsound(get_turf(A), 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
D.emote("scream") D.emote("scream")
D.drop_item() D.dropItemToGround(D.get_active_held_item())
D.apply_damage(5, BRUTE, pick("l_arm", "r_arm")) D.apply_damage(5, BRUTE, pick("l_arm", "r_arm"))
D.Stun(60) D.Stun(60)
return 1 return 1
@@ -79,7 +79,7 @@
D.visible_message("<span class='warning'>[A] kicks [D] in the head!</span>", \ D.visible_message("<span class='warning'>[A] kicks [D] in the head!</span>", \
"<span class='userdanger'>[A] kicks you in the jaw!</span>") "<span class='userdanger'>[A] kicks you in the jaw!</span>")
D.apply_damage(20, BRUTE, "head") D.apply_damage(20, BRUTE, "head")
D.drop_item() D.drop_all_held_items()
playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1) playsound(get_turf(D), 'sound/weapons/punch1.ogg', 50, 1, -1)
D.Stun(80) D.Stun(80)
return 1 return 1
@@ -168,10 +168,9 @@
to_chat(user, message) to_chat(user, message)
var/datum/martial_art/the_sleeping_carp/theSleepingCarp = new(null) var/datum/martial_art/the_sleeping_carp/theSleepingCarp = new(null)
theSleepingCarp.teach(user) theSleepingCarp.teach(user)
user.drop_item()
visible_message("<span class='warning'>[src] lights up in fire and quickly burns to ash.</span>")
new /obj/effect/decal/cleanable/ash(get_turf(src))
qdel(src) qdel(src)
visible_message("<span class='warning'>[src] lights up in fire and quickly burns to ash.</span>")
new /obj/effect/decal/cleanable/ash(user.drop_location())
/obj/item/twohanded/bostaff /obj/item/twohanded/bostaff
name = "bo staff" name = "bo staff"
+1 -1
View File
@@ -270,7 +270,7 @@ GLOBAL_LIST_EMPTY(mutations_list)
/datum/mutation/human/cough/on_life(mob/living/carbon/human/owner) /datum/mutation/human/cough/on_life(mob/living/carbon/human/owner)
if(prob(5) && owner.stat == CONSCIOUS) if(prob(5) && owner.stat == CONSCIOUS)
owner.drop_item() owner.drop_all_held_items()
owner.emote("cough") owner.emote("cough")
/datum/mutation/human/dwarfism /datum/mutation/human/dwarfism
+3 -2
View File
@@ -250,9 +250,10 @@
if(istype(I, /obj/item/device/assembly)) if(istype(I, /obj/item/device/assembly))
var/obj/item/device/assembly/A = I var/obj/item/device/assembly/A = I
if(A.attachable) if(A.attachable)
if(!L.drop_item()) if(!L.temporarilyRemoveItemFromInventory(A))
return return
attach_assembly(target_wire, A) if(!attach_assembly(target_wire, A))
A.forceMove(L.drop_location())
. = TRUE . = TRUE
else else
to_chat(L, "<span class='warning'>You need an attachable assembly!</span>") to_chat(L, "<span class='warning'>You need an attachable assembly!</span>")
-2
View File
@@ -36,8 +36,6 @@
if(GLOB.use_preloader && (src.type == GLOB._preloader.target_path))//in case the instanciated atom is creating other atoms in New() if(GLOB.use_preloader && (src.type == GLOB._preloader.target_path))//in case the instanciated atom is creating other atoms in New()
GLOB._preloader.load(src) GLOB._preloader.load(src)
//. = ..() //uncomment if you are dumb enough to add a /datum/New() proc
var/do_initialize = SSatoms.initialized var/do_initialize = SSatoms.initialized
if(do_initialize > INITIALIZATION_INSSATOMS) if(do_initialize > INITIALIZATION_INSSATOMS)
args[1] = do_initialize == INITIALIZATION_INNEW_MAPLOAD args[1] = do_initialize == INITIALIZATION_INNEW_MAPLOAD
+1 -1
View File
@@ -90,7 +90,7 @@
if("healing") if("healing")
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/charge(null)) M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/charge(null))
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/forcewall(null)) M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/forcewall(null))
M.put_in_hands_or_del(new /obj/item/gun/magic/staff/healing(M)) M.put_in_hands(new /obj/item/gun/magic/staff/healing(M), TRUE)
to_chat(M, "<B>Your service has not gone unrewarded, however. Studying under [wizard_name], you have learned livesaving survival spells. You are able to cast charge and forcewall.") to_chat(M, "<B>Your service has not gone unrewarded, however. Studying under [wizard_name], you have learned livesaving survival spells. You are able to cast charge and forcewall.")
if("robeless") if("robeless")
M.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/knock(null)) M.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/knock(null))
@@ -37,8 +37,9 @@
return 1 return 1
/obj/effect/proc_holder/changeling/weapon/sting_action(mob/living/user) /obj/effect/proc_holder/changeling/weapon/sting_action(mob/living/user)
if(!user.drop_item()) var/obj/item/held = user.get_active_held_item()
to_chat(user, "<span class='warning'>The [user.get_active_held_item()] is stuck to your hand, you cannot grow a [weapon_name_simple] over it!</span>") if(held && !user.dropItemToGround(held))
to_chat(user, "<span class='warning'>[held] is stuck to your hand, you cannot grow a [weapon_name_simple] over it!</span>")
return return
var/limb_regen = 0 var/limb_regen = 0
if(user.active_hand_index % 2 == 0) //we regen the arm before changing it into the weapon if(user.active_hand_index % 2 == 0) //we regen the arm before changing it into the weapon
@@ -338,7 +339,7 @@
if(INTENT_DISARM) if(INTENT_DISARM)
var/obj/item/I = C.get_active_held_item() var/obj/item/I = C.get_active_held_item()
if(I) if(I)
if(C.drop_item()) if(C.dropItemToGround(I))
C.visible_message("<span class='danger'>[I] is yanked off [C]'s hand by [src]!</span>","<span class='userdanger'>A tentacle pulls [I] away from you!</span>") C.visible_message("<span class='danger'>[I] is yanked off [C]'s hand by [src]!</span>","<span class='userdanger'>A tentacle pulls [I] away from you!</span>")
on_hit(I) //grab the item as if you had hit it directly with the tentacle on_hit(I) //grab the item as if you had hit it directly with the tentacle
return 1 return 1
@@ -127,8 +127,9 @@
/obj/effect/proc_holder/changeling/sting/false_armblade/sting_action(mob/user, mob/target) /obj/effect/proc_holder/changeling/sting/false_armblade/sting_action(mob/user, mob/target)
add_logs(user, target, "stung", object="falso armblade sting") add_logs(user, target, "stung", object="falso armblade sting")
if(!target.drop_item()) var/obj/item/held = target.get_active_held_item()
to_chat(user, "<span class='warning'>The [target.get_active_held_item()] is stuck to their hand, you cannot grow a false armblade over it!</span>") if(held && !target.dropItemToGround(held))
to_chat(user, "<span class='warning'>[held] is stuck to their hand, you cannot grow a false armblade over it!</span>")
return return
if(ismonkey(target)) if(ismonkey(target))
@@ -88,7 +88,7 @@
if(istype(I, /obj/item/clockwork/slab)) if(istype(I, /obj/item/clockwork/slab))
to_chat(user, "<span class='heavy_brass'>\"I don't think you want to drop your slab into that.\"\n\"If you really want to, try throwing it.\"</span>") to_chat(user, "<span class='heavy_brass'>\"I don't think you want to drop your slab into that.\"\n\"If you really want to, try throwing it.\"</span>")
return TRUE return TRUE
if(user.drop_item() && uses) if(uses && user.dropItemToGround(I))
user.visible_message("<span class='warning'>[user] drops [I] into [src]!</span>", "<span class='danger'>You drop [I] into [src]!</span>") user.visible_message("<span class='warning'>[user] drops [I] into [src]!</span>", "<span class='danger'>You drop [I] into [src]!</span>")
pass_through_gateway(I, TRUE) pass_through_gateway(I, TRUE)
return TRUE return TRUE
@@ -20,7 +20,6 @@
"<span class='alloy'>You crush [src], capturing its escaping energy for use as power.</span>") "<span class='alloy'>You crush [src], capturing its escaping energy for use as power.</span>")
playsound(user, 'sound/effects/pop_expl.ogg', 50, TRUE) playsound(user, 'sound/effects/pop_expl.ogg', 50, TRUE)
adjust_clockwork_power(POWER_WALL_TOTAL) adjust_clockwork_power(POWER_WALL_TOTAL)
user.drop_item()
qdel(src) qdel(src)
/obj/item/clockwork/component/pickup(mob/living/user) /obj/item/clockwork/component/pickup(mob/living/user)
@@ -28,7 +28,6 @@
if(weapon.loc == owner) if(weapon.loc == owner)
owner.visible_message("<span class='danger'>[owner]'s [weapon.name] flickers and disappears!</span>") owner.visible_message("<span class='danger'>[owner]'s [weapon.name] flickers and disappears!</span>")
to_chat(owner, "<span class='brass'>You dismiss [weapon].</span>") to_chat(owner, "<span class='brass'>You dismiss [weapon].</span>")
owner.drop_item()
QDEL_NULL(weapon) QDEL_NULL(weapon)
weapon_reset(RATVARIAN_SPEAR_COOLDOWN * 0.5) weapon_reset(RATVARIAN_SPEAR_COOLDOWN * 0.5)
return return
@@ -136,7 +136,7 @@
to_chat(user, "<span class='heavy_brass'>\"You reek of blood. You've got a lot of nerve to even look at that slab.\"</span>") to_chat(user, "<span class='heavy_brass'>\"You reek of blood. You've got a lot of nerve to even look at that slab.\"</span>")
user.visible_message("<span class='warning'>A sizzling sound comes from [user]'s hands!</span>", "<span class='userdanger'>[src] suddenly grows extremely hot in your hands!</span>") user.visible_message("<span class='warning'>A sizzling sound comes from [user]'s hands!</span>", "<span class='userdanger'>[src] suddenly grows extremely hot in your hands!</span>")
playsound(get_turf(user), 'sound/weapons/sear.ogg', 50, 1) playsound(get_turf(user), 'sound/weapons/sear.ogg', 50, 1)
user.drop_item() user.dropItemToGround(src)
user.emote("scream") user.emote("scream")
user.apply_damage(5, BURN, "l_arm") user.apply_damage(5, BURN, "l_arm")
user.apply_damage(5, BURN, "r_arm") user.apply_damage(5, BURN, "r_arm")
@@ -12,6 +12,7 @@ Applications: 8 servants, 3 caches, and 100 CV
var/name = "scripture" var/name = "scripture"
var/desc = "Ancient Ratvarian lore. This piece seems particularly mundane." var/desc = "Ancient Ratvarian lore. This piece seems particularly mundane."
var/list/invocations = list() //Spoken over time in the ancient language of Ratvar. See clock_unsorted.dm for more details on the language and how to make it. var/list/invocations = list() //Spoken over time in the ancient language of Ratvar. See clock_unsorted.dm for more details on the language and how to make it.
var/chanting = FALSE //If the invocation's words are being spoken
var/channel_time = 10 //In deciseconds, how long a ritual takes to chant var/channel_time = 10 //In deciseconds, how long a ritual takes to chant
var/power_cost = 5 //In watts, how much a scripture takes to invoke var/power_cost = 5 //In watts, how much a scripture takes to invoke
var/special_power_text //If the scripture can use additional power to have a unique function, use this; put POWERCOST here to display the special power cost. var/special_power_text //If the scripture can use additional power to have a unique function, use this; put POWERCOST here to display the special power cost.
@@ -145,18 +146,29 @@ Applications: 8 servants, 3 caches, and 100 CV
to_chat(invoker, "<span class='brass'>You [channel_time <= 0 ? "recite" : "begin reciting"] a piece of scripture entitled \"[name]\".</span>") to_chat(invoker, "<span class='brass'>You [channel_time <= 0 ? "recite" : "begin reciting"] a piece of scripture entitled \"[name]\".</span>")
if(!channel_time) if(!channel_time)
return TRUE return TRUE
chant()
if(!do_after(invoker, channel_time, target = invoker, extra_checks = CALLBACK(src, .proc/check_special_requirements)))
slab.busy = null
chanting = FALSE
scripture_fail()
chanting = FALSE
return
chanting = FALSE
return TRUE
/datum/clockwork_scripture/proc/chant()
set waitfor = FALSE
chanting = TRUE
for(var/invocation in invocations) for(var/invocation in invocations)
if(!do_after(invoker, channel_time / invocations.len, target = invoker, extra_checks = CALLBACK(src, .proc/check_special_requirements))) sleep(channel_time / invocations.len)
slab.busy = null if(QDELETED(src) || QDELETED(slab) || !chanting)
scripture_fail() return
return FALSE
if(multiple_invokers_used) if(multiple_invokers_used)
for(var/mob/living/L in range(1, get_turf(invoker))) for(var/mob/living/L in range(1, get_turf(invoker)))
if(can_recite_scripture(L)) if(can_recite_scripture(L))
clockwork_say(L, text2ratvar(invocation), whispered) clockwork_say(L, text2ratvar(invocation), whispered)
else else
clockwork_say(invoker, text2ratvar(invocation), whispered) clockwork_say(invoker, text2ratvar(invocation), whispered)
return TRUE
/datum/clockwork_scripture/proc/scripture_effects() //The actual effects of the recital after its conclusion /datum/clockwork_scripture/proc/scripture_effects() //The actual effects of the recital after its conclusion
+2 -5
View File
@@ -21,7 +21,6 @@
if(invoke(user)) if(invoke(user))
uses-- uses--
if(uses <= 0) if(uses <= 0)
user.drop_item()
qdel(src) qdel(src)
/obj/item/paper/talisman/proc/invoke(mob/living/user, successfuluse = 1) /obj/item/paper/talisman/proc/invoke(mob/living/user, successfuluse = 1)
@@ -182,7 +181,6 @@
C.Jitter(15) C.Jitter(15)
if(is_servant_of_ratvar(target)) if(is_servant_of_ratvar(target))
target.adjustBruteLoss(15) target.adjustBruteLoss(15)
user.drop_item()
qdel(src) qdel(src)
return return
..() ..()
@@ -204,13 +202,13 @@
user.equip_to_slot_or_del(new /obj/item/clothing/suit/cultrobes/alt(user), slot_wear_suit) user.equip_to_slot_or_del(new /obj/item/clothing/suit/cultrobes/alt(user), slot_wear_suit)
user.equip_to_slot_or_del(new /obj/item/clothing/shoes/cult/alt(user), slot_shoes) user.equip_to_slot_or_del(new /obj/item/clothing/shoes/cult/alt(user), slot_shoes)
user.equip_to_slot_or_del(new /obj/item/storage/backpack/cultpack(user), slot_back) user.equip_to_slot_or_del(new /obj/item/storage/backpack/cultpack(user), slot_back)
user.drop_item() user.dropItemToGround(src)
user.put_in_hands(new /obj/item/melee/cultblade(user)) user.put_in_hands(new /obj/item/melee/cultblade(user))
user.put_in_hands(new /obj/item/restraints/legcuffs/bola/cult(user)) user.put_in_hands(new /obj/item/restraints/legcuffs/bola/cult(user))
/obj/item/paper/talisman/armor/attack(mob/living/target, mob/living/user) /obj/item/paper/talisman/armor/attack(mob/living/target, mob/living/user)
if(iscultist(user) && iscultist(target)) if(iscultist(user) && iscultist(target))
user.drop_item() user.temporarilyRemoveItemFromInventory(src)
invoke(target) invoke(target)
qdel(src) qdel(src)
return return
@@ -335,7 +333,6 @@
else else
to_chat(user, "<span class='warning'>[C] is already bound.</span>") to_chat(user, "<span class='warning'>[C] is already bound.</span>")
if(uses <= 0) if(uses <= 0)
user.drop_item()
qdel(src) qdel(src)
/obj/item/restraints/handcuffs/energy/cult //For the talisman of shackling /obj/item/restraints/handcuffs/energy/cult //For the talisman of shackling
@@ -184,7 +184,7 @@
"<span class='userdanger'>[M] has pushed down [src]!</span>") "<span class='userdanger'>[M] has pushed down [src]!</span>")
else else
if (prob(25)) if (prob(25))
drop_item() dropItemToGround(get_active_held_item())
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("<span class='danger'>[M] has disarmed [src]!</span>", \ visible_message("<span class='danger'>[M] has disarmed [src]!</span>", \
"<span class='userdanger'>[M] has disarmed [src]!</span>") "<span class='userdanger'>[M] has disarmed [src]!</span>")
@@ -49,7 +49,7 @@
/datum/surgery_step/gland_insert/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) /datum/surgery_step/gland_insert/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
user.visible_message("[user] inserts [tool] into [target].", "<span class ='notice'>You insert [tool] into [target].</span>") user.visible_message("[user] inserts [tool] into [target].", "<span class ='notice'>You insert [tool] into [target].</span>")
user.drop_item() user.temporarilyRemoveItemFromInventory(tool, TRUE)
var/obj/item/organ/heart/gland/gland = tool var/obj/item/organ/heart/gland/gland = tool
gland.Insert(target, 2) gland.Insert(target, 2)
return 1 return 1
@@ -353,7 +353,7 @@
return ..() return ..()
user.visible_message("<span class='notice'>[user] scatters [src] in all directions.</span>", \ user.visible_message("<span class='notice'>[user] scatters [src] in all directions.</span>", \
"<span class='notice'>You scatter [src] across the area. The particles slowly fade away.</span>") "<span class='notice'>You scatter [src] across the area. The particles slowly fade away.</span>")
user.drop_item() user.dropItemToGround(src)
scatter() scatter()
/obj/item/ectoplasm/revenant/throw_impact(atom/hit_atom) /obj/item/ectoplasm/revenant/throw_impact(atom/hit_atom)
@@ -97,7 +97,7 @@
return return
user.visible_message("<span class='warning'>[user]'s eyes flare a deep crimson!</span>", \ user.visible_message("<span class='warning'>[user]'s eyes flare a deep crimson!</span>", \
"<span class='userdanger'>You feel a strange power seep into your body... you have absorbed the demon's blood-travelling powers!</span>") "<span class='userdanger'>You feel a strange power seep into your body... you have absorbed the demon's blood-travelling powers!</span>")
user.drop_item() user.temporarilyRemoveItemFromInventory(src, TRUE)
src.Insert(user) //Consuming the heart literally replaces your heart with a demon heart. H A R D C O R E src.Insert(user) //Consuming the heart literally replaces your heart with a demon heart. H A R D C O R E
/obj/item/organ/heart/demon/Insert(mob/living/carbon/M, special = 0) /obj/item/organ/heart/demon/Insert(mob/living/carbon/M, special = 0)
+2 -3
View File
@@ -91,7 +91,7 @@
to_chat(synd_mind.current, "<B>In your hand you will find a special item capable of triggering a greater challenge for your team. Examine it carefully and consult with your fellow operatives before activating it.</B>") to_chat(synd_mind.current, "<B>In your hand you will find a special item capable of triggering a greater challenge for your team. Examine it carefully and consult with your fellow operatives before activating it.</B>")
var/obj/item/device/nuclear_challenge/challenge = new /obj/item/device/nuclear_challenge var/obj/item/device/nuclear_challenge/challenge = new /obj/item/device/nuclear_challenge
synd_mind.current.put_in_hands_or_del(challenge) synd_mind.current.put_in_hands(challenge, TRUE)
var/list/foundIDs = synd_mind.current.search_contents_for(/obj/item/card/id) var/list/foundIDs = synd_mind.current.search_contents_for(/obj/item/card/id)
if(foundIDs.len) if(foundIDs.len)
@@ -110,8 +110,7 @@
P.info = "The nuclear authorization code is: <b>[nuke_code]</b>" P.info = "The nuclear authorization code is: <b>[nuke_code]</b>"
P.name = "nuclear bomb code" P.name = "nuclear bomb code"
var/mob/living/carbon/human/H = synd_mind.current var/mob/living/carbon/human/H = synd_mind.current
P.forceMove(H.drop_location()) H.put_in_hands(P, TRUE)
H.put_in_hands_or_del(P)
H.update_icons() H.update_icons()
else else
nuke_code = "code will be provided later" nuke_code = "code will be provided later"
+3 -6
View File
@@ -105,9 +105,8 @@
/obj/machinery/nuclearbomb/attackby(obj/item/I, mob/user, params) /obj/machinery/nuclearbomb/attackby(obj/item/I, mob/user, params)
if (istype(I, /obj/item/disk/nuclear)) if (istype(I, /obj/item/disk/nuclear))
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
return return
I.forceMove(src)
auth = I auth = I
add_fingerprint(user) add_fingerprint(user)
return return
@@ -309,10 +308,8 @@
. = TRUE . = TRUE
if("insert_disk") if("insert_disk")
if(!auth) if(!auth)
var/obj/item/I = usr.get_active_held_item() var/obj/item/I = usr.is_holding_item_of_type(/obj/item/disk/nuclear)
if(istype(I, /obj/item/disk/nuclear)) if(I && usr.transferItemToLoc(I, src))
usr.drop_item()
I.forceMove(src)
auth = I auth = I
. = TRUE . = TRUE
if("keypad") if("keypad")
+2 -2
View File
@@ -193,8 +193,8 @@
H.equip_to_slot_or_del(new hat(H), slot_head) H.equip_to_slot_or_del(new hat(H), slot_head)
H.equip_to_slot_or_del(new /obj/item/clothing/under/roman(H), slot_w_uniform) H.equip_to_slot_or_del(new /obj/item/clothing/under/roman(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/roman(H), slot_shoes) H.equip_to_slot_or_del(new /obj/item/clothing/shoes/roman(H), slot_shoes)
H.put_in_hands_or_del(new /obj/item/shield/riot/roman(H)) H.put_in_hands(new /obj/item/shield/riot/roman(H), TRUE)
H.put_in_hands_or_del(new /obj/item/claymore(H)) H.put_in_hands(new /obj/item/claymore(H), TRUE)
H.equip_to_slot_or_del(new /obj/item/twohanded/spear(H), slot_back) H.equip_to_slot_or_del(new /obj/item/twohanded/spear(H), slot_back)
+1 -1
View File
@@ -159,7 +159,7 @@
wizard_mob.equip_to_slot_or_del(new /obj/item/teleportation_scroll(wizard_mob), slot_r_store) wizard_mob.equip_to_slot_or_del(new /obj/item/teleportation_scroll(wizard_mob), slot_r_store)
var/obj/item/spellbook/spellbook = new /obj/item/spellbook(wizard_mob) var/obj/item/spellbook/spellbook = new /obj/item/spellbook(wizard_mob)
spellbook.owner = wizard_mob spellbook.owner = wizard_mob
wizard_mob.put_in_hands_or_del(spellbook) wizard_mob.put_in_hands(spellbook, TRUE)
to_chat(wizard_mob, "You will find a list of available spells in your spell book. Choose your magic arsenal carefully.") to_chat(wizard_mob, "You will find a list of available spells in your spell book. Choose your magic arsenal carefully.")
to_chat(wizard_mob, "The spellbook is bound to you, and others cannot use it.") to_chat(wizard_mob, "The spellbook is bound to you, and others cannot use it.")
+132 -136
View File
@@ -1,32 +1,32 @@
/obj/machinery/pdapainter /obj/machinery/pdapainter
name = "\improper PDA painter" name = "\improper PDA painter"
desc = "A PDA painting machine. To use, simply insert your PDA and choose the desired preset paint scheme." desc = "A PDA painting machine. To use, simply insert your PDA and choose the desired preset paint scheme."
icon = 'icons/obj/pda.dmi' icon = 'icons/obj/pda.dmi'
icon_state = "pdapainter" icon_state = "pdapainter"
density = TRUE density = TRUE
anchored = TRUE anchored = TRUE
var/obj/item/device/pda/storedpda = null var/obj/item/device/pda/storedpda = null
var/list/colorlist = list() var/list/colorlist = list()
max_integrity = 200 max_integrity = 200
/obj/machinery/pdapainter/update_icon() /obj/machinery/pdapainter/update_icon()
cut_overlays() cut_overlays()
if(stat & BROKEN) if(stat & BROKEN)
icon_state = "[initial(icon_state)]-broken" icon_state = "[initial(icon_state)]-broken"
return return
if(storedpda) if(storedpda)
add_overlay("[initial(icon_state)]-closed") add_overlay("[initial(icon_state)]-closed")
if(powered()) if(powered())
icon_state = initial(icon_state) icon_state = initial(icon_state)
else else
icon_state = "[initial(icon_state)]-off" icon_state = "[initial(icon_state)]-off"
return return
/obj/machinery/pdapainter/Initialize() /obj/machinery/pdapainter/Initialize()
. = ..() . = ..()
var/list/blocked = list( var/list/blocked = list(
@@ -37,114 +37,110 @@
/obj/item/device/pda/syndicate) /obj/item/device/pda/syndicate)
for(var/P in typesof(/obj/item/device/pda) - blocked) for(var/P in typesof(/obj/item/device/pda) - blocked)
var/obj/item/device/pda/D = new P var/obj/item/device/pda/D = new P
//D.name = "PDA Style [colorlist.len+1]" //Gotta set the name, otherwise it all comes up as "PDA" //D.name = "PDA Style [colorlist.len+1]" //Gotta set the name, otherwise it all comes up as "PDA"
D.name = D.icon_state //PDAs don't have unique names, but using the sprite names works. D.name = D.icon_state //PDAs don't have unique names, but using the sprite names works.
src.colorlist += D src.colorlist += D
/obj/machinery/pdapainter/Destroy() /obj/machinery/pdapainter/Destroy()
QDEL_NULL(storedpda) QDEL_NULL(storedpda)
return ..() return ..()
/obj/machinery/pdapainter/on_deconstruction() /obj/machinery/pdapainter/on_deconstruction()
if(storedpda) if(storedpda)
storedpda.forceMove(loc) storedpda.forceMove(loc)
storedpda = null storedpda = null
/obj/machinery/pdapainter/contents_explosion(severity, target) /obj/machinery/pdapainter/contents_explosion(severity, target)
if(storedpda) if(storedpda)
storedpda.ex_act(severity, target) storedpda.ex_act(severity, target)
/obj/machinery/pdapainter/handle_atom_del(atom/A) /obj/machinery/pdapainter/handle_atom_del(atom/A)
if(A == storedpda) if(A == storedpda)
storedpda = null storedpda = null
update_icon() update_icon()
/obj/machinery/pdapainter/attackby(obj/item/O, mob/user, params) /obj/machinery/pdapainter/attackby(obj/item/O, mob/user, params)
if(default_unfasten_wrench(user, O)) if(default_unfasten_wrench(user, O))
power_change() power_change()
return return
else if(istype(O, /obj/item/device/pda)) else if(istype(O, /obj/item/device/pda))
if(storedpda) if(storedpda)
to_chat(user, "<span class='warning'>There is already a PDA inside!</span>") to_chat(user, "<span class='warning'>There is already a PDA inside!</span>")
return return
else else if(!user.transferItemToLoc(O, src))
var/obj/item/device/pda/P = user.get_active_held_item() return
if(istype(P)) storedpda = O
if(!user.drop_item()) O.add_fingerprint(user)
return update_icon()
storedpda = P
P.loc = src else if(istype(O, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
P.add_fingerprint(user) var/obj/item/weldingtool/WT = O
update_icon() if(stat & BROKEN)
if(WT.remove_fuel(0,user))
else if(istype(O, /obj/item/weldingtool) && user.a_intent != INTENT_HARM) user.visible_message("[user] is repairing [src].", \
var/obj/item/weldingtool/WT = O "<span class='notice'>You begin repairing [src]...</span>", \
if(stat & BROKEN) "<span class='italics'>You hear welding.</span>")
if(WT.remove_fuel(0,user)) playsound(loc, WT.usesound, 40, 1)
user.visible_message("[user] is repairing [src].", \ if(do_after(user,40*WT.toolspeed, 1, target = src))
"<span class='notice'>You begin repairing [src]...</span>", \ if(!WT.isOn() || !(stat & BROKEN))
"<span class='italics'>You hear welding.</span>") return
playsound(loc, WT.usesound, 40, 1) to_chat(user, "<span class='notice'>You repair [src].</span>")
if(do_after(user,40*WT.toolspeed, 1, target = src)) playsound(loc, 'sound/items/welder2.ogg', 50, 1)
if(!WT.isOn() || !(stat & BROKEN)) stat &= ~BROKEN
return obj_integrity = max_integrity
to_chat(user, "<span class='notice'>You repair [src].</span>") update_icon()
playsound(loc, 'sound/items/welder2.ogg', 50, 1) else
stat &= ~BROKEN to_chat(user, "<span class='notice'>[src] does not need repairs.</span>")
obj_integrity = max_integrity else
update_icon() return ..()
else
to_chat(user, "<span class='notice'>[src] does not need repairs.</span>") /obj/machinery/pdapainter/deconstruct(disassembled = TRUE)
else
return ..()
/obj/machinery/pdapainter/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1)) if(!(flags_1 & NODECONSTRUCT_1))
if(!(stat & BROKEN)) if(!(stat & BROKEN))
stat |= BROKEN stat |= BROKEN
update_icon() update_icon()
/obj/machinery/pdapainter/attack_hand(mob/user) /obj/machinery/pdapainter/attack_hand(mob/user)
if(!..()) if(!..())
add_fingerprint(user) add_fingerprint(user)
if(storedpda) if(storedpda)
var/obj/item/device/pda/P var/obj/item/device/pda/P
P = input(user, "Select your color!", "PDA Painting") as null|anything in colorlist P = input(user, "Select your color!", "PDA Painting") as null|anything in colorlist
if(!P) if(!P)
return return
if(!in_range(src, user)) if(!in_range(src, user))
return return
if(!storedpda)//is the pda still there? if(!storedpda)//is the pda still there?
return return
storedpda.icon_state = P.icon_state storedpda.icon_state = P.icon_state
storedpda.desc = P.desc storedpda.desc = P.desc
ejectpda() ejectpda()
else else
to_chat(user, "<span class='notice'>\The [src] is empty.</span>") to_chat(user, "<span class='notice'>\The [src] is empty.</span>")
/obj/machinery/pdapainter/verb/ejectpda() /obj/machinery/pdapainter/verb/ejectpda()
set name = "Eject PDA" set name = "Eject PDA"
set category = "Object" set category = "Object"
set src in oview(1) set src in oview(1)
if(usr.stat || usr.restrained() || !usr.canmove) if(usr.stat || usr.restrained() || !usr.canmove)
return return
if(storedpda) if(storedpda)
storedpda.loc = get_turf(src.loc) storedpda.loc = get_turf(src.loc)
storedpda = null storedpda = null
update_icon() update_icon()
else else
to_chat(usr, "<span class='notice'>The [src] is empty.</span>") to_chat(usr, "<span class='notice'>The [src] is empty.</span>")
/obj/machinery/pdapainter/power_change() /obj/machinery/pdapainter/power_change()
..() ..()
update_icon() update_icon()
+2 -2
View File
@@ -149,10 +149,10 @@
else if(istype(W, /obj/item/device/analyzer)) else if(istype(W, /obj/item/device/analyzer))
if(!isXRay()) if(!isXRay())
if(!user.drop_item(W)) if(!user.temporarilyRemoveItemFromInventory(W))
return return
upgradeXRay()
qdel(W) qdel(W)
upgradeXRay()
to_chat(user, "[msg]") to_chat(user, "[msg]")
else else
to_chat(user, "[msg2]") to_chat(user, "[msg2]")
@@ -109,11 +109,10 @@
// Upgrades! // Upgrades!
if(is_type_in_typecache(W, possible_upgrades) && !is_type_in_list(W, upgrades)) // Is a possible upgrade and isn't in the camera already. if(is_type_in_typecache(W, possible_upgrades) && !is_type_in_list(W, upgrades)) // Is a possible upgrade and isn't in the camera already.
if(!user.drop_item(W)) if(!user.transferItemToLoc(W, src))
return return
to_chat(user, "<span class='notice'>You attach \the [W] into the assembly inner circuits.</span>") to_chat(user, "<span class='notice'>You attach \the [W] into the assembly inner circuits.</span>")
upgrades += W upgrades += W
W.forceMove(src)
return return
// Taking out upgrades // Taking out upgrades
@@ -92,18 +92,13 @@
beacon = findbeacon() beacon = findbeacon()
if("handle_id") if("handle_id")
if(id) if(id)
if(!usr.get_active_held_item()) usr.put_in_hands(id)
usr.put_in_hands(id) id = null
id = null
else
id.forceMove(get_turf(src))
id = null
else else
var/obj/item/I = usr.get_active_held_item() var/obj/item/I = usr.is_holding_item_of_type(/obj/item/card/id/prisoner)
if(istype(I, /obj/item/card/id/prisoner)) if(I)
if(!usr.drop_item()) if(!usr.transferItemToLoc(I, src))
return return
I.forceMove(src)
id = I id = I
if("set_goal") if("set_goal")
var/new_goal = input("Set the amount of points:", "Points", id.goal) as num|null var/new_goal = input("Set the amount of points:", "Points", id.goal) as num|null
+6 -11
View File
@@ -27,9 +27,8 @@
/obj/machinery/computer/med_data/attackby(obj/item/O, mob/user, params) /obj/machinery/computer/med_data/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/card/id) && !scan) if(istype(O, /obj/item/card/id) && !scan)
if(!user.drop_item()) if(!user.transferItemToLoc(O, src))
return return
O.loc = src
scan = O scan = O
to_chat(user, "<span class='notice'>You insert [O].</span>") to_chat(user, "<span class='notice'>You insert [O].</span>")
else else
@@ -215,17 +214,13 @@
src.temp = null src.temp = null
if(href_list["scan"]) if(href_list["scan"])
if(src.scan) if(src.scan)
if(ishuman(usr) && !usr.get_active_held_item()) usr.put_in_hands(scan)
usr.put_in_hands(scan) scan = null
else
scan.loc = get_turf(src)
src.scan = null
else else
var/obj/item/I = usr.get_active_held_item() var/obj/item/I = usr.is_holding_item_of_type(/obj/item/card/id)
if(istype(I, /obj/item/card/id)) if(I)
if(!usr.drop_item()) if(!usr.transferItemToLoc(I, src))
return return
I.loc = src
src.scan = I src.scan = I
else if(href_list["logout"]) else if(href_list["logout"])
src.authenticated = null src.authenticated = null
+3 -4
View File
@@ -90,11 +90,10 @@
if(href_list["id"]) if(href_list["id"])
if(href_list["id"] =="insert" && !inserted_id) if(href_list["id"] =="insert" && !inserted_id)
var/obj/item/card/id/prisoner/I = usr.get_active_held_item() var/obj/item/card/id/prisoner/I = usr.is_holding_item_of_type(/obj/item/card/id/prisoner)
if(istype(I)) if(I)
if(!usr.drop_item()) if(!usr.transferItemToLoc(I, src))
return return
I.loc = src
inserted_id = I inserted_id = I
else to_chat(usr, "<span class='danger'>No valid ID.</span>") else to_chat(usr, "<span class='danger'>No valid ID.</span>")
else if(inserted_id) else if(inserted_id)
+5 -10
View File
@@ -37,9 +37,8 @@
/obj/machinery/computer/secure_data/attackby(obj/item/O, mob/user, params) /obj/machinery/computer/secure_data/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/card/id)) if(istype(O, /obj/item/card/id))
if(!scan) if(!scan)
if(!user.drop_item()) if(!user.transferItemToLoc(O, src))
return return
O.loc = src
scan = O scan = O
to_chat(user, "<span class='notice'>You insert [O].</span>") to_chat(user, "<span class='notice'>You insert [O].</span>")
else else
@@ -303,17 +302,13 @@ What a mess.*/
if("Confirm Identity") if("Confirm Identity")
if(scan) if(scan)
if(ishuman(usr) && !usr.get_active_held_item()) usr.put_in_hands(scan)
usr.put_in_hands(scan)
else
scan.loc = get_turf(src)
scan = null scan = null
else else
var/obj/item/I = usr.get_active_held_item() var/obj/item/I = usr.is_holding_item_of_type(/obj/item/card/id)
if(istype(I, /obj/item/card/id)) if(I)
if(!usr.drop_item()) if(!usr.transferItemToLoc(I, src))
return return
I.loc = src
scan = I scan = I
if("Log Out") if("Log Out")
@@ -29,21 +29,19 @@ GLOBAL_LIST_INIT(possible_uplinker_IDs, list("Alfa","Bravo","Charlie","Delta","E
ID = rand(1,999) ID = rand(1,999)
name = "[name] [ID]" name = "[name] [ID]"
/obj/machinery/computer/telecrystals/uplinker/attackby(obj/item/O, mob/user, params) /obj/machinery/computer/telecrystals/uplinker/attackby(obj/item/I, mob/user, params)
if(uplinkholder) if(uplinkholder)
to_chat(user, "<span class='notice'>The [src] already has an uplink in it.</span>") to_chat(user, "<span class='notice'>The [src] already has an uplink in it.</span>")
return return
if(O.hidden_uplink) if(I.hidden_uplink)
var/obj/item/I = user.get_active_held_item() if(!user.transferItemToLoc(I, src))
if(!user.drop_item())
return return
uplinkholder = I uplinkholder = I
I.loc = src
I.add_fingerprint(user) I.add_fingerprint(user)
update_icon() update_icon()
updateUsrDialog() updateUsrDialog()
else else
to_chat(user, "<span class='notice'>The [O] doesn't appear to be an uplink...</span>") to_chat(user, "<span class='notice'>[I] doesn't appear to be an uplink...</span>")
/obj/machinery/computer/telecrystals/uplinker/update_icon() /obj/machinery/computer/telecrystals/uplinker/update_icon()
..() ..()
+257 -259
View File
@@ -1,262 +1,260 @@
/obj/structure/frame /obj/structure/frame
name = "frame" name = "frame"
icon = 'icons/obj/stock_parts.dmi' icon = 'icons/obj/stock_parts.dmi'
icon_state = "box_0" icon_state = "box_0"
density = TRUE density = TRUE
max_integrity = 250 max_integrity = 250
var/obj/item/circuitboard/circuit = null var/obj/item/circuitboard/circuit = null
var/state = 1 var/state = 1
/obj/structure/frame/examine(user) /obj/structure/frame/examine(user)
..() ..()
if(circuit) if(circuit)
to_chat(user, "It has \a [circuit] installed.") to_chat(user, "It has \a [circuit] installed.")
/obj/structure/frame/deconstruct(disassembled = TRUE) /obj/structure/frame/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1)) if(!(flags_1 & NODECONSTRUCT_1))
new /obj/item/stack/sheet/metal(loc, 5) new /obj/item/stack/sheet/metal(loc, 5)
if(circuit) if(circuit)
circuit.forceMove(loc) circuit.forceMove(loc)
circuit = null circuit = null
qdel(src) qdel(src)
/obj/structure/frame/machine /obj/structure/frame/machine
name = "machine frame" name = "machine frame"
var/list/components = null var/list/components = null
var/list/req_components = null var/list/req_components = null
var/list/req_component_names = null // user-friendly names of components var/list/req_component_names = null // user-friendly names of components
/obj/structure/frame/machine/examine(user) /obj/structure/frame/machine/examine(user)
..() ..()
if(state == 3 && req_components && req_component_names) if(state == 3 && req_components && req_component_names)
var/hasContent = 0 var/hasContent = 0
var/requires = "It requires" var/requires = "It requires"
for(var/i = 1 to req_components.len) for(var/i = 1 to req_components.len)
var/tname = req_components[i] var/tname = req_components[i]
var/amt = req_components[tname] var/amt = req_components[tname]
if(amt == 0) if(amt == 0)
continue continue
var/use_and = i == req_components.len var/use_and = i == req_components.len
requires += "[(hasContent ? (use_and ? ", and" : ",") : "")] [amt] [amt == 1 ? req_component_names[tname] : "[req_component_names[tname]]\s"]" requires += "[(hasContent ? (use_and ? ", and" : ",") : "")] [amt] [amt == 1 ? req_component_names[tname] : "[req_component_names[tname]]\s"]"
hasContent = 1 hasContent = 1
if(hasContent) if(hasContent)
to_chat(user, requires + ".") to_chat(user, requires + ".")
else else
to_chat(user, "It does not require any more components.") to_chat(user, "It does not require any more components.")
/obj/structure/frame/machine/proc/update_namelist() /obj/structure/frame/machine/proc/update_namelist()
if(!req_components) if(!req_components)
return return
req_component_names = new() req_component_names = new()
for(var/tname in req_components) for(var/tname in req_components)
if(ispath(tname, /obj/item/stack)) if(ispath(tname, /obj/item/stack))
var/obj/item/stack/S = tname var/obj/item/stack/S = tname
var/singular_name = initial(S.singular_name) var/singular_name = initial(S.singular_name)
if(singular_name) if(singular_name)
req_component_names[tname] = singular_name req_component_names[tname] = singular_name
else else
req_component_names[tname] = initial(S.name) req_component_names[tname] = initial(S.name)
else else
var/obj/O = tname var/obj/O = tname
req_component_names[tname] = initial(O.name) req_component_names[tname] = initial(O.name)
/obj/structure/frame/machine/proc/get_req_components_amt() /obj/structure/frame/machine/proc/get_req_components_amt()
var/amt = 0 var/amt = 0
for(var/path in req_components) for(var/path in req_components)
amt += req_components[path] amt += req_components[path]
return amt return amt
/obj/structure/frame/machine/attackby(obj/item/P, mob/user, params) /obj/structure/frame/machine/attackby(obj/item/P, mob/user, params)
switch(state) switch(state)
if(1) if(1)
if(istype(P, /obj/item/circuitboard/machine)) if(istype(P, /obj/item/circuitboard/machine))
to_chat(user, "<span class='warning'>The frame needs wiring first!</span>") to_chat(user, "<span class='warning'>The frame needs wiring first!</span>")
return return
else if(istype(P, /obj/item/circuitboard)) else if(istype(P, /obj/item/circuitboard))
to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>") to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>")
return return
if(istype(P, /obj/item/stack/cable_coil)) if(istype(P, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = P var/obj/item/stack/cable_coil/C = P
if(C.get_amount() >= 5) if(C.get_amount() >= 5)
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1) playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You start to add cables to the frame...</span>") to_chat(user, "<span class='notice'>You start to add cables to the frame...</span>")
if(do_after(user, 20*P.toolspeed, target = src)) if(do_after(user, 20*P.toolspeed, target = src))
if(C.get_amount() >= 5 && state == 1) if(C.get_amount() >= 5 && state == 1)
C.use(5) C.use(5)
to_chat(user, "<span class='notice'>You add cables to the frame.</span>") to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
state = 2 state = 2
icon_state = "box_1" icon_state = "box_1"
else else
to_chat(user, "<span class='warning'>You need five length of cable to wire the frame!</span>") to_chat(user, "<span class='warning'>You need five length of cable to wire the frame!</span>")
return return
if(istype(P, /obj/item/screwdriver) && !anchored) if(istype(P, /obj/item/screwdriver) && !anchored)
playsound(src.loc, P.usesound, 50, 1) playsound(src.loc, P.usesound, 50, 1)
user.visible_message("<span class='warning'>[user] disassembles the frame.</span>", \ user.visible_message("<span class='warning'>[user] disassembles the frame.</span>", \
"<span class='notice'>You start to disassemble the frame...</span>", "You hear banging and clanking.") "<span class='notice'>You start to disassemble the frame...</span>", "You hear banging and clanking.")
if(do_after(user, 40*P.toolspeed, target = src)) if(do_after(user, 40*P.toolspeed, target = src))
if(state == 1) if(state == 1)
to_chat(user, "<span class='notice'>You disassemble the frame.</span>") to_chat(user, "<span class='notice'>You disassemble the frame.</span>")
var/obj/item/stack/sheet/metal/M = new (loc, 5) var/obj/item/stack/sheet/metal/M = new (loc, 5)
M.add_fingerprint(user) M.add_fingerprint(user)
qdel(src) qdel(src)
return return
if(istype(P, /obj/item/wrench)) if(istype(P, /obj/item/wrench))
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>") to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>")
playsound(src.loc, P.usesound, 75, 1) playsound(src.loc, P.usesound, 75, 1)
if(do_after(user, 40*P.toolspeed, target = src)) if(do_after(user, 40*P.toolspeed, target = src))
if(state == 1) if(state == 1)
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>") to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>")
anchored = !anchored anchored = !anchored
return return
if(2) if(2)
if(istype(P, /obj/item/wrench)) if(istype(P, /obj/item/wrench))
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>") to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>")
playsound(src.loc, P.usesound, 75, 1) playsound(src.loc, P.usesound, 75, 1)
if(do_after(user, 40*P.toolspeed, target = src)) if(do_after(user, 40*P.toolspeed, target = src))
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>") to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>")
anchored = !anchored anchored = !anchored
return return
if(istype(P, /obj/item/circuitboard/machine)) if(istype(P, /obj/item/circuitboard/machine))
if(!anchored) if(!anchored)
to_chat(user, "<span class='warning'>The frame needs to be secured first!</span>") to_chat(user, "<span class='warning'>The frame needs to be secured first!</span>")
return return
var/obj/item/circuitboard/machine/B = P var/obj/item/circuitboard/machine/B = P
if(!user.drop_item()) if(!user.transferItemToLoc(B, src))
return return
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1) playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You add the circuit board to the frame.</span>") to_chat(user, "<span class='notice'>You add the circuit board to the frame.</span>")
circuit = B circuit = B
B.loc = src icon_state = "box_2"
icon_state = "box_2" state = 3
state = 3 components = list()
components = list() req_components = B.req_components.Copy()
req_components = B.req_components.Copy() update_namelist()
update_namelist() return
return
else if(istype(P, /obj/item/circuitboard))
else if(istype(P, /obj/item/circuitboard)) to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>")
to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>") return
return
if(istype(P, /obj/item/wirecutters))
if(istype(P, /obj/item/wirecutters)) playsound(src.loc, P.usesound, 50, 1)
playsound(src.loc, P.usesound, 50, 1) to_chat(user, "<span class='notice'>You remove the cables.</span>")
to_chat(user, "<span class='notice'>You remove the cables.</span>") state = 1
state = 1 icon_state = "box_0"
icon_state = "box_0" var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc ) A.amount = 5
A.amount = 5 return
return
if(3)
if(3) if(istype(P, /obj/item/crowbar))
if(istype(P, /obj/item/crowbar)) playsound(src.loc, P.usesound, 50, 1)
playsound(src.loc, P.usesound, 50, 1) state = 2
state = 2 circuit.loc = src.loc
circuit.loc = src.loc components.Remove(circuit)
components.Remove(circuit) circuit = null
circuit = null if(components.len == 0)
if(components.len == 0) to_chat(user, "<span class='notice'>You remove the circuit board.</span>")
to_chat(user, "<span class='notice'>You remove the circuit board.</span>") else
else to_chat(user, "<span class='notice'>You remove the circuit board and other components.</span>")
to_chat(user, "<span class='notice'>You remove the circuit board and other components.</span>") for(var/atom/movable/A in components)
for(var/atom/movable/A in components) A.loc = src.loc
A.loc = src.loc desc = initial(desc)
desc = initial(desc) req_components = null
req_components = null components = null
components = null icon_state = "box_1"
icon_state = "box_1" return
return
if(istype(P, /obj/item/screwdriver))
if(istype(P, /obj/item/screwdriver)) var/component_check = 1
var/component_check = 1 for(var/R in req_components)
for(var/R in req_components) if(req_components[R] > 0)
if(req_components[R] > 0) component_check = 0
component_check = 0 break
break if(component_check)
if(component_check) playsound(src.loc, P.usesound, 50, 1)
playsound(src.loc, P.usesound, 50, 1) var/obj/machinery/new_machine = new src.circuit.build_path(src.loc, 1)
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc, 1) new_machine.on_construction()
new_machine.on_construction() for(var/obj/O in new_machine.component_parts)
for(var/obj/O in new_machine.component_parts) qdel(O)
qdel(O) new_machine.component_parts = list()
new_machine.component_parts = list() for(var/obj/O in src)
for(var/obj/O in src) O.loc = null
O.loc = null new_machine.component_parts += O
new_machine.component_parts += O circuit.loc = null
circuit.loc = null new_machine.RefreshParts()
new_machine.RefreshParts() qdel(src)
qdel(src) return
return
if(istype(P, /obj/item/storage/part_replacer) && P.contents.len && get_req_components_amt())
if(istype(P, /obj/item/storage/part_replacer) && P.contents.len && get_req_components_amt()) var/obj/item/storage/part_replacer/replacer = P
var/obj/item/storage/part_replacer/replacer = P var/list/added_components = list()
var/list/added_components = list() var/list/part_list = list()
var/list/part_list = list()
//Assemble a list of current parts, then sort them by their rating!
//Assemble a list of current parts, then sort them by their rating! for(var/obj/item/stock_parts/co in replacer)
for(var/obj/item/stock_parts/co in replacer) part_list += co
part_list += co //Sort the parts. This ensures that higher tier items are applied first.
//Sort the parts. This ensures that higher tier items are applied first. part_list = sortTim(part_list, /proc/cmp_rped_sort)
part_list = sortTim(part_list, /proc/cmp_rped_sort)
for(var/path in req_components)
for(var/path in req_components) while(req_components[path] > 0 && (locate(path) in part_list))
while(req_components[path] > 0 && (locate(path) in part_list)) var/obj/item/part = (locate(path) in part_list)
var/obj/item/part = (locate(path) in part_list) added_components[part] = path
added_components[part] = path replacer.remove_from_storage(part, src)
replacer.remove_from_storage(part, src) req_components[path]--
req_components[path]-- part_list -= part
part_list -= part
for(var/obj/item/stock_parts/part in added_components)
for(var/obj/item/stock_parts/part in added_components) components += part
components += part to_chat(user, "<span class='notice'>[part.name] applied.</span>")
to_chat(user, "<span class='notice'>[part.name] applied.</span>") if(added_components.len)
if(added_components.len) replacer.play_rped_sound()
replacer.play_rped_sound() return
return
if(isitem(P) && get_req_components_amt())
if(isitem(P) && get_req_components_amt()) for(var/I in req_components)
for(var/I in req_components) if(istype(P, I) && (req_components[I] > 0))
if(istype(P, I) && (req_components[I] > 0)) if(istype(P, /obj/item/stack))
if(istype(P, /obj/item/stack)) var/obj/item/stack/S = P
var/obj/item/stack/S = P var/used_amt = min(round(S.get_amount()), req_components[I])
var/used_amt = min(round(S.get_amount()), req_components[I])
if(used_amt && S.use(used_amt))
if(used_amt && S.use(used_amt)) var/obj/item/stack/NS = locate(S.merge_type) in components
var/obj/item/stack/NS = locate(S.merge_type) in components
if(!NS)
if(!NS) NS = new S.merge_type(src, used_amt)
NS = new S.merge_type(src, used_amt) components += NS
components += NS else
else NS.add(used_amt)
NS.add(used_amt)
req_components[I] -= used_amt
req_components[I] -= used_amt to_chat(user, "<span class='notice'>You add [P] to [src].</span>")
to_chat(user, "<span class='notice'>You add [P] to [src].</span>") return
return if(!user.transferItemToLoc(P, src))
if(!user.drop_item()) break
break to_chat(user, "<span class='notice'>You add [P] to [src].</span>")
to_chat(user, "<span class='notice'>You add [P] to [src].</span>") components += P
P.forceMove(src) req_components[I]--
components += P return 1
req_components[I]-- to_chat(user, "<span class='warning'>You cannot add that to the machine!</span>")
return 1 return 0
to_chat(user, "<span class='warning'>You cannot add that to the machine!</span>") if(user.a_intent == INTENT_HARM)
return 0 return ..()
if(user.a_intent == INTENT_HARM)
return ..()
/obj/structure/frame/machine/deconstruct(disassembled = TRUE)
/obj/structure/frame/machine/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1)) if(!(flags_1 & NODECONSTRUCT_1))
if(state >= 2) if(state >= 2)
new /obj/item/stack/cable_coil(loc , 5) new /obj/item/stack/cable_coil(loc , 5)
for(var/X in components) for(var/X in components)
var/obj/item/I = X var/obj/item/I = X
I.forceMove(loc) I.forceMove(loc)
..() ..()
+1 -3
View File
@@ -127,7 +127,6 @@
here.ChangeTurf(T.type) here.ChangeTurf(T.type)
return INITIALIZE_HINT_QDEL return INITIALIZE_HINT_QDEL
here.ChangeTurf(/turf/closed/wall) here.ChangeTurf(/turf/closed/wall)
return INITIALIZE_HINT_QDEL
if(9 to 11) if(9 to 11)
lights = FALSE lights = FALSE
locked = TRUE locked = TRUE
@@ -1170,10 +1169,9 @@
to_chat(user, "<span class='warning'>The maintenance panel is destroyed!</span>") to_chat(user, "<span class='warning'>The maintenance panel is destroyed!</span>")
return return
to_chat(user, "<span class='warning'>You apply [C]. Next time someone opens the door, it will explode.</span>") to_chat(user, "<span class='warning'>You apply [C]. Next time someone opens the door, it will explode.</span>")
user.drop_item()
panel_open = FALSE panel_open = FALSE
update_icon() update_icon()
C.forceMove(src) user.transferItemToLoc(C, src, TRUE)
charge = C charge = C
else if(istype(C, /obj/item/paper) || istype(C, /obj/item/photo)) else if(istype(C, /obj/item/paper) || istype(C, /obj/item/photo))
if(note) if(note)
-1
View File
@@ -426,7 +426,6 @@
return return
if(constructionStep != CONSTRUCTION_NOCIRCUIT) if(constructionStep != CONSTRUCTION_NOCIRCUIT)
return return
user.drop_item()
qdel(C) qdel(C)
user.visible_message("<span class='notice'>[user] adds a circuit to [src].</span>", \ user.visible_message("<span class='notice'>[user] adds a circuit to [src].</span>", \
"<span class='notice'>You insert and secure [C].</span>") "<span class='notice'>You insert and secure [C].</span>")
+1 -2
View File
@@ -63,10 +63,9 @@
else if (istype(W, /obj/item/device/assembly/flash/handheld)) else if (istype(W, /obj/item/device/assembly/flash/handheld))
if (!bulb) if (!bulb)
if(!user.drop_item()) if(!user.transferItemToLoc(W, src))
return return
user.visible_message("[user] installs [W] into [src].", "<span class='notice'>You install [W] into [src].</span>") user.visible_message("[user] installs [W] into [src].", "<span class='notice'>You install [W] into [src].</span>")
W.forceMove(src)
bulb = W bulb = W
power_change() power_change()
else else
+6 -12
View File
@@ -33,9 +33,8 @@
/obj/machinery/gulag_item_reclaimer/attackby(obj/item/I, mob/user) /obj/machinery/gulag_item_reclaimer/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/card/id/prisoner)) if(istype(I, /obj/item/card/id/prisoner))
if(!inserted_id) if(!inserted_id)
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
return return
I.forceMove(src)
inserted_id = I inserted_id = I
to_chat(user, "<span class='notice'>You insert [I].</span>") to_chat(user, "<span class='notice'>You insert [I].</span>")
return return
@@ -82,18 +81,13 @@
switch(action) switch(action)
if("handle_id") if("handle_id")
if(inserted_id) if(inserted_id)
if(!usr.get_active_held_item()) usr.put_in_hands(inserted_id)
usr.put_in_hands(inserted_id) inserted_id = null
inserted_id = null
else
inserted_id.forceMove(get_turf(src))
inserted_id = null
else else
var/obj/item/I = usr.get_active_held_item() var/obj/item/I = usr.is_holding_item_of_type(/obj/item/card/id/prisoner)
if(istype(I, /obj/item/card/id/prisoner)) if(I)
if(!usr.drop_item()) if(!usr.transferItemToLoc(I, src))
return return
I.forceMove(src)
inserted_id = I inserted_id = I
if("release_items") if("release_items")
var/mob/M = locate(params["mobref"]) var/mob/M = locate(params["mobref"])
+1 -3
View File
@@ -95,10 +95,8 @@
if(beaker) if(beaker)
to_chat(user, "<span class='warning'>There is already a reagent container loaded!</span>") to_chat(user, "<span class='warning'>There is already a reagent container loaded!</span>")
return return
if(!user.drop_item()) if(!user.transferItemToLoc(W, src))
return return
W.forceMove(src)
beaker = W beaker = W
to_chat(user, "<span class='notice'>You attach [W] to [src].</span>") to_chat(user, "<span class='notice'>You attach [W] to [src].</span>")
update_icon() update_icon()
+3 -5
View File
@@ -786,11 +786,9 @@ GLOBAL_LIST_EMPTY(allCasters)
else else
qdel(photo) qdel(photo)
photo = null photo = null
if(istype(user.get_active_held_item(), /obj/item/photo)) photo = user.is_holding_item_of_type(/obj/item/photo)
photo = user.get_active_held_item() if(photo && !user.transferItemToLoc(photo, src))
if(!user.drop_item()) photo = null
return
photo.loc = src
if(issilicon(user)) if(issilicon(user))
var/list/nametemp = list() var/list/nametemp = list()
var/find var/find
@@ -71,8 +71,6 @@
add_fingerprint(user) add_fingerprint(user)
if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter)) if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter))
to_chat(usr, "<span class='notice'>You put [W] back into [src].</span>") to_chat(usr, "<span class='notice'>You put [W] back into [src].</span>")
if(!user.drop_item())
return
qdel(W) qdel(W)
return return
else if (istype(W, /obj/item/wrench)) else if (istype(W, /obj/item/wrench))
@@ -84,9 +84,8 @@
if(PTURRET_INTERNAL_ARMOUR_ON) if(PTURRET_INTERNAL_ARMOUR_ON)
if(istype(I, /obj/item/gun/energy)) //the gun installation part if(istype(I, /obj/item/gun/energy)) //the gun installation part
var/obj/item/gun/energy/E = I var/obj/item/gun/energy/E = I
if(!user.drop_item()) if(!user.transferItemToLoc(E, src))
return return
E.forceMove(src)
installed_gun = E installed_gun = E
to_chat(user, "<span class='notice'>You add [I] to the turret.</span>") to_chat(user, "<span class='notice'>You add [I] to the turret.</span>")
build_step = PTURRET_GUN_EQUIPPED build_step = PTURRET_GUN_EQUIPPED
@@ -101,7 +100,7 @@
if(PTURRET_GUN_EQUIPPED) if(PTURRET_GUN_EQUIPPED)
if(isprox(I)) if(isprox(I))
build_step = PTURRET_SENSORS_ON build_step = PTURRET_SENSORS_ON
if(!user.drop_item()) if(!user.temporarilyRemoveItemFromInventory(I))
return return
to_chat(user, "<span class='notice'>You add the proximity sensor to the turret.</span>") to_chat(user, "<span class='notice'>You add the proximity sensor to the turret.</span>")
qdel(I) qdel(I)
+1 -2
View File
@@ -50,9 +50,8 @@
to_chat(user, "<span class='notice'>Your gun has no external power connector.</span>") to_chat(user, "<span class='notice'>Your gun has no external power connector.</span>")
return 1 return 1
if(!user.drop_item()) if(!user.transferItemToLoc(G, src))
return 1 return 1
G.loc = src
charging = G charging = G
use_power = ACTIVE_POWER_USE use_power = ACTIVE_POWER_USE
update_icon(scan = TRUE) update_icon(scan = TRUE)
+2 -3
View File
@@ -83,16 +83,15 @@
if(istype(I, /obj/item/coin)) if(istype(I, /obj/item/coin))
var/obj/item/coin/C = I var/obj/item/coin/C = I
if(prob(2)) if(prob(2))
if(!user.drop_item()) if(!user.transferItemToLoc(C, drop_location()))
return return
C.loc = loc
C.throw_at(user, 3, 10) C.throw_at(user, 3, 10)
if(prob(10)) if(prob(10))
balance = max(balance - SPIN_PRICE, 0) balance = max(balance - SPIN_PRICE, 0)
to_chat(user, "<span class='warning'>[src] spits your coin back out!</span>") to_chat(user, "<span class='warning'>[src] spits your coin back out!</span>")
else else
if(!user.drop_item()) if(!user.temporarilyRemoveItemFromInventory(C))
return return
to_chat(user, "<span class='notice'>You insert a [C.cmineral] coin into [src]'s slot!</span>") to_chat(user, "<span class='notice'>You insert a [C.cmineral] coin into [src]'s slot!</span>")
balance += C.value balance += C.value
+6 -11
View File
@@ -140,18 +140,13 @@
if(cell) if(cell)
to_chat(user, "<span class='warning'>There is already a power cell inside!</span>") to_chat(user, "<span class='warning'>There is already a power cell inside!</span>")
return return
else else if(!user.transferItemToLoc(I, src))
// insert cell return
var/obj/item/stock_parts/cell/C = usr.get_active_held_item() cell = I
if(istype(C)) I.add_fingerprint(usr)
if(!user.drop_item())
return
cell = C
C.loc = src
C.add_fingerprint(usr)
user.visible_message("\The [user] inserts a power cell into \the [src].", "<span class='notice'>You insert the power cell into \the [src].</span>") user.visible_message("\The [user] inserts a power cell into \the [src].", "<span class='notice'>You insert the power cell into \the [src].</span>")
SStgui.update_uis(src) SStgui.update_uis(src)
else else
to_chat(user, "<span class='warning'>The hatch must be open to insert a power cell!</span>") to_chat(user, "<span class='warning'>The hatch must be open to insert a power cell!</span>")
return return
+4 -5
View File
@@ -298,32 +298,31 @@
if(suit) if(suit)
to_chat(user, "<span class='warning'>The unit already contains a suit!.</span>") to_chat(user, "<span class='warning'>The unit already contains a suit!.</span>")
return return
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
return return
suit = I suit = I
else if(istype(I, /obj/item/clothing/head/helmet)) else if(istype(I, /obj/item/clothing/head/helmet))
if(helmet) if(helmet)
to_chat(user, "<span class='warning'>The unit already contains a helmet!</span>") to_chat(user, "<span class='warning'>The unit already contains a helmet!</span>")
return return
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
return return
helmet = I helmet = I
else if(istype(I, /obj/item/clothing/mask)) else if(istype(I, /obj/item/clothing/mask))
if(mask) if(mask)
to_chat(user, "<span class='warning'>The unit already contains a mask!</span>") to_chat(user, "<span class='warning'>The unit already contains a mask!</span>")
return return
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
return return
mask = I mask = I
else else
if(storage) if(storage)
to_chat(user, "<span class='warning'>The auxiliary storage compartment is full!</span>") to_chat(user, "<span class='warning'>The auxiliary storage compartment is full!</span>")
return return
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
return return
storage = I storage = I
I.loc = src
visible_message("<span class='notice'>[user] inserts [I] into [src]</span>", "<span class='notice'>You load [I] into [src].</span>") visible_message("<span class='notice'>[user] inserts [I] into [src]</span>", "<span class='notice'>You load [I] into [src].</span>")
update_icon() update_icon()
return return
+2 -4
View File
@@ -150,11 +150,10 @@
to_chat(user, "<span class='warning'>The cover is screwed on, it won't pry off!</span>") to_chat(user, "<span class='warning'>The cover is screwed on, it won't pry off!</span>")
else if(istype(I, /obj/item/bombcore)) else if(istype(I, /obj/item/bombcore))
if(!payload) if(!payload)
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
return return
payload = I payload = I
to_chat(user, "<span class='notice'>You place [payload] into [src].</span>") to_chat(user, "<span class='notice'>You place [payload] into [src].</span>")
payload.loc = src
else else
to_chat(user, "<span class='warning'>[payload] is already loaded into [src]! You'll have to remove it first.</span>") to_chat(user, "<span class='warning'>[payload] is already loaded into [src]! You'll have to remove it first.</span>")
else if(istype(I, /obj/item/weldingtool)) else if(istype(I, /obj/item/weldingtool))
@@ -463,11 +462,10 @@
return return
else if(istype(I, /obj/item/reagent_containers/glass/beaker) || istype(I, /obj/item/reagent_containers/glass/bottle)) else if(istype(I, /obj/item/reagent_containers/glass/beaker) || istype(I, /obj/item/reagent_containers/glass/bottle))
if(beakers.len < max_beakers) if(beakers.len < max_beakers)
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
return return
beakers += I beakers += I
to_chat(user, "<span class='notice'>You load [src] with [I].</span>") to_chat(user, "<span class='notice'>You load [src] with [I].</span>")
I.loc = src
else else
to_chat(user, "<span class='warning'>The [I] wont fit! The [src] can only hold up to [max_beakers] containers.</span>") to_chat(user, "<span class='warning'>The [I] wont fit! The [src] can only hold up to [max_beakers] containers.</span>")
return return
+2 -4
View File
@@ -189,9 +189,8 @@
var/obj/item/reagent_containers/food/snacks/S = W var/obj/item/reagent_containers/food/snacks/S = W
if(!S.junkiness) if(!S.junkiness)
if(!iscompartmentfull(user)) if(!iscompartmentfull(user))
if(!user.drop_item()) if(!user.transferItemToLoc(W, src))
return return
W.loc = src
food_load(W) food_load(W)
to_chat(user, "<span class='notice'>You insert [W] into [src]'s chef compartment.</span>") to_chat(user, "<span class='notice'>You insert [W] into [src]'s chef compartment.</span>")
else else
@@ -279,9 +278,8 @@
if(!premium.len) if(!premium.len)
to_chat(user, "<span class='warning'>[src] doesn't have a coin slot.</span>") to_chat(user, "<span class='warning'>[src] doesn't have a coin slot.</span>")
return return
if(!user.drop_item()) if(!user.transferItemToLoc(W, src))
return return
W.loc = src
coin = W coin = W
to_chat(user, "<span class='notice'>You insert [W] into [src].</span>") to_chat(user, "<span class='notice'>You insert [W] into [src].</span>")
return return
@@ -426,7 +426,7 @@
if(!istype(T)) if(!istype(T))
return return
var/datum/gas_mixture/GM = new var/datum/gas_mixture/GM = new
GM.assert_gas("plasma") ASSERT_GAS("plasma", GM)
if(prob(10)) if(prob(10))
GM.gases["plasma"][MOLES] += 100 GM.gases["plasma"][MOLES] += 100
GM.temperature = 1500+T0C //should be enough to start a fire GM.temperature = 1500+T0C //should be enough to start a fire
+2 -3
View File
@@ -161,7 +161,7 @@
var/obj/item/mecha_parts/mecha_equipment/E = W var/obj/item/mecha_parts/mecha_equipment/E = W
spawn() spawn()
if(E.can_attach(src)) if(E.can_attach(src))
if(!user.drop_item()) if(!user.temporarilyRemoveItemFromInventory(W))
return return
E.attach(src) E.attach(src)
user.visible_message("[user] attaches [W] to [src].", "<span class='notice'>You attach [W] to [src].</span>") user.visible_message("[user] attaches [W] to [src].", "<span class='notice'>You attach [W] to [src].</span>")
@@ -226,11 +226,10 @@
else if(istype(W, /obj/item/stock_parts/cell)) else if(istype(W, /obj/item/stock_parts/cell))
if(state==4) if(state==4)
if(!cell) if(!cell)
if(!user.drop_item()) if(!user.transferItemToLoc(W, src))
return return
var/obj/item/stock_parts/cell/C = W var/obj/item/stock_parts/cell/C = W
to_chat(user, "<span class='notice'>You install the powercell.</span>") to_chat(user, "<span class='notice'>You install the powercell.</span>")
C.forceMove(src)
cell = C cell = C
log_message("Powercell installed") log_message("Powercell installed")
else else
@@ -128,7 +128,7 @@
/obj/effect/particle_effect/smoke/bad/smoke_mob(mob/living/carbon/M) /obj/effect/particle_effect/smoke/bad/smoke_mob(mob/living/carbon/M)
if(..()) if(..())
M.drop_item() M.drop_all_held_items()
M.adjustOxyLoss(1) M.adjustOxyLoss(1)
M.emote("cough") M.emote("cough")
return 1 return 1
@@ -169,7 +169,7 @@
qdel(H) qdel(H)
var/list/G_gases = G.gases var/list/G_gases = G.gases
if(G_gases["plasma"]) if(G_gases["plasma"])
G.assert_gas("n2") ASSERT_GAS("n2", G)
G_gases["n2"][MOLES] += (G_gases["plasma"][MOLES]) G_gases["n2"][MOLES] += (G_gases["plasma"][MOLES])
G_gases["plasma"][MOLES] = 0 G_gases["plasma"][MOLES] = 0
G.garbage_collect() G.garbage_collect()
@@ -205,7 +205,6 @@
/obj/effect/particle_effect/smoke/sleeping/smoke_mob(mob/living/carbon/M) /obj/effect/particle_effect/smoke/sleeping/smoke_mob(mob/living/carbon/M)
if(..()) if(..())
M.drop_item()
M.Sleeping(200) M.Sleeping(200)
M.emote("cough") M.emote("cough")
return 1 return 1
+1 -1
View File
@@ -531,7 +531,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
to_chat(M, "<span class='danger'>You become nearsighted!</span>") to_chat(M, "<span class='danger'>You become nearsighted!</span>")
if(prob(50)) if(prob(50))
if(M.stat != DEAD) if(M.stat != DEAD)
if(M.drop_item()) if(M.drop_all_held_items())
to_chat(M, "<span class='danger'>You drop what you're holding and clutch at your eyes!</span>") to_chat(M, "<span class='danger'>You drop what you're holding and clutch at your eyes!</span>")
M.adjust_blurriness(10) M.adjust_blurriness(10)
M.Unconscious(20) M.Unconscious(20)
@@ -15,7 +15,7 @@
origin_tech = "materials=1;engineering=1" origin_tech = "materials=1;engineering=1"
/obj/item/device/transfer_valve/IsAssemblyHolder() /obj/item/device/transfer_valve/IsAssemblyHolder()
return 1 return TRUE
/obj/item/device/transfer_valve/attackby(obj/item/item, mob/user, params) /obj/item/device/transfer_valve/attackby(obj/item/item, mob/user, params)
if(istype(item, /obj/item/tank)) if(istype(item, /obj/item/tank))
@@ -76,47 +76,46 @@
/obj/item/device/transfer_valve/Topic(href, href_list) /obj/item/device/transfer_valve/Topic(href, href_list)
..() ..()
if ( usr.stat || usr.restrained() ) if(!usr.canUseTopic(src))
return return
if (src.loc == usr) if(tank_one && href_list["tankone"])
if(tank_one && href_list["tankone"]) split_gases()
split_gases() valve_open = FALSE
valve_open = FALSE tank_one.forceMove(drop_location())
tank_one.loc = get_turf(src) tank_one = null
tank_one = null update_icon()
if((!tank_two || tank_two.w_class < WEIGHT_CLASS_BULKY) && (w_class > WEIGHT_CLASS_NORMAL))
w_class = WEIGHT_CLASS_NORMAL
else if(tank_two && href_list["tanktwo"])
split_gases()
valve_open = FALSE
tank_two.forceMove(drop_location())
tank_two = null
update_icon()
if((!tank_one || tank_one.w_class < WEIGHT_CLASS_BULKY) && (w_class > WEIGHT_CLASS_NORMAL))
w_class = WEIGHT_CLASS_NORMAL
else if(href_list["open"])
toggle_valve()
else if(attached_device)
if(href_list["rem_device"])
attached_device.forceMove(drop_location())
attached_device.holder = null
attached_device = null
update_icon() update_icon()
if((!tank_two || tank_two.w_class < WEIGHT_CLASS_BULKY) && (w_class > WEIGHT_CLASS_NORMAL)) if(href_list["device"])
w_class = WEIGHT_CLASS_NORMAL attached_device.attack_self(usr)
else if(tank_two && href_list["tanktwo"])
split_gases()
valve_open = FALSE
tank_two.loc = get_turf(src)
tank_two = null
update_icon()
if((!tank_one || tank_one.w_class < WEIGHT_CLASS_BULKY) && (w_class > WEIGHT_CLASS_NORMAL))
w_class = WEIGHT_CLASS_NORMAL
else if(href_list["open"])
toggle_valve()
else if(attached_device)
if(href_list["rem_device"])
attached_device.forceMove(get_turf(src))
attached_device.holder = null
attached_device = null
update_icon()
if(href_list["device"])
attached_device.attack_self(usr)
src.attack_self(usr) attack_self(usr)
src.add_fingerprint(usr) add_fingerprint(usr)
return
return
/obj/item/device/transfer_valve/proc/process_activation(obj/item/device/D) /obj/item/device/transfer_valve/proc/process_activation(obj/item/device/D)
if(toggle) if(toggle)
toggle = 0 toggle = FALSE
toggle_valve() toggle_valve()
spawn(50) // To stop a signal being spammed from a proxy sensor constantly going off or whatever addtimer(CALLBACK(src, .proc/toggle_off), 5) //To stop a signal being spammed from a proxy sensor constantly going off or whatever
toggle = 1
/obj/item/device/transfer_valve/proc/toggle_off()
toggle = TRUE
/obj/item/device/transfer_valve/update_icon() /obj/item/device/transfer_valve/update_icon()
cut_overlays() cut_overlays()
@@ -196,16 +195,13 @@
message_admins(bomb_message, 0, 1) message_admins(bomb_message, 0, 1)
log_game("[log_str1] [A.name][COORD(bombturf)] [log_str2] [log_str3]") log_game("[log_str1] [A.name][COORD(bombturf)] [log_str2] [log_str3]")
merge_gases() merge_gases()
spawn(20) // In case one tank bursts for(var/i in 1 to 6)
for (var/i=0,i<5,i++) addtimer(CALLBACK(src, .proc/update_icon), 20 + (i - 1) * 10)
src.update_icon()
sleep(10)
src.update_icon()
else if(valve_open && tank_one && tank_two) else if(valve_open && tank_one && tank_two)
split_gases() split_gases()
valve_open = FALSE valve_open = FALSE
src.update_icon() update_icon()
// this doesn't do anything but the timer etc. expects it to be here // this doesn't do anything but the timer etc. expects it to be here
// eventually maybe have it update icon to show state (timer, prox etc.) like old bombs // eventually maybe have it update icon to show state (timer, prox etc.) like old bombs
+373 -372
View File
@@ -1,372 +1,373 @@
/obj/item/restraints /obj/item/restraints
breakouttime = 600 breakouttime = 600
//Handcuffs //Handcuffs
/obj/item/restraints/handcuffs /obj/item/restraints/handcuffs
name = "handcuffs" name = "handcuffs"
desc = "Use this to keep prisoners in line." desc = "Use this to keep prisoners in line."
gender = PLURAL gender = PLURAL
icon = 'icons/obj/items_and_weapons.dmi' icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "handcuff" icon_state = "handcuff"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi' lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi' righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
flags_1 = CONDUCT_1 flags_1 = CONDUCT_1
slot_flags = SLOT_BELT slot_flags = SLOT_BELT
throwforce = 0 throwforce = 0
w_class = WEIGHT_CLASS_SMALL w_class = WEIGHT_CLASS_SMALL
throw_speed = 3 throw_speed = 3
throw_range = 5 throw_range = 5
materials = list(MAT_METAL=500) materials = list(MAT_METAL=500)
origin_tech = "engineering=3;combat=3" origin_tech = "engineering=3;combat=3"
breakouttime = 600 //Deciseconds = 60s = 1 minute breakouttime = 600 //Deciseconds = 60s = 1 minute
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 50) armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 50)
var/cuffsound = 'sound/weapons/handcuffs.ogg' var/cuffsound = 'sound/weapons/handcuffs.ogg'
var/trashtype = null //for disposable cuffs var/trashtype = null //for disposable cuffs
/obj/item/restraints/handcuffs/attack(mob/living/carbon/C, mob/living/carbon/human/user) /obj/item/restraints/handcuffs/attack(mob/living/carbon/C, mob/living/carbon/human/user)
if(!istype(C)) if(!istype(C))
return return
if(user.disabilities & CLUMSY && prob(50)) if(user.disabilities & CLUMSY && prob(50))
to_chat(user, "<span class='warning'>Uh... how do those things work?!</span>") to_chat(user, "<span class='warning'>Uh... how do those things work?!</span>")
apply_cuffs(user,user) apply_cuffs(user,user)
return return
// chance of monkey retaliation // chance of monkey retaliation
if(ismonkey(C) && prob(MONKEY_CUFF_RETALIATION_PROB)) if(ismonkey(C) && prob(MONKEY_CUFF_RETALIATION_PROB))
var/mob/living/carbon/monkey/M var/mob/living/carbon/monkey/M
M = C M = C
M.retaliate(user) M.retaliate(user)
if(!C.handcuffed) if(!C.handcuffed)
if(C.get_num_arms() >= 2 || C.get_arm_ignore()) if(C.get_num_arms() >= 2 || C.get_arm_ignore())
C.visible_message("<span class='danger'>[user] is trying to put [src.name] on [C]!</span>", \ C.visible_message("<span class='danger'>[user] is trying to put [src.name] on [C]!</span>", \
"<span class='userdanger'>[user] is trying to put [src.name] on [C]!</span>") "<span class='userdanger'>[user] is trying to put [src.name] on [C]!</span>")
playsound(loc, cuffsound, 30, 1, -2) playsound(loc, cuffsound, 30, 1, -2)
if(do_mob(user, C, 30) && (C.get_num_arms() >= 2 || C.get_arm_ignore())) if(do_mob(user, C, 30) && (C.get_num_arms() >= 2 || C.get_arm_ignore()))
apply_cuffs(C,user) apply_cuffs(C,user)
to_chat(user, "<span class='notice'>You handcuff [C].</span>") to_chat(user, "<span class='notice'>You handcuff [C].</span>")
SSblackbox.add_details("handcuffs","[type]") SSblackbox.add_details("handcuffs","[type]")
add_logs(user, C, "handcuffed") add_logs(user, C, "handcuffed")
else else
to_chat(user, "<span class='warning'>You fail to handcuff [C]!</span>") to_chat(user, "<span class='warning'>You fail to handcuff [C]!</span>")
else else
to_chat(user, "<span class='warning'>[C] doesn't have two hands...</span>") to_chat(user, "<span class='warning'>[C] doesn't have two hands...</span>")
/obj/item/restraints/handcuffs/proc/apply_cuffs(mob/living/carbon/target, mob/user, var/dispense = 0) /obj/item/restraints/handcuffs/proc/apply_cuffs(mob/living/carbon/target, mob/user, var/dispense = 0)
if(target.handcuffed) if(target.handcuffed)
return return
if(!user.drop_item() && !dispense) if(!user.temporarilyRemoveItemFromInventory(src) && !dispense)
return return
var/obj/item/restraints/handcuffs/cuffs = src var/obj/item/restraints/handcuffs/cuffs = src
if(trashtype) if(trashtype)
cuffs = new trashtype() cuffs = new trashtype()
else if(dispense) else if(dispense)
cuffs = new type() cuffs = new type()
cuffs.loc = target cuffs.forceMove(target)
target.handcuffed = cuffs target.handcuffed = cuffs
target.update_handcuffed() target.update_handcuffed()
if(trashtype && !dispense) if(trashtype && !dispense)
qdel(src) qdel(src)
return return
/obj/item/restraints/handcuffs/sinew /obj/item/restraints/handcuffs/sinew
name = "sinew restraints" name = "sinew restraints"
desc = "A pair of restraints fashioned from long strands of flesh." desc = "A pair of restraints fashioned from long strands of flesh."
icon = 'icons/obj/mining.dmi' icon = 'icons/obj/mining.dmi'
icon_state = "sinewcuff" icon_state = "sinewcuff"
item_state = "sinewcuff" item_state = "sinewcuff"
breakouttime = 300 //Deciseconds = 30s breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg' cuffsound = 'sound/weapons/cablecuff.ogg'
/obj/item/restraints/handcuffs/cable /obj/item/restraints/handcuffs/cable
name = "cable restraints" name = "cable restraints"
desc = "Looks like some cables tied together. Could be used to tie something up." desc = "Looks like some cables tied together. Could be used to tie something up."
icon_state = "cuff_red" icon_state = "cuff_red"
item_state = "coil_red" item_state = "coil_red"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi' lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi' righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
materials = list(MAT_METAL=150, MAT_GLASS=75) materials = list(MAT_METAL=150, MAT_GLASS=75)
origin_tech = "engineering=2" origin_tech = "engineering=2"
breakouttime = 300 //Deciseconds = 30s breakouttime = 300 //Deciseconds = 30s
cuffsound = 'sound/weapons/cablecuff.ogg' cuffsound = 'sound/weapons/cablecuff.ogg'
var/datum/robot_energy_storage/wirestorage = null var/datum/robot_energy_storage/wirestorage = null
/obj/item/restraints/handcuffs/cable/attack(mob/living/carbon/C, mob/living/carbon/human/user) /obj/item/restraints/handcuffs/cable/attack(mob/living/carbon/C, mob/living/carbon/human/user)
if(!istype(C)) if(!istype(C))
return return
if(wirestorage && wirestorage.energy < 15) if(wirestorage && wirestorage.energy < 15)
to_chat(user, "<span class='warning'>You need at least 15 wire to restrain [C]!</span>") to_chat(user, "<span class='warning'>You need at least 15 wire to restrain [C]!</span>")
return return
return ..() return ..()
/obj/item/restraints/handcuffs/cable/apply_cuffs(mob/living/carbon/target, mob/user, var/dispense = 0) /obj/item/restraints/handcuffs/cable/apply_cuffs(mob/living/carbon/target, mob/user, var/dispense = 0)
if(wirestorage) if(wirestorage)
if(!wirestorage.use_charge(15)) if(!wirestorage.use_charge(15))
to_chat(user, "<span class='warning'>You need at least 15 wire to restrain [target]!</span>") to_chat(user, "<span class='warning'>You need at least 15 wire to restrain [target]!</span>")
return return
return ..(target, user, 1) return ..(target, user, 1)
return ..() return ..()
/obj/item/restraints/handcuffs/cable/red /obj/item/restraints/handcuffs/cable/red
icon_state = "cuff_red" icon_state = "cuff_red"
item_state = "coil_red" item_state = "coil_red"
/obj/item/restraints/handcuffs/cable/yellow /obj/item/restraints/handcuffs/cable/yellow
icon_state = "cuff_yellow" icon_state = "cuff_yellow"
item_state = "coil_yellow" item_state = "coil_yellow"
/obj/item/restraints/handcuffs/cable/blue /obj/item/restraints/handcuffs/cable/blue
icon_state = "cuff_blue" icon_state = "cuff_blue"
item_state = "coil_blue" item_state = "coil_blue"
/obj/item/restraints/handcuffs/cable/green /obj/item/restraints/handcuffs/cable/green
icon_state = "cuff_green" icon_state = "cuff_green"
item_state = "coil_green" item_state = "coil_green"
/obj/item/restraints/handcuffs/cable/pink /obj/item/restraints/handcuffs/cable/pink
icon_state = "cuff_pink" icon_state = "cuff_pink"
item_state = "coil_pink" item_state = "coil_pink"
/obj/item/restraints/handcuffs/cable/orange /obj/item/restraints/handcuffs/cable/orange
icon_state = "cuff_orange" icon_state = "cuff_orange"
item_state = "coil_orange" item_state = "coil_orange"
/obj/item/restraints/handcuffs/cable/cyan /obj/item/restraints/handcuffs/cable/cyan
icon_state = "cuff_cyan" icon_state = "cuff_cyan"
item_state = "coil_cyan" item_state = "coil_cyan"
/obj/item/restraints/handcuffs/cable/white /obj/item/restraints/handcuffs/cable/white
icon_state = "cuff_white" icon_state = "cuff_white"
item_state = "coil_white" item_state = "coil_white"
/obj/item/restraints/handcuffs/alien /obj/item/restraints/handcuffs/alien
icon_state = "handcuffAlien" icon_state = "handcuffAlien"
/obj/item/restraints/handcuffs/fake /obj/item/restraints/handcuffs/fake
name = "fake handcuffs" name = "fake handcuffs"
desc = "Fake handcuffs meant for gag purposes." desc = "Fake handcuffs meant for gag purposes."
breakouttime = 10 //Deciseconds = 1s breakouttime = 10 //Deciseconds = 1s
/obj/item/restraints/handcuffs/fake/kinky /obj/item/restraints/handcuffs/fake/kinky
name = "kinky handcuffs" name = "kinky handcuffs"
desc = "Fake handcuffs meant for erotic roleplay." desc = "Fake handcuffs meant for erotic roleplay."
icon_state = "handcuffGag" icon_state = "handcuffGag"
/obj/item/restraints/handcuffs/cable/attackby(obj/item/I, mob/user, params) /obj/item/restraints/handcuffs/cable/attackby(obj/item/I, mob/user, params)
..() ..()
if(istype(I, /obj/item/stack/rods)) if(istype(I, /obj/item/stack/rods))
var/obj/item/stack/rods/R = I var/obj/item/stack/rods/R = I
if (R.use(1)) if (R.use(1))
var/obj/item/wirerod/W = new /obj/item/wirerod var/obj/item/wirerod/W = new /obj/item/wirerod
remove_item_from_storage(user) remove_item_from_storage(user)
user.put_in_hands(W) user.put_in_hands(W)
to_chat(user, "<span class='notice'>You wrap the cable restraint around the top of the rod.</span>") to_chat(user, "<span class='notice'>You wrap the cable restraint around the top of the rod.</span>")
qdel(src) qdel(src)
else else
to_chat(user, "<span class='warning'>You need one rod to make a wired rod!</span>") to_chat(user, "<span class='warning'>You need one rod to make a wired rod!</span>")
return return
else if(istype(I, /obj/item/stack/sheet/metal)) else if(istype(I, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = I var/obj/item/stack/sheet/metal/M = I
if(M.get_amount() < 6) if(M.get_amount() < 6)
to_chat(user, "<span class='warning'>You need at least six metal sheets to make good enough weights!</span>") to_chat(user, "<span class='warning'>You need at least six metal sheets to make good enough weights!</span>")
return return
to_chat(user, "<span class='notice'>You begin to apply [I] to [src]...</span>") to_chat(user, "<span class='notice'>You begin to apply [I] to [src]...</span>")
if(do_after(user, 35, target = src)) if(do_after(user, 35, target = src))
if(M.get_amount() < 6 || !M) if(M.get_amount() < 6 || !M)
return return
var/obj/item/restraints/legcuffs/bola/S = new /obj/item/restraints/legcuffs/bola var/obj/item/restraints/legcuffs/bola/S = new /obj/item/restraints/legcuffs/bola
M.use(6) M.use(6)
user.put_in_hands(S) user.put_in_hands(S)
to_chat(user, "<span class='notice'>You make some weights out of [I] and tie them to [src].</span>") to_chat(user, "<span class='notice'>You make some weights out of [I] and tie them to [src].</span>")
remove_item_from_storage(user) remove_item_from_storage(user)
qdel(src) qdel(src)
else else
return ..() return ..()
/obj/item/restraints/handcuffs/cable/zipties/cyborg/attack(mob/living/carbon/C, mob/user) /obj/item/restraints/handcuffs/cable/zipties/cyborg/attack(mob/living/carbon/C, mob/user)
if(iscyborg(user)) if(iscyborg(user))
if(!C.handcuffed) if(!C.handcuffed)
playsound(loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2) playsound(loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2)
C.visible_message("<span class='danger'>[user] is trying to put zipties on [C]!</span>", \ C.visible_message("<span class='danger'>[user] is trying to put zipties on [C]!</span>", \
"<span class='userdanger'>[user] is trying to put zipties on [C]!</span>") "<span class='userdanger'>[user] is trying to put zipties on [C]!</span>")
if(do_mob(user, C, 30)) if(do_mob(user, C, 30))
if(!C.handcuffed) if(!C.handcuffed)
C.handcuffed = new /obj/item/restraints/handcuffs/cable/zipties/used(C) C.handcuffed = new /obj/item/restraints/handcuffs/cable/zipties/used(C)
C.update_handcuffed() C.update_handcuffed()
to_chat(user, "<span class='notice'>You handcuff [C].</span>") to_chat(user, "<span class='notice'>You handcuff [C].</span>")
add_logs(user, C, "handcuffed") add_logs(user, C, "handcuffed")
else else
to_chat(user, "<span class='warning'>You fail to handcuff [C]!</span>") to_chat(user, "<span class='warning'>You fail to handcuff [C]!</span>")
/obj/item/restraints/handcuffs/cable/zipties /obj/item/restraints/handcuffs/cable/zipties
name = "zipties" name = "zipties"
desc = "Plastic, disposable zipties that can be used to restrain temporarily but are destroyed after use." desc = "Plastic, disposable zipties that can be used to restrain temporarily but are destroyed after use."
icon_state = "cuff_white" icon_state = "cuff_white"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi' lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi' righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
materials = list() materials = list()
breakouttime = 450 //Deciseconds = 45s breakouttime = 450 //Deciseconds = 45s
trashtype = /obj/item/restraints/handcuffs/cable/zipties/used trashtype = /obj/item/restraints/handcuffs/cable/zipties/used
/obj/item/restraints/handcuffs/cable/zipties/used /obj/item/restraints/handcuffs/cable/zipties/used
desc = "A pair of broken zipties." desc = "A pair of broken zipties."
icon_state = "cuff_white_used" icon_state = "cuff_white_used"
item_state = "cuff_white" item_state = "cuff_white"
/obj/item/restraints/handcuffs/cable/zipties/used/attack() /obj/item/restraints/handcuffs/cable/zipties/used/attack()
return return
//Legcuffs //Legcuffs
/obj/item/restraints/legcuffs /obj/item/restraints/legcuffs
name = "leg cuffs" name = "leg cuffs"
desc = "Use this to keep prisoners in line." desc = "Use this to keep prisoners in line."
gender = PLURAL gender = PLURAL
icon = 'icons/obj/items_and_weapons.dmi' icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "handcuff" icon_state = "handcuff"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi' lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi' righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
flags_1 = CONDUCT_1 flags_1 = CONDUCT_1
throwforce = 0 throwforce = 0
w_class = WEIGHT_CLASS_NORMAL w_class = WEIGHT_CLASS_NORMAL
origin_tech = "engineering=3;combat=3" origin_tech = "engineering=3;combat=3"
slowdown = 7 slowdown = 7
breakouttime = 300 //Deciseconds = 30s = 0.5 minute breakouttime = 300 //Deciseconds = 30s = 0.5 minute
/obj/item/restraints/legcuffs/beartrap /obj/item/restraints/legcuffs/beartrap
name = "bear trap" name = "bear trap"
throw_speed = 1 throw_speed = 1
throw_range = 1 throw_range = 1
icon_state = "beartrap" icon_state = "beartrap"
desc = "A trap used to catch bears and other legged creatures." desc = "A trap used to catch bears and other legged creatures."
origin_tech = "engineering=4" origin_tech = "engineering=4"
var/armed = 0 var/armed = 0
var/trap_damage = 20 var/trap_damage = 20
/obj/item/restraints/legcuffs/beartrap/Initialize() /obj/item/restraints/legcuffs/beartrap/Initialize()
. = ..() . = ..()
icon_state = "[initial(icon_state)][armed]" icon_state = "[initial(icon_state)][armed]"
/obj/item/restraints/legcuffs/beartrap/suicide_act(mob/user) /obj/item/restraints/legcuffs/beartrap/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is sticking [user.p_their()] head in the [src.name]! It looks like [user.p_theyre()] trying to commit suicide!</span>") user.visible_message("<span class='suicide'>[user] is sticking [user.p_their()] head in the [src.name]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1) playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return (BRUTELOSS) return (BRUTELOSS)
/obj/item/restraints/legcuffs/beartrap/attack_self(mob/user) /obj/item/restraints/legcuffs/beartrap/attack_self(mob/user)
..() ..()
if(ishuman(user) && !user.stat && !user.restrained()) if(ishuman(user) && !user.stat && !user.restrained())
armed = !armed armed = !armed
icon_state = "[initial(icon_state)][armed]" icon_state = "[initial(icon_state)][armed]"
to_chat(user, "<span class='notice'>[src] is now [armed ? "armed" : "disarmed"]</span>") to_chat(user, "<span class='notice'>[src] is now [armed ? "armed" : "disarmed"]</span>")
/obj/item/restraints/legcuffs/beartrap/Crossed(AM as mob|obj) /obj/item/restraints/legcuffs/beartrap/Crossed(AM as mob|obj)
if(armed && isturf(src.loc)) if(armed && isturf(src.loc))
if(isliving(AM)) if(isliving(AM))
var/mob/living/L = AM var/mob/living/L = AM
var/snap = 0 var/snap = 0
var/def_zone = "chest" var/def_zone = "chest"
if(iscarbon(L)) if(iscarbon(L))
var/mob/living/carbon/C = L var/mob/living/carbon/C = L
snap = 1 snap = 1
if(!C.lying) if(!C.lying)
def_zone = pick("l_leg", "r_leg") def_zone = pick("l_leg", "r_leg")
if(!C.legcuffed && C.get_num_legs() >= 2) //beartrap can't cuff your leg if there's already a beartrap or legcuffs, or you don't have two legs. if(!C.legcuffed && C.get_num_legs() >= 2) //beartrap can't cuff your leg if there's already a beartrap or legcuffs, or you don't have two legs.
C.legcuffed = src C.legcuffed = src
src.loc = C src.loc = C
C.update_inv_legcuffed() C.update_inv_legcuffed()
SSblackbox.add_details("handcuffs","[type]") SSblackbox.add_details("handcuffs","[type]")
else if(isanimal(L)) else if(isanimal(L))
var/mob/living/simple_animal/SA = L var/mob/living/simple_animal/SA = L
if(SA.mob_size > MOB_SIZE_TINY) if(SA.mob_size > MOB_SIZE_TINY)
snap = 1 snap = 1
if(L.movement_type & FLYING) if(L.movement_type & FLYING)
snap = 0 snap = 0
if(snap) if(snap)
armed = 0 armed = 0
icon_state = "[initial(icon_state)][armed]" icon_state = "[initial(icon_state)][armed]"
playsound(src.loc, 'sound/effects/snap.ogg', 50, 1) playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
L.visible_message("<span class='danger'>[L] triggers \the [src].</span>", \ L.visible_message("<span class='danger'>[L] triggers \the [src].</span>", \
"<span class='userdanger'>You trigger \the [src]!</span>") "<span class='userdanger'>You trigger \the [src]!</span>")
L.apply_damage(trap_damage,BRUTE, def_zone) L.apply_damage(trap_damage,BRUTE, def_zone)
..() ..()
/obj/item/restraints/legcuffs/beartrap/energy /obj/item/restraints/legcuffs/beartrap/energy
name = "energy snare" name = "energy snare"
armed = 1 armed = 1
icon_state = "e_snare" icon_state = "e_snare"
trap_damage = 0 trap_damage = 0
flags_1 = DROPDEL_1 flags_1 = DROPDEL_1
/obj/item/restraints/legcuffs/beartrap/energy/New() /obj/item/restraints/legcuffs/beartrap/energy/New()
..() ..()
addtimer(CALLBACK(src, .proc/dissipate), 100) addtimer(CALLBACK(src, .proc/dissipate), 100)
/obj/item/restraints/legcuffs/beartrap/energy/proc/dissipate() /obj/item/restraints/legcuffs/beartrap/energy/proc/dissipate()
if(!ismob(loc)) if(!ismob(loc))
do_sparks(1, TRUE, src) do_sparks(1, TRUE, src)
qdel(src) qdel(src)
/obj/item/restraints/legcuffs/beartrap/energy/attack_hand(mob/user) /obj/item/restraints/legcuffs/beartrap/energy/attack_hand(mob/user)
Crossed(user) //honk Crossed(user) //honk
/obj/item/restraints/legcuffs/beartrap/energy/cyborg /obj/item/restraints/legcuffs/beartrap/energy/cyborg
breakouttime = 20 // Cyborgs shouldn't have a strong restraint breakouttime = 20 // Cyborgs shouldn't have a strong restraint
/obj/item/restraints/legcuffs/bola /obj/item/restraints/legcuffs/bola
name = "bola" name = "bola"
desc = "A restraining device designed to be thrown at the target. Upon connecting with said target, it will wrap around their legs, making it difficult for them to move quickly." desc = "A restraining device designed to be thrown at the target. Upon connecting with said target, it will wrap around their legs, making it difficult for them to move quickly."
icon_state = "bola" icon_state = "bola"
breakouttime = 35//easy to apply, easy to break out of breakouttime = 35//easy to apply, easy to break out of
gender = NEUTER gender = NEUTER
origin_tech = "engineering=3;combat=1" origin_tech = "engineering=3;combat=1"
var/knockdown = 0 var/knockdown = 0
/obj/item/restraints/legcuffs/bola/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback) /obj/item/restraints/legcuffs/bola/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
if(!..()) if(!..())
return return
playsound(src.loc,'sound/weapons/bolathrow.ogg', 75, 1) playsound(src.loc,'sound/weapons/bolathrow.ogg', 75, 1)
/obj/item/restraints/legcuffs/bola/throw_impact(atom/hit_atom) /obj/item/restraints/legcuffs/bola/throw_impact(atom/hit_atom)
if(..() || !iscarbon(hit_atom))//if it gets caught or the target can't be cuffed, if(..() || !iscarbon(hit_atom))//if it gets caught or the target can't be cuffed,
return//abort return//abort
var/mob/living/carbon/C = hit_atom var/mob/living/carbon/C = hit_atom
if(!C.legcuffed && C.get_num_legs() >= 2) if(!C.legcuffed && C.get_num_legs() >= 2)
visible_message("<span class='danger'>\The [src] ensnares [C]!</span>") visible_message("<span class='danger'>\The [src] ensnares [C]!</span>")
C.legcuffed = src C.legcuffed = src
src.loc = C src.loc = C
C.update_inv_legcuffed() C.update_inv_legcuffed()
SSblackbox.add_details("handcuffs","[type]") SSblackbox.add_details("handcuffs","[type]")
to_chat(C, "<span class='userdanger'>\The [src] ensnares you!</span>") to_chat(C, "<span class='userdanger'>\The [src] ensnares you!</span>")
C.Knockdown(knockdown) C.Knockdown(knockdown)
/obj/item/restraints/legcuffs/bola/tactical//traitor variant /obj/item/restraints/legcuffs/bola/tactical//traitor variant
name = "reinforced bola" name = "reinforced bola"
desc = "A strong bola, made with a long steel chain. It looks heavy, enough so that it could trip somebody." desc = "A strong bola, made with a long steel chain. It looks heavy, enough so that it could trip somebody."
icon_state = "bola_r" icon_state = "bola_r"
breakouttime = 70 breakouttime = 70
origin_tech = "engineering=4;combat=3" origin_tech = "engineering=4;combat=3"
knockdown = 20 knockdown = 20
/obj/item/restraints/legcuffs/bola/energy //For Security /obj/item/restraints/legcuffs/bola/energy //For Security
name = "energy bola" name = "energy bola"
desc = "A specialized hard-light bola designed to ensnare fleeing criminals and aid in arrests." desc = "A specialized hard-light bola designed to ensnare fleeing criminals and aid in arrests."
icon_state = "ebola" icon_state = "ebola"
hitsound = 'sound/weapons/taserhit.ogg' hitsound = 'sound/weapons/taserhit.ogg'
w_class = WEIGHT_CLASS_SMALL w_class = WEIGHT_CLASS_SMALL
breakouttime = 60 breakouttime = 60
/obj/item/restraints/legcuffs/bola/energy/throw_impact(atom/hit_atom) /obj/item/restraints/legcuffs/bola/energy/throw_impact(atom/hit_atom)
if(iscarbon(hit_atom)) if(iscarbon(hit_atom))
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(hit_atom)) var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(hit_atom))
B.Crossed(hit_atom) B.Crossed(hit_atom)
qdel(src) qdel(src)
..() ..()
+3 -3
View File
@@ -233,7 +233,7 @@
/obj/item/melee/supermatter_sword/afterattack(target, mob/user, proximity_flag) /obj/item/melee/supermatter_sword/afterattack(target, mob/user, proximity_flag)
if(user && target == user) if(user && target == user)
user.drop_item() user.dropItemToGround(src)
if(proximity_flag) if(proximity_flag)
consume_everything(target) consume_everything(target)
..() ..()
@@ -243,7 +243,7 @@
if(ismob(target)) if(ismob(target))
var/mob/M var/mob/M
if(src.loc == M) if(src.loc == M)
M.drop_item() M.dropItemToGround(src)
consume_everything(target) consume_everything(target)
/obj/item/melee/supermatter_sword/pickup(user) /obj/item/melee/supermatter_sword/pickup(user)
@@ -267,7 +267,7 @@
/obj/item/melee/supermatter_sword/suicide_act(mob/user) /obj/item/melee/supermatter_sword/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] touches [src]'s blade. It looks like [user.p_theyre()] tired of waiting for the radiation to kill [user.p_them()]!</span>") user.visible_message("<span class='suicide'>[user] touches [src]'s blade. It looks like [user.p_theyre()] tired of waiting for the radiation to kill [user.p_them()]!</span>")
user.drop_item() user.dropItemToGround(src, TRUE)
shard.CollidedWith(user) shard.CollidedWith(user)
/obj/item/melee/supermatter_sword/proc/consume_everything(target) /obj/item/melee/supermatter_sword/proc/consume_everything(target)
+13 -14
View File
@@ -1,14 +1,13 @@
/obj/item/pai_cable /obj/item/pai_cable
desc = "A flexible coated cable with a universal jack on one end." desc = "A flexible coated cable with a universal jack on one end."
name = "data cable" name = "data cable"
icon = 'icons/obj/power.dmi' icon = 'icons/obj/power.dmi'
icon_state = "wire1" icon_state = "wire1"
flags_1 = NOBLUDGEON_1 flags_1 = NOBLUDGEON_1
var/obj/machinery/machine var/obj/machinery/machine
/obj/item/pai_cable/proc/plugin(obj/machinery/M, mob/living/user) /obj/item/pai_cable/proc/plugin(obj/machinery/M, mob/living/user)
if(!user.drop_item()) if(!user.transferItemToLoc(src, M))
return return
user.visible_message("[user] inserts [src] into a data port on [M].", "<span class='notice'>You insert [src] into a data port on [M].</span>", "<span class='italics'>You hear the satisfying click of a wire jack fastening into place.</span>") user.visible_message("[user] inserts [src] into a data port on [M].", "<span class='notice'>You insert [src] into a data port on [M].</span>", "<span class='italics'>You hear the satisfying click of a wire jack fastening into place.</span>")
src.loc = M machine = M
machine = M
+1 -1
View File
@@ -122,7 +122,7 @@
return return
if(user.disabilities & CLUMSY && prob(75) && clumsyCheck) if(user.disabilities & CLUMSY && prob(75) && clumsyCheck)
user.visible_message("<span class='warning'>[user] loses their grip on [src], causing it to go off!</span>", "<span class='userdanger'>[src] slips out of your hands and goes off!</span>") user.visible_message("<span class='warning'>[user] loses their grip on [src], causing it to go off!</span>", "<span class='userdanger'>[src] slips out of your hands and goes off!</span>")
user.drop_item() user.dropItemToGround(src, TRUE)
if(prob(10)) if(prob(10))
target = get_turf(user) target = get_turf(user)
else else
+1 -1
View File
@@ -254,7 +254,7 @@
if(!isturf(loc)) if(!isturf(loc))
to_chat(user, "<span class='warning'>You cannot install[M], the frame has to be standing on the ground to be perfectly precise!</span>") to_chat(user, "<span class='warning'>You cannot install[M], the frame has to be standing on the ground to be perfectly precise!</span>")
return return
if(!user.drop_item()) if(!user.temporarilyRemoveItemFromInventory(M))
to_chat(user, "<span class='warning'>[M] is stuck to your hand!</span>") to_chat(user, "<span class='warning'>[M] is stuck to your hand!</span>")
return return
qdel(M) qdel(M)
+3 -3
View File
@@ -7,7 +7,7 @@
/obj/item/stack/wrapping_paper /obj/item/stack/wrapping_paper
name = "wrapping paper" name = "wrapping paper"
desc = "Wrap packages with this festive paper to make gifts." desc = "Wrap packages with this festive paper to make gifts."
icon = 'icons/obj/items_and_weapons.dmi' icon = 'icons/obj/stack_objects.dmi'
icon_state = "wrap_paper" icon_state = "wrap_paper"
flags_1 = NOBLUDGEON_1 flags_1 = NOBLUDGEON_1
amount = 25 amount = 25
@@ -28,7 +28,7 @@
/obj/item/stack/packageWrap /obj/item/stack/packageWrap
name = "package wrapper" name = "package wrapper"
desc = "You can use this to wrap items in." desc = "You can use this to wrap items in."
icon = 'icons/obj/items_and_weapons.dmi' icon = 'icons/obj/stack_objects.dmi'
icon_state = "deliveryPaper" icon_state = "deliveryPaper"
flags_1 = NOBLUDGEON_1 flags_1 = NOBLUDGEON_1
amount = 25 amount = 25
@@ -109,7 +109,7 @@
/obj/item/c_tube /obj/item/c_tube
name = "cardboard tube" name = "cardboard tube"
desc = "A tube... of cardboard." desc = "A tube... of cardboard."
icon = 'icons/obj/items_and_weapons.dmi' icon = 'icons/obj/stack_objects.dmi'
icon_state = "c_tube" icon_state = "c_tube"
throwforce = 0 throwforce = 0
w_class = WEIGHT_CLASS_TINY w_class = WEIGHT_CLASS_TINY
+1 -1
View File
@@ -48,7 +48,7 @@
/obj/item/storage/backpack/holding/suicide_act(mob/living/user) /obj/item/storage/backpack/holding/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] is jumping into [src]! It looks like [user.p_theyre()] trying to commit suicide.</span>") user.visible_message("<span class='suicide'>[user] is jumping into [src]! It looks like [user.p_theyre()] trying to commit suicide.</span>")
user.drop_item() user.dropItemToGround(src, TRUE)
user.Stun(100, ignore_canstun = TRUE) user.Stun(100, ignore_canstun = TRUE)
sleep(20) sleep(20)
playsound(src, "rustle", 50, 1, -5) playsound(src, "rustle", 50, 1, -5)
+2 -4
View File
@@ -57,11 +57,9 @@
close_all() close_all()
to_chat(user, "<span class='notice'>You fold [src] flat.</span>") to_chat(user, "<span class='notice'>You fold [src] flat.</span>")
var/obj/item/I = new foldable(get_turf(src)) var/obj/item/I = new foldable
user.drop_item()
user.put_in_hands(I)
user.update_inv_hands()
qdel(src) qdel(src)
user.put_in_hands(I)
/obj/item/storage/box/attackby(obj/item/W, mob/user, params) /obj/item/storage/box/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stack/packageWrap)) if(istype(W, /obj/item/stack/packageWrap))
+3 -1
View File
@@ -58,7 +58,9 @@
/obj/item/storage/fancy/remove_from_storage(obj/item/W, atom/new_location, burn = 0) /obj/item/storage/fancy/remove_from_storage(obj/item/W, atom/new_location, burn = 0)
fancy_open = TRUE fancy_open = TRUE
return ..() . = ..()
//Recall update icon with the fancy item snowflake arg (ugh)
update_icon(1)
/* /*
* Donut Box * Donut Box
+24 -16
View File
@@ -359,35 +359,43 @@
return 1 return 1
//Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target //Call this proc to handle the removal of an item from the storage item. The item will be moved to the new_location target, if that is null it's being deleted
/obj/item/storage/proc/remove_from_storage(obj/item/W, atom/new_location) /obj/item/storage/proc/remove_from_storage(obj/item/W, atom/new_location)
if(!istype(W)) if(!istype(W))
return 0 return 0
if(istype(src, /obj/item/storage/fancy)) //Cache this as it should be reusable down the bottom, will not apply if anyone adds a sleep to dropped
var/obj/item/storage/fancy/F = src //or moving objects, things that should never happen
F.update_icon(1) var/list/seeing_mobs = can_see_contents()
for(var/mob/M in seeing_mobs)
for(var/mob/M in can_see_contents()) M.client.screen -= W
if(M.client)
M.client.screen -= W
if(ismob(loc)) if(ismob(loc))
var/mob/M = loc var/mob/M = loc
W.dropped(M) W.dropped(M)
W.layer = initial(W.layer)
W.plane = initial(W.plane)
W.forceMove(new_location)
for(var/mob/M in can_see_contents()) if(new_location)
W.forceMove(new_location)
//Reset the items values
W.layer = initial(W.layer)
W.plane = initial(W.plane)
W.mouse_opacity = initial(W.mouse_opacity)
if(W.maptext)
W.maptext = ""
//We don't want to call this if the item is being destroyed
W.on_exit_storage(src)
else
//Being destroyed, just move to nullspace now (so it's not in contents for the icon update)
W.moveToNullspace()
for(var/mob/M in seeing_mobs)
orient2hud(M) orient2hud(M)
show_to(M) show_to(M)
if(W.maptext)
W.maptext = ""
W.on_exit_storage(src)
update_icon() update_icon()
W.mouse_opacity = initial(W.mouse_opacity)
return 1 return 1
/obj/item/storage/deconstruct(disassembled = TRUE) /obj/item/storage/deconstruct(disassembled = TRUE)
+211 -211
View File
@@ -1,211 +1,211 @@
/obj/item/tank/jetpack /obj/item/tank/jetpack
name = "jetpack (empty)" name = "jetpack (empty)"
desc = "A tank of compressed gas for use as propulsion in zero-gravity areas. Use with caution." desc = "A tank of compressed gas for use as propulsion in zero-gravity areas. Use with caution."
icon_state = "jetpack" icon_state = "jetpack"
item_state = "jetpack" item_state = "jetpack"
lefthand_file = 'icons/mob/inhands/equipment/jetpacks_lefthand.dmi' lefthand_file = 'icons/mob/inhands/equipment/jetpacks_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/jetpacks_righthand.dmi' righthand_file = 'icons/mob/inhands/equipment/jetpacks_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY w_class = WEIGHT_CLASS_BULKY
distribute_pressure = ONE_ATMOSPHERE * O2STANDARD distribute_pressure = ONE_ATMOSPHERE * O2STANDARD
actions_types = list(/datum/action/item_action/set_internals, /datum/action/item_action/toggle_jetpack, /datum/action/item_action/jetpack_stabilization) actions_types = list(/datum/action/item_action/set_internals, /datum/action/item_action/toggle_jetpack, /datum/action/item_action/jetpack_stabilization)
var/gas_type = "o2" var/gas_type = "o2"
var/on = FALSE var/on = FALSE
var/stabilizers = FALSE var/stabilizers = FALSE
var/full_speed = TRUE // If the jetpack will have a speedboost in space/nograv or not var/full_speed = TRUE // If the jetpack will have a speedboost in space/nograv or not
var/datum/effect_system/trail_follow/ion/ion_trail var/datum/effect_system/trail_follow/ion/ion_trail
/obj/item/tank/jetpack/New() /obj/item/tank/jetpack/New()
..() ..()
if(gas_type) if(gas_type)
air_contents.assert_gas(gas_type) ASSERT_GAS(gas_type,air_contents)
air_contents.gases[gas_type][MOLES] = (6 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C) air_contents.gases[gas_type][MOLES] = (6 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C)
ion_trail = new ion_trail = new
ion_trail.set_up(src) ion_trail.set_up(src)
/obj/item/tank/jetpack/ui_action_click(mob/user, action) /obj/item/tank/jetpack/ui_action_click(mob/user, action)
if(istype(action, /datum/action/item_action/toggle_jetpack)) if(istype(action, /datum/action/item_action/toggle_jetpack))
cycle(user) cycle(user)
else if(istype(action, /datum/action/item_action/jetpack_stabilization)) else if(istype(action, /datum/action/item_action/jetpack_stabilization))
if(on) if(on)
stabilizers = !stabilizers stabilizers = !stabilizers
to_chat(user, "<span class='notice'>You turn the jetpack stabilization [stabilizers ? "on" : "off"].</span>") to_chat(user, "<span class='notice'>You turn the jetpack stabilization [stabilizers ? "on" : "off"].</span>")
else else
toggle_internals(user) toggle_internals(user)
/obj/item/tank/jetpack/proc/cycle(mob/user) /obj/item/tank/jetpack/proc/cycle(mob/user)
if(user.incapacitated()) if(user.incapacitated())
return return
if(!on) if(!on)
turn_on() turn_on()
to_chat(user, "<span class='notice'>You turn the jetpack on.</span>") to_chat(user, "<span class='notice'>You turn the jetpack on.</span>")
else else
turn_off() turn_off()
to_chat(user, "<span class='notice'>You turn the jetpack off.</span>") to_chat(user, "<span class='notice'>You turn the jetpack off.</span>")
for(var/X in actions) for(var/X in actions)
var/datum/action/A = X var/datum/action/A = X
A.UpdateButtonIcon() A.UpdateButtonIcon()
/obj/item/tank/jetpack/proc/turn_on() /obj/item/tank/jetpack/proc/turn_on()
on = TRUE on = TRUE
icon_state = "[initial(icon_state)]-on" icon_state = "[initial(icon_state)]-on"
ion_trail.start() ion_trail.start()
/obj/item/tank/jetpack/proc/turn_off() /obj/item/tank/jetpack/proc/turn_off()
on = FALSE on = FALSE
stabilizers = FALSE stabilizers = FALSE
icon_state = initial(icon_state) icon_state = initial(icon_state)
ion_trail.stop() ion_trail.stop()
/obj/item/tank/jetpack/proc/allow_thrust(num, mob/living/user) /obj/item/tank/jetpack/proc/allow_thrust(num, mob/living/user)
if(!on) if(!on)
return return
if((num < 0.005 || air_contents.total_moles() < num)) if((num < 0.005 || air_contents.total_moles() < num))
turn_off() turn_off()
return return
var/datum/gas_mixture/removed = air_contents.remove(num) var/datum/gas_mixture/removed = air_contents.remove(num)
if(removed.total_moles() < 0.005) if(removed.total_moles() < 0.005)
turn_off() turn_off()
return return
var/turf/T = get_turf(user) var/turf/T = get_turf(user)
T.assume_air(removed) T.assume_air(removed)
return 1 return 1
/obj/item/tank/jetpack/suicide_act(mob/user) /obj/item/tank/jetpack/suicide_act(mob/user)
if (istype(user, /mob/living/carbon/human/)) if (istype(user, /mob/living/carbon/human/))
var/mob/living/carbon/human/H = user var/mob/living/carbon/human/H = user
H.forcesay("WHAT THE FUCK IS CARBON DIOXIDE?") H.forcesay("WHAT THE FUCK IS CARBON DIOXIDE?")
H.visible_message("<span class='suicide'>[user] is suffocating [user.p_them()]self with [src]! It looks like [user.p_they()] didn't read what that jetpack says!</span>") H.visible_message("<span class='suicide'>[user] is suffocating [user.p_them()]self with [src]! It looks like [user.p_they()] didn't read what that jetpack says!</span>")
return (OXYLOSS) return (OXYLOSS)
else else
..() ..()
/obj/item/tank/jetpack/void /obj/item/tank/jetpack/void
name = "void jetpack (oxygen)" name = "void jetpack (oxygen)"
desc = "It works well in a void." desc = "It works well in a void."
icon_state = "jetpack-void" icon_state = "jetpack-void"
item_state = "jetpack-void" item_state = "jetpack-void"
/obj/item/tank/jetpack/oxygen /obj/item/tank/jetpack/oxygen
name = "jetpack (oxygen)" name = "jetpack (oxygen)"
desc = "A tank of compressed oxygen for use as propulsion in zero-gravity areas. Use with caution." desc = "A tank of compressed oxygen for use as propulsion in zero-gravity areas. Use with caution."
icon_state = "jetpack" icon_state = "jetpack"
item_state = "jetpack" item_state = "jetpack"
/obj/item/tank/jetpack/oxygen/harness /obj/item/tank/jetpack/oxygen/harness
name = "jet harness (oxygen)" name = "jet harness (oxygen)"
desc = "A lightweight tactical harness, used by those who don't want to be weighed down by traditional jetpacks." desc = "A lightweight tactical harness, used by those who don't want to be weighed down by traditional jetpacks."
icon_state = "jetpack-mini" icon_state = "jetpack-mini"
item_state = "jetpack-mini" item_state = "jetpack-mini"
volume = 40 volume = 40
throw_range = 7 throw_range = 7
w_class = WEIGHT_CLASS_NORMAL w_class = WEIGHT_CLASS_NORMAL
/obj/item/tank/jetpack/oxygen/captain /obj/item/tank/jetpack/oxygen/captain
name = "\improper Captain's jetpack" name = "\improper Captain's jetpack"
desc = "A compact, lightweight jetpack containing a high amount of compressed oxygen." desc = "A compact, lightweight jetpack containing a high amount of compressed oxygen."
icon_state = "jetpack-captain" icon_state = "jetpack-captain"
item_state = "jetpack-captain" item_state = "jetpack-captain"
w_class = WEIGHT_CLASS_NORMAL w_class = WEIGHT_CLASS_NORMAL
volume = 90 volume = 90
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF //steal objective items are hard to destroy. resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF //steal objective items are hard to destroy.
/obj/item/tank/jetpack/oxygen/security /obj/item/tank/jetpack/oxygen/security
name = "security jetpack (oxygen)" name = "security jetpack (oxygen)"
desc = "A tank of compressed oxygen for use as propulsion in zero-gravity areas by security forces." desc = "A tank of compressed oxygen for use as propulsion in zero-gravity areas by security forces."
icon_state = "jetpack-sec" icon_state = "jetpack-sec"
item_state = "jetpack-sec" item_state = "jetpack-sec"
/obj/item/tank/jetpack/carbondioxide /obj/item/tank/jetpack/carbondioxide
name = "jetpack (carbon dioxide)" name = "jetpack (carbon dioxide)"
desc = "A tank of compressed carbon dioxide for use as propulsion in zero-gravity areas. Painted black to indicate that it should not be used as a source for internals." desc = "A tank of compressed carbon dioxide for use as propulsion in zero-gravity areas. Painted black to indicate that it should not be used as a source for internals."
icon_state = "jetpack-black" icon_state = "jetpack-black"
item_state = "jetpack-black" item_state = "jetpack-black"
distribute_pressure = 0 distribute_pressure = 0
gas_type = "co2" gas_type = "co2"
/obj/item/tank/jetpack/suit /obj/item/tank/jetpack/suit
name = "hardsuit jetpack upgrade" name = "hardsuit jetpack upgrade"
desc = "A modular, compact set of thrusters designed to integrate with a hardsuit. It is fueled by a tank inserted into the suit's storage compartment." desc = "A modular, compact set of thrusters designed to integrate with a hardsuit. It is fueled by a tank inserted into the suit's storage compartment."
origin_tech = "materials=4;magnets=4;engineering=5" origin_tech = "materials=4;magnets=4;engineering=5"
icon_state = "jetpack-mining" icon_state = "jetpack-mining"
item_state = "jetpack-black" item_state = "jetpack-black"
w_class = WEIGHT_CLASS_NORMAL w_class = WEIGHT_CLASS_NORMAL
actions_types = list(/datum/action/item_action/toggle_jetpack, /datum/action/item_action/jetpack_stabilization) actions_types = list(/datum/action/item_action/toggle_jetpack, /datum/action/item_action/jetpack_stabilization)
volume = 1 volume = 1
slot_flags = null slot_flags = null
gas_type = null gas_type = null
full_speed = FALSE full_speed = FALSE
var/datum/gas_mixture/temp_air_contents var/datum/gas_mixture/temp_air_contents
var/obj/item/tank/internals/tank = null var/obj/item/tank/internals/tank = null
/obj/item/tank/jetpack/suit/New() /obj/item/tank/jetpack/suit/New()
..() ..()
STOP_PROCESSING(SSobj, src) STOP_PROCESSING(SSobj, src)
temp_air_contents = air_contents temp_air_contents = air_contents
/obj/item/tank/jetpack/suit/attack_self() /obj/item/tank/jetpack/suit/attack_self()
return return
/obj/item/tank/jetpack/suit/cycle(mob/user) /obj/item/tank/jetpack/suit/cycle(mob/user)
if(!istype(loc, /obj/item/clothing/suit/space/hardsuit)) if(!istype(loc, /obj/item/clothing/suit/space/hardsuit))
to_chat(user, "<span class='warning'>\The [src] must be connected to a hardsuit!</span>") to_chat(user, "<span class='warning'>\The [src] must be connected to a hardsuit!</span>")
return return
var/mob/living/carbon/human/H = user var/mob/living/carbon/human/H = user
if(!istype(H.s_store, /obj/item/tank/internals)) if(!istype(H.s_store, /obj/item/tank/internals))
to_chat(user, "<span class='warning'>You need a tank in your suit storage!</span>") to_chat(user, "<span class='warning'>You need a tank in your suit storage!</span>")
return return
..() ..()
/obj/item/tank/jetpack/suit/turn_on() /obj/item/tank/jetpack/suit/turn_on()
if(!istype(loc, /obj/item/clothing/suit/space/hardsuit) || !ishuman(loc.loc)) if(!istype(loc, /obj/item/clothing/suit/space/hardsuit) || !ishuman(loc.loc))
return return
var/mob/living/carbon/human/H = loc.loc var/mob/living/carbon/human/H = loc.loc
tank = H.s_store tank = H.s_store
air_contents = tank.air_contents air_contents = tank.air_contents
START_PROCESSING(SSobj, src) START_PROCESSING(SSobj, src)
..() ..()
/obj/item/tank/jetpack/suit/turn_off() /obj/item/tank/jetpack/suit/turn_off()
tank = null tank = null
air_contents = temp_air_contents air_contents = temp_air_contents
STOP_PROCESSING(SSobj, src) STOP_PROCESSING(SSobj, src)
..() ..()
/obj/item/tank/jetpack/suit/process() /obj/item/tank/jetpack/suit/process()
if(!istype(loc, /obj/item/clothing/suit/space/hardsuit) || !ishuman(loc.loc)) if(!istype(loc, /obj/item/clothing/suit/space/hardsuit) || !ishuman(loc.loc))
turn_off() turn_off()
return return
var/mob/living/carbon/human/H = loc.loc var/mob/living/carbon/human/H = loc.loc
if(!tank || tank != H.s_store) if(!tank || tank != H.s_store)
turn_off() turn_off()
return return
..() ..()
//Return a jetpack that the mob can use //Return a jetpack that the mob can use
//Back worn jetpacks, hardsuit internal packs, and so on. //Back worn jetpacks, hardsuit internal packs, and so on.
//Used in Process_Spacemove() and wherever you want to check for/get a jetpack //Used in Process_Spacemove() and wherever you want to check for/get a jetpack
/mob/proc/get_jetpack() /mob/proc/get_jetpack()
return return
/mob/living/carbon/get_jetpack() /mob/living/carbon/get_jetpack()
var/obj/item/tank/jetpack/J = back var/obj/item/tank/jetpack/J = back
if(istype(J)) if(istype(J))
return J return J
/mob/living/carbon/human/get_jetpack() /mob/living/carbon/human/get_jetpack()
var/obj/item/tank/jetpack/J = ..() var/obj/item/tank/jetpack/J = ..()
if(!istype(J) && istype(wear_suit, /obj/item/clothing/suit/space/hardsuit)) if(!istype(J) && istype(wear_suit, /obj/item/clothing/suit/space/hardsuit))
var/obj/item/clothing/suit/space/hardsuit/C = wear_suit var/obj/item/clothing/suit/space/hardsuit/C = wear_suit
J = C.jetpack J = C.jetpack
return J return J
+7 -10
View File
@@ -21,7 +21,7 @@
/obj/item/tank/internals/oxygen/New() /obj/item/tank/internals/oxygen/New()
..() ..()
air_contents.assert_gas("o2") ASSERT_GAS("o2", air_contents)
air_contents.gases["o2"][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) air_contents.gases["o2"][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
return return
@@ -87,7 +87,7 @@
/obj/item/tank/internals/plasma/New() /obj/item/tank/internals/plasma/New()
..() ..()
air_contents.assert_gas("plasma") ASSERT_GAS("plasma", air_contents)
air_contents.gases["plasma"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) air_contents.gases["plasma"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
return return
@@ -105,8 +105,7 @@
return ..() return ..()
/obj/item/tank/internals/plasma/full/New() /obj/item/tank/internals/plasma/full/New()
..() ..() // Plasma asserted in parent
air_contents.assert_gas("plasma")
air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
return return
@@ -125,13 +124,12 @@
/obj/item/tank/internals/plasmaman/New() /obj/item/tank/internals/plasmaman/New()
..() ..()
air_contents.assert_gas("plasma") ASSERT_GAS("plasma", air_contents)
air_contents.gases["plasma"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) air_contents.gases["plasma"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
return return
/obj/item/tank/internals/plasmaman/full/New() /obj/item/tank/internals/plasmaman/full/New()
..() ..() // Plasma asserted in parent
air_contents.assert_gas("plasma")
air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
return return
@@ -145,8 +143,7 @@
w_class = WEIGHT_CLASS_SMALL //thanks i forgot this w_class = WEIGHT_CLASS_SMALL //thanks i forgot this
/obj/item/tank/internals/plasmaman/belt/full/New() /obj/item/tank/internals/plasmaman/belt/full/New()
..() ..() // Plasma asserted in parent
air_contents.assert_gas("plasma")
air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
return return
@@ -169,7 +166,7 @@
/obj/item/tank/internals/emergency_oxygen/New() /obj/item/tank/internals/emergency_oxygen/New()
..() ..()
air_contents.assert_gas("o2") ASSERT_GAS("o2", air_contents)
air_contents.gases["o2"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) air_contents.gases["o2"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
return return
+4 -4
View File
@@ -1022,8 +1022,8 @@
throwforce = 12 //pelt your enemies to death with lumps of snow throwforce = 12 //pelt your enemies to death with lumps of snow
/obj/item/toy/snowball/afterattack(atom/target as mob|obj|turf|area, mob/user) /obj/item/toy/snowball/afterattack(atom/target as mob|obj|turf|area, mob/user)
user.drop_item() if(user.dropItemToGround(src))
src.throw_at(target, throw_range, throw_speed) throw_at(target, throw_range, throw_speed)
/obj/item/toy/snowball/throw_impact(atom/hit_atom) /obj/item/toy/snowball/throw_impact(atom/hit_atom)
if(!..()) if(!..())
@@ -1041,8 +1041,8 @@
w_class = WEIGHT_CLASS_BULKY //Stops people from hiding it in their bags/pockets w_class = WEIGHT_CLASS_BULKY //Stops people from hiding it in their bags/pockets
/obj/item/toy/beach_ball/afterattack(atom/target as mob|obj|turf|area, mob/user) /obj/item/toy/beach_ball/afterattack(atom/target as mob|obj|turf|area, mob/user)
user.drop_item() if(user.dropItemToGround(src))
src.throw_at(target, throw_range, throw_speed) throw_at(target, throw_range, throw_speed)
/* /*
* Xenomorph action figure * Xenomorph action figure
+107 -107
View File
@@ -1,111 +1,111 @@
/obj/structure /obj/structure
icon = 'icons/obj/structures.dmi' icon = 'icons/obj/structures.dmi'
pressure_resistance = 8 pressure_resistance = 8
max_integrity = 300 max_integrity = 300
var/climb_time = 20 var/climb_time = 20
var/climb_stun = 20 var/climb_stun = 20
var/climbable = FALSE var/climbable = FALSE
var/mob/living/structureclimber var/mob/living/structureclimber
var/broken = 0 //similar to machinery's stat BROKEN var/broken = 0 //similar to machinery's stat BROKEN
/obj/structure/Initialize() /obj/structure/Initialize()
if (!armor) if (!armor)
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 50) armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 50)
. = ..() . = ..()
if(smooth) if(smooth)
queue_smooth(src) queue_smooth(src)
queue_smooth_neighbors(src) queue_smooth_neighbors(src)
icon_state = "" icon_state = ""
GLOB.cameranet.updateVisibility(src) GLOB.cameranet.updateVisibility(src)
/obj/structure/Destroy() /obj/structure/Destroy()
GLOB.cameranet.updateVisibility(src) GLOB.cameranet.updateVisibility(src)
if(smooth) if(smooth)
queue_smooth_neighbors(src) queue_smooth_neighbors(src)
return ..() return ..()
/obj/structure/attack_hand(mob/user) /obj/structure/attack_hand(mob/user)
. = ..() . = ..()
add_fingerprint(user) add_fingerprint(user)
if(structureclimber && structureclimber != user) if(structureclimber && structureclimber != user)
user.changeNext_move(CLICK_CD_MELEE) user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src) user.do_attack_animation(src)
structureclimber.Knockdown(40) structureclimber.Knockdown(40)
structureclimber.visible_message("<span class='warning'>[structureclimber.name] has been knocked off the [src]", "You're knocked off the [src]!", "You see [structureclimber.name] get knocked off the [src]</span>") structureclimber.visible_message("<span class='warning'>[structureclimber.name] has been knocked off the [src]", "You're knocked off the [src]!", "You see [structureclimber.name] get knocked off the [src]</span>")
interact(user) interact(user)
/obj/structure/interact(mob/user) /obj/structure/interact(mob/user)
ui_interact(user) ui_interact(user)
/obj/structure/ui_act(action, params) /obj/structure/ui_act(action, params)
..() ..()
add_fingerprint(usr) add_fingerprint(usr)
/obj/structure/MouseDrop_T(atom/movable/O, mob/user) /obj/structure/MouseDrop_T(atom/movable/O, mob/user)
. = ..() . = ..()
if(!climbable) if(!climbable)
return return
if(user == O && iscarbon(O)) if(user == O && iscarbon(O))
if(user.canmove) if(user.canmove)
climb_structure(user) climb_structure(user)
return return
if ((!( istype(O, /obj/item/weapon) ) || user.get_active_held_item() != O)) if ((!( istype(O, /obj/item) ) || user.get_active_held_item() != O))
return return
if(iscyborg(user)) if(iscyborg(user))
return return
if(!user.drop_item()) if(!user.drop_all_held_items())
return return
if (O.loc != src.loc) if (O.loc != src.loc)
step(O, get_dir(O, src)) step(O, get_dir(O, src))
return return
/obj/structure/proc/do_climb(atom/movable/A) /obj/structure/proc/do_climb(atom/movable/A)
if(climbable) if(climbable)
density = FALSE density = FALSE
. = step(A,get_dir(A,src.loc)) . = step(A,get_dir(A,src.loc))
density = TRUE density = TRUE
/obj/structure/proc/climb_structure(mob/living/user) /obj/structure/proc/climb_structure(mob/living/user)
src.add_fingerprint(user) src.add_fingerprint(user)
user.visible_message("<span class='warning'>[user] starts climbing onto [src].</span>", \ user.visible_message("<span class='warning'>[user] starts climbing onto [src].</span>", \
"<span class='notice'>You start climbing onto [src]...</span>") "<span class='notice'>You start climbing onto [src]...</span>")
var/adjusted_climb_time = climb_time var/adjusted_climb_time = climb_time
if(user.restrained()) //climbing takes twice as long when restrained. if(user.restrained()) //climbing takes twice as long when restrained.
adjusted_climb_time *= 2 adjusted_climb_time *= 2
if(isalien(user)) if(isalien(user))
adjusted_climb_time *= 0.25 //aliens are terrifyingly fast adjusted_climb_time *= 0.25 //aliens are terrifyingly fast
structureclimber = user structureclimber = user
if(do_mob(user, user, adjusted_climb_time)) if(do_mob(user, user, adjusted_climb_time))
if(src.loc) //Checking if structure has been destroyed if(src.loc) //Checking if structure has been destroyed
if(do_climb(user)) if(do_climb(user))
user.visible_message("<span class='warning'>[user] climbs onto [src].</span>", \ user.visible_message("<span class='warning'>[user] climbs onto [src].</span>", \
"<span class='notice'>You climb onto [src].</span>") "<span class='notice'>You climb onto [src].</span>")
add_logs(user, src, "climbed onto") add_logs(user, src, "climbed onto")
if(climb_stun) if(climb_stun)
user.Stun(climb_stun) user.Stun(climb_stun)
. = 1 . = 1
else else
to_chat(user, "<span class='warning'>You fail to climb onto [src].</span>") to_chat(user, "<span class='warning'>You fail to climb onto [src].</span>")
structureclimber = null structureclimber = null
/obj/structure/examine(mob/user) /obj/structure/examine(mob/user)
..() ..()
if(!(resistance_flags & INDESTRUCTIBLE)) if(!(resistance_flags & INDESTRUCTIBLE))
if(resistance_flags & ON_FIRE) if(resistance_flags & ON_FIRE)
to_chat(user, "<span class='warning'>It's on fire!</span>") to_chat(user, "<span class='warning'>It's on fire!</span>")
if(broken) if(broken)
to_chat(user, "<span class='notice'>It appears to be broken.</span>") to_chat(user, "<span class='notice'>It appears to be broken.</span>")
var/examine_status = examine_status(user) var/examine_status = examine_status(user)
if(examine_status) if(examine_status)
to_chat(user, examine_status) to_chat(user, examine_status)
/obj/structure/proc/examine_status(mob/user) //An overridable proc, mostly for falsewalls. /obj/structure/proc/examine_status(mob/user) //An overridable proc, mostly for falsewalls.
var/healthpercent = (obj_integrity/max_integrity) * 100 var/healthpercent = (obj_integrity/max_integrity) * 100
switch(healthpercent) switch(healthpercent)
if(50 to 99) if(50 to 99)
return "It looks slightly damaged." return "It looks slightly damaged."
if(25 to 50) if(25 to 50)
return "It appears heavily damaged." return "It appears heavily damaged."
if(0 to 25) if(0 to 25)
if(!broken) if(!broken)
return "<span class='warning'>It's falling apart!</span>" return "<span class='warning'>It's falling apart!</span>"
@@ -58,14 +58,14 @@
playsound(src.loc, W.usesound, 50, 1) playsound(src.loc, W.usesound, 50, 1)
deconstruct() deconstruct()
else if(istype(W, /obj/item/assembly/shock_kit)) else if(istype(W, /obj/item/assembly/shock_kit))
if(!user.drop_item()) if(!user.temporarilyRemoveItemFromInventory(W))
return return
var/obj/item/assembly/shock_kit/SK = W var/obj/item/assembly/shock_kit/SK = W
var/obj/structure/chair/e_chair/E = new /obj/structure/chair/e_chair(src.loc) var/obj/structure/chair/e_chair/E = new /obj/structure/chair/e_chair(src.loc)
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1) playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
E.setDir(dir) E.setDir(dir)
E.part = SK E.part = SK
SK.loc = E SK.forceMove(E)
SK.master = E SK.master = E
qdel(src) qdel(src)
else else
+4 -5
View File
@@ -27,7 +27,8 @@ LINEN BINS
..() ..()
/obj/item/bedsheet/attack_self(mob/user) /obj/item/bedsheet/attack_self(mob/user)
user.drop_item() if(!user.dropItemToGround(src))
return
if(layer == initial(layer)) if(layer == initial(layer))
layer = ABOVE_MOB_LAYER layer = ABOVE_MOB_LAYER
to_chat(user, "<span class='notice'>You cover yourself with [src].</span>") to_chat(user, "<span class='notice'>You cover yourself with [src].</span>")
@@ -275,18 +276,16 @@ LINEN BINS
/obj/structure/bedsheetbin/attackby(obj/item/I, mob/user, params) /obj/structure/bedsheetbin/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/bedsheet)) if(istype(I, /obj/item/bedsheet))
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
return return
I.loc = src
sheets.Add(I) sheets.Add(I)
amount++ amount++
to_chat(user, "<span class='notice'>You put [I] in [src].</span>") to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
update_icon() update_icon()
else if(amount && !hidden && I.w_class < WEIGHT_CLASS_BULKY) //make sure there's sheets to hide it among, make sure nothing else is hidden in there. else if(amount && !hidden && I.w_class < WEIGHT_CLASS_BULKY) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot hide it among the sheets!</span>") to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot hide it among the sheets!</span>")
return return
I.loc = src
hidden = I hidden = I
to_chat(user, "<span class='notice'>You hide [I] among the sheets.</span>") to_chat(user, "<span class='notice'>You hide [I] among the sheets.</span>")
@@ -229,8 +229,7 @@
"<span class='notice'>You cut \the [src] apart with \the [W].</span>") "<span class='notice'>You cut \the [src] apart with \the [W].</span>")
deconstruct(TRUE) deconstruct(TRUE)
return 0 return 0
if(user.drop_item()) // so we put in unlit welder too if(user.transferItemToLoc(W, drop_location())) // so we put in unlit welder too
W.forceMove(loc)
return 1 return 1
else if(istype(W, /obj/item/weldingtool) && can_weld_shut) else if(istype(W, /obj/item/weldingtool) && can_weld_shut)
var/obj/item/weldingtool/WT = W var/obj/item/weldingtool/WT = W
@@ -602,10 +602,9 @@
if(do_after(user, 40, target = src)) if(do_after(user, 40, target = src))
if( src.state != 1 ) if( src.state != 1 )
return return
if(!user.drop_item()) if(!user.transferItemToLoc(W, src))
return return
W.loc = src
to_chat(user, "<span class='notice'>You install the airlock electronics.</span>") to_chat(user, "<span class='notice'>You install the airlock electronics.</span>")
src.state = 2 src.state = 2
src.name = "near finished airlock assembly" src.name = "near finished airlock assembly"
+1 -2
View File
@@ -54,9 +54,8 @@
return return
if(istype(I, /obj/item/extinguisher)) if(istype(I, /obj/item/extinguisher))
if(!stored_extinguisher && opened) if(!stored_extinguisher && opened)
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
return return
contents += I
stored_extinguisher = I stored_extinguisher = I
to_chat(user, "<span class='notice'>You place [I] in [src].</span>") to_chat(user, "<span class='notice'>You place [I] in [src].</span>")
update_icon() update_icon()
+1 -2
View File
@@ -53,10 +53,9 @@
if(F.wielded) if(F.wielded)
to_chat(user, "<span class='warning'>Unwield the [F.name] first.</span>") to_chat(user, "<span class='warning'>Unwield the [F.name] first.</span>")
return return
if(!user.drop_item()) if(!user.transferItemToLoc(F, src))
return return
fireaxe = F fireaxe = F
F.forceMove(src)
to_chat(user, "<span class='caution'>You place the [F.name] back in the [name].</span>") to_chat(user, "<span class='caution'>You place the [F.name] back in the [name].</span>")
update_icon() update_icon()
return return
+1 -2
View File
@@ -259,9 +259,8 @@
else if(istype(W, /obj/item/pipe)) else if(istype(W, /obj/item/pipe))
var/obj/item/pipe/P = W var/obj/item/pipe/P = W
if (P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds. if (P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds.
if(!user.drop_item()) if(!user.transferItemToLoc(P, drop_location()))
return return
P.loc = src.loc
to_chat(user, "<span class='notice'>You fit the pipe into \the [src].</span>") to_chat(user, "<span class='notice'>You fit the pipe into \the [src].</span>")
else else
return ..() return ..()
+1 -2
View File
@@ -39,9 +39,8 @@
return return
if(istype(I, gun_category) && open) if(istype(I, gun_category) && open)
if(LAZYLEN(contents) < capacity) if(LAZYLEN(contents) < capacity)
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
return return
I.forceMove(src)
to_chat(user, "<span class='notice'>You place [I] in [src].</span>") to_chat(user, "<span class='notice'>You place [I] in [src].</span>")
update_icon() update_icon()
else else
+1 -2
View File
@@ -32,9 +32,8 @@
return 1 return 1
/obj/structure/janitorialcart/proc/put_in_cart(obj/item/I, mob/user) /obj/structure/janitorialcart/proc/put_in_cart(obj/item/I, mob/user)
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
return return
I.loc = src
updateUsrDialog() updateUsrDialog()
to_chat(user, "<span class='notice'>You put [I] into [src].</span>") to_chat(user, "<span class='notice'>You put [I] into [src].</span>")
return return
+1 -2
View File
@@ -159,10 +159,9 @@ FLOOR SAFES
. = 1 //no afterattack . = 1 //no afterattack
if(I.w_class + space <= maxspace) if(I.w_class + space <= maxspace)
space += I.w_class space += I.w_class
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot put it in the safe!</span>") to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot put it in the safe!</span>")
return return
I.forceMove(src)
to_chat(user, "<span class='notice'>You put [I] in [src].</span>") to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
updateUsrDialog() updateUsrDialog()
return return
-1
View File
@@ -104,7 +104,6 @@
"<span class='notice'>You attach the sign to [T].</span>") "<span class='notice'>You attach the sign to [T].</span>")
playsound(T, 'sound/items/deconstruct.ogg', 50, 1) playsound(T, 'sound/items/deconstruct.ogg', 50, 1)
new sign_path(T) new sign_path(T)
user.drop_item()
qdel(src) qdel(src)
else else
return ..() return ..()
+4 -6
View File
@@ -131,8 +131,7 @@
// If the tray IS empty, continue on (tray will be placed on the table like other items) // If the tray IS empty, continue on (tray will be placed on the table like other items)
if(user.a_intent != INTENT_HARM && !(I.flags_1 & ABSTRACT_1)) if(user.a_intent != INTENT_HARM && !(I.flags_1 & ABSTRACT_1))
if(user.drop_item()) if(user.transferItemToLoc(I, drop_location()))
I.Move(loc)
var/list/click_params = params2list(params) var/list/click_params = params2list(params)
//Center the icon where the user clicked. //Center the icon where the user clicked.
if(!click_params || !click_params["icon-x"] || !click_params["icon-y"]) if(!click_params || !click_params["icon-x"] || !click_params["icon-y"])
@@ -439,7 +438,7 @@
/obj/structure/rack/MouseDrop_T(obj/O, mob/user) /obj/structure/rack/MouseDrop_T(obj/O, mob/user)
if ((!( istype(O, /obj/item) ) || user.get_active_held_item() != O)) if ((!( istype(O, /obj/item) ) || user.get_active_held_item() != O))
return return
if(!user.drop_item()) if(!user.dropItemToGround(O))
return return
if(O.loc != src.loc) if(O.loc != src.loc)
step(O, get_dir(O, src)) step(O, get_dir(O, src))
@@ -452,8 +451,7 @@
return return
if(user.a_intent == INTENT_HARM) if(user.a_intent == INTENT_HARM)
return ..() return ..()
if(user.drop_item()) if(user.transferItemToLoc(W, drop_location()))
W.Move(loc)
return 1 return 1
/obj/structure/rack/attack_paw(mob/living/user) /obj/structure/rack/attack_paw(mob/living/user)
@@ -516,7 +514,7 @@
building = TRUE building = TRUE
to_chat(user, "<span class='notice'>You start constructing a rack...</span>") to_chat(user, "<span class='notice'>You start constructing a rack...</span>")
if(do_after(user, 50, target = user, progress=TRUE)) if(do_after(user, 50, target = user, progress=TRUE))
if(!user.drop_item()) if(!user.temporarilyRemoveItemFromInventory(src))
return return
var/obj/structure/rack/R = new /obj/structure/rack(user.loc) var/obj/structure/rack/R = new /obj/structure/rack(user.loc)
user.visible_message("<span class='notice'>[user] assembles \a [R].\ user.visible_message("<span class='notice'>[user] assembles \a [R].\
@@ -62,9 +62,8 @@
to_chat(user, "<span class='notice'>[src] can't hold any more of [I].</span>") to_chat(user, "<span class='notice'>[src] can't hold any more of [I].</span>")
return return
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
return return
I.loc = src
to_chat(user, "<span class='notice'>You put [I] in [src].</span>") to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
update_icon() update_icon()
+51 -52
View File
@@ -1,55 +1,54 @@
/obj/structure/target_stake /obj/structure/target_stake
name = "target stake" name = "target stake"
desc = "A thin platform with negatively-magnetized wheels." desc = "A thin platform with negatively-magnetized wheels."
icon = 'icons/obj/objects.dmi' icon = 'icons/obj/objects.dmi'
icon_state = "target_stake" icon_state = "target_stake"
density = TRUE density = TRUE
flags_1 = CONDUCT_1 flags_1 = CONDUCT_1
var/obj/item/target/pinned_target var/obj/item/target/pinned_target
/obj/structure/target_stake/Destroy() /obj/structure/target_stake/Destroy()
if(pinned_target) if(pinned_target)
pinned_target.nullPinnedLoc() pinned_target.nullPinnedLoc()
return ..() return ..()
/obj/structure/target_stake/proc/nullPinnedTarget() /obj/structure/target_stake/proc/nullPinnedTarget()
pinned_target = null pinned_target = null
/obj/structure/target_stake/Move() /obj/structure/target_stake/Move()
..() ..()
if(pinned_target) if(pinned_target)
pinned_target.loc = loc pinned_target.loc = loc
/obj/structure/target_stake/attackby(obj/item/target/T, mob/user) /obj/structure/target_stake/attackby(obj/item/target/T, mob/user)
if(pinned_target) if(pinned_target)
return return
if(istype(T) && user.drop_item()) if(istype(T) && user.transferItemToLoc(T, drop_location()))
pinned_target = T pinned_target = T
T.pinnedLoc = src T.pinnedLoc = src
T.density = TRUE T.density = TRUE
T.layer = OBJ_LAYER + 0.01 T.layer = OBJ_LAYER + 0.01
T.loc = loc to_chat(user, "<span class='notice'>You slide the target into the stake.</span>")
to_chat(user, "<span class='notice'>You slide the target into the stake.</span>")
/obj/structure/target_stake/attack_hand(mob/user)
/obj/structure/target_stake/attack_hand(mob/user) if(pinned_target)
if(pinned_target) removeTarget(user)
removeTarget(user)
/obj/structure/target_stake/proc/removeTarget(mob/user)
/obj/structure/target_stake/proc/removeTarget(mob/user) pinned_target.layer = OBJ_LAYER
pinned_target.layer = OBJ_LAYER pinned_target.loc = user.loc
pinned_target.loc = user.loc pinned_target.nullPinnedLoc()
pinned_target.nullPinnedLoc() nullPinnedTarget()
nullPinnedTarget() if(ishuman(user))
if(ishuman(user)) if(!user.get_active_held_item())
if(!user.get_active_held_item()) user.put_in_hands(pinned_target)
user.put_in_hands(pinned_target) to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>") else
else pinned_target.loc = get_turf(user)
pinned_target.loc = get_turf(user) to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
/obj/structure/target_stake/bullet_act(obj/item/projectile/P)
/obj/structure/target_stake/bullet_act(obj/item/projectile/P) if(pinned_target)
if(pinned_target) pinned_target.bullet_act(P)
pinned_target.bullet_act(P) else
else ..()
..()
+2 -4
View File
@@ -88,10 +88,9 @@
if(w_items + I.w_class > WEIGHT_CLASS_HUGE) if(w_items + I.w_class > WEIGHT_CLASS_HUGE)
to_chat(user, "<span class='warning'>The cistern is full!</span>") to_chat(user, "<span class='warning'>The cistern is full!</span>")
return return
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot put it in the cistern!</span>") to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot put it in the cistern!</span>")
return return
I.loc = src
w_items += I.w_class w_items += I.w_class
to_chat(user, "<span class='notice'>You carefully place [I] into the cistern.</span>") to_chat(user, "<span class='notice'>You carefully place [I] into the cistern.</span>")
@@ -173,10 +172,9 @@
if(I.w_class > 1) if(I.w_class > 1)
to_chat(user, "<span class='warning'>[I] is too large for the drain enclosure.</span>") to_chat(user, "<span class='warning'>[I] is too large for the drain enclosure.</span>")
return return
if(!user.drop_item()) if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\[I] is stuck to your hand, you cannot put it in the drain enclosure!</span>") to_chat(user, "<span class='warning'>\[I] is stuck to your hand, you cannot put it in the drain enclosure!</span>")
return return
I.forceMove(src)
hiddenitem = I hiddenitem = I
to_chat(user, "<span class='notice'>You place [I] into the drain enclosure.</span>") to_chat(user, "<span class='notice'>You place [I] into the drain enclosure.</span>")
@@ -208,11 +208,10 @@
//Adding airlock electronics for access. Step 6 complete. //Adding airlock electronics for access. Step 6 complete.
else if(istype(W, /obj/item/electronics/airlock)) else if(istype(W, /obj/item/electronics/airlock))
if(!user.drop_item()) if(!user.transferItemToLoc(W, src))
return return
playsound(loc, W.usesound, 100, 1) playsound(loc, W.usesound, 100, 1)
user.visible_message("[user] installs the electronics into the airlock assembly.", "<span class='notice'>You start to install electronics into the airlock assembly...</span>") user.visible_message("[user] installs the electronics into the airlock assembly.", "<span class='notice'>You start to install electronics into the airlock assembly...</span>")
W.loc = src
if(do_after(user, 40, target = src)) if(do_after(user, 40, target = src))
if(!src || electronics) if(!src || electronics)
@@ -72,7 +72,7 @@
if(..()) if(..())
return return
if(istype(C, /obj/item/light/bulb)) //only for light tiles if(istype(C, /obj/item/light/bulb)) //only for light tiles
if(state && user.drop_item()) if(state && user.temporarilyRemoveItemFromInventory(C))
qdel(C) qdel(C)
state = 0 //fixing it by bashing it with a light bulb, fun eh? state = 0 //fixing it by bashing it with a light bulb, fun eh?
update_icon() update_icon()

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