diff --git a/code/__DEFINES/mob.dm b/code/__DEFINES/mob.dm index cab30ebe8de..5442c621e1b 100644 --- a/code/__DEFINES/mob.dm +++ b/code/__DEFINES/mob.dm @@ -100,4 +100,9 @@ // AI wire/radio settings #define AI_CHECK_WIRELESS 1 -#define AI_CHECK_RADIO 2 \ No newline at end of file +#define AI_CHECK_RADIO 2 + +#define POCKET_STRIP_DELAY 40 //time taken (in deciseconds) to search somebody's pockets + +#define DEFAULT_ITEM_STRIP_DELAY 40 //time taken (in deciseconds) to strip somebody +#define DEFAULT_ITEM_PUTON_DELAY 20 //time taken (in deciseconsd) to reverse-strip somebody \ No newline at end of file diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 14e5c7f06c0..8f2cb283829 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -438,7 +438,7 @@ if("Allow Item Use") if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return - if(!istype(usr.equipped(),/obj/item/weapon/gun)) + if(!istype(usr.get_active_hand(), /obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return usr.client.AllowTargetClick() @@ -448,7 +448,7 @@ if("Disallow Item Use") if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return - if(!istype(usr.equipped(),/obj/item/weapon/gun)) + if(!istype(usr.get_active_hand(), /obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return usr.client.AllowTargetClick() diff --git a/code/game/gamemodes/revolution/rp-revolution.dm b/code/game/gamemodes/revolution/rp-revolution.dm index 7e2b42461fe..b0c58fd8c5f 100644 --- a/code/game/gamemodes/revolution/rp-revolution.dm +++ b/code/game/gamemodes/revolution/rp-revolution.dm @@ -158,9 +158,9 @@ // spawn (100) // if (rev_mob.r_store) -// rev_mob.equip_if_possible(new /obj/item/weapon/paper/communist_manifesto(rev_mob), rev_mob.slot_l_store) +// rev_mob.equip_or_collect(new /obj/item/weapon/paper/communist_manifesto(rev_mob), rev_mob.slot_l_store) // if (rev_mob.l_store) -// rev_mob.equip_if_possible(new /obj/item/weapon/paper/communist_manifesto(rev_mob), rev_mob.slot_r_store) +// rev_mob.equip_or_collect(new /obj/item/weapon/paper/communist_manifesto(rev_mob), rev_mob.slot_r_store) /datum/game_mode/rp_revolution/check_win() diff --git a/code/game/jobs/job/supervisor.dm b/code/game/jobs/job/supervisor.dm index e113e525c04..257f82dc3c0 100644 --- a/code/game/jobs/job/supervisor.dm +++ b/code/game/jobs/job/supervisor.dm @@ -129,9 +129,9 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) H.equip_or_collect(new /obj/item/weapon/melee/baton/loaded/ntcane(H.back), slot_in_backpack) H.equip_or_collect(new /obj/item/weapon/lighter/zippo/nt_rep(H.back), slot_in_backpack) - H.equip_if_possible(new /obj/item/clothing/under/rank/ntrep(H), slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/storage/ntrep(H), slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/shoes/centcom(H), slot_shoes) + H.equip_or_collect(new /obj/item/clothing/under/rank/ntrep(H), slot_w_uniform) + H.equip_or_collect(new /obj/item/clothing/suit/storage/ntrep(H), slot_wear_suit) + H.equip_or_collect(new /obj/item/clothing/shoes/centcom(H), slot_shoes) H.equip_or_collect(new /obj/item/device/pda/heads/ntrep(H), slot_wear_pda) var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) L.imp_in = H @@ -172,8 +172,8 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) H.equip_or_collect(new /obj/item/clothing/gloves/combat(H), slot_gloves) H.equip_or_collect(new /obj/item/clothing/shoes/jackboots(H), slot_shoes) H.equip_or_collect(new /obj/item/clothing/glasses/hud/health_advanced, slot_glasses) - H.equip_if_possible(new /obj/item/clothing/under/rank/blueshield(H), slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/armor/vest/blueshield(H), slot_wear_suit) + H.equip_or_collect(new /obj/item/clothing/under/rank/blueshield(H), slot_w_uniform) + H.equip_or_collect(new /obj/item/clothing/suit/armor/vest/blueshield(H), slot_wear_suit) H.equip_or_collect(new /obj/item/weapon/gun/energy/advtaser(H), slot_s_store) H.equip_or_collect(new /obj/item/device/pda/heads/blueshield(H), slot_wear_pda) if(H.backbag == 1) @@ -215,9 +215,9 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) if(4) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(H), slot_back) H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) - H.equip_if_possible(new /obj/item/clothing/under/suit_jacket/really_black(H), slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/judgerobe(H), slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/shoes/centcom(H), slot_shoes) + H.equip_or_collect(new /obj/item/clothing/under/suit_jacket/really_black(H), slot_w_uniform) + H.equip_or_collect(new /obj/item/clothing/suit/judgerobe(H), slot_wear_suit) + H.equip_or_collect(new /obj/item/clothing/shoes/centcom(H), slot_shoes) H.equip_or_collect(new /obj/item/clothing/head/powdered_wig(H), slot_head) H.equip_or_collect(new /obj/item/clothing/glasses/sunglasses/sechud(H), slot_glasses) H.equip_or_collect(new /obj/item/device/pda/heads/magistrate(H), slot_wear_pda) diff --git a/code/game/machinery/metaldetector.dm b/code/game/machinery/metaldetector.dm deleted file mode 100644 index 4cdb45507d4..00000000000 --- a/code/game/machinery/metaldetector.dm +++ /dev/null @@ -1,163 +0,0 @@ -/obj/machinery/metaldetector - name = "metal detector" - desc = "a metal detector. staff can toggle this between ignore security and detect all with their id." - anchored = 1.0 - density = 0 - icon = 'icons/obj/machines/metal_detector.dmi' - icon_state = "metaldetector0" - use_power = 1 - idle_power_usage = 20 - active_power_usage = 250 - var/guncount = 0 - var/knifecount = 0 - var/bombcount = 0 - var/meleecount = 0 - var/detectall = 0 - -/obj/machinery/metaldetector/check_access(obj/item/weapon/card/id/I, list/access_list) - if(!istype(access_list)) - return 1 - if(!access_list.len) //no requirements - return 1 - if(istype(I, /obj/item/device/pda)) - var/obj/item/device/pda/pda = I - I = pda.id - if(!istype(I) || !I.access) //not ID or no access - return 0 - return 1 - -/obj/machinery/metaldetector/attackby(obj/item/W as obj, mob/user as mob, params) - if(istype(W, /obj/item/weapon/card)) - for(var/ID in list(user.equipped(), user:wear_id, user:belt)) - if(src.check_access(ID,list("20"))) - if(!src.detectall) - src.detectall = 1 - user << "\blue You set the [src] to detect all personnel." - return - else - src.detectall = 0 - user << "\blue You set the [src] to ignore all staff and security." - return - else - user << "\red You lack access to the control panel!" - return - -/obj/machinery/metaldetector/emag_act(user as mob) - if(!emagged) - emagged = 1 - user << "\blue You short out the circuitry." - return - -/obj/machinery/metaldetector/Crossed(AM as mob|obj) - if(emagged) - return - if (istype(AM, /mob/living)) - var/mob/M = AM - if(!src.detectall) - if(M:wear_id || M:belt) - for(var/ID in list(M:equipped(), M:wear_id, M:belt)) - if(src.check_access(ID,list("1", "2", "3", "20", "57", "58"))) - return - if (istype(M, /mob/living)) - for(var/obj/item/weapon/gun/G in M) - guncount++ - for(var/obj/item/device/transfer_valve/B in M) - bombcount++ - for(var/obj/item/weapon/kitchen/utensil/knife/K in M) - knifecount++ - for(var/obj/item/weapon/kitchenknife/KK in M) - knifecount++ - for(var/obj/item/weapon/c4/KK in M) - bombcount++ - for(var/obj/item/weapon/melee/ML in M) - meleecount++ - if(guncount) - flick("metaldetector2",src) - playsound(src.loc, 'sound/effects/alert.ogg', 60, 0) - for (var/mob/O in viewers(O, null)) - O << "\red [src.name] beeps, \"Alert! Firearm found on [M.name]!\"" - - if(seen_by_camera(M)) - // determine the name of the perp (goes by ID if wearing one) - var/perpname = M.name - if(M:wear_id && M:wear_id.registered_name) - perpname = M:wear_id.registered_name - // find the matching security record - for(var/datum/data/record/R in data_core.general) - if(R.fields["name"] == perpname) - for (var/datum/data/record/S in data_core.security) - if (S.fields["id"] == R.fields["id"]) - // now add to rap sheet - S.fields["criminal"] = "*Arrest*" - S.fields["mi_crim"] = "Carrying a firearm." - break - - guncount = 0 - else if(knifecount) - flick("metaldetector2",src) - playsound(src.loc, 'sound/effects/alert.ogg', 60, 0) - for (var/mob/O in viewers(O, null)) - O << "\red [src.name] beeps, \"Alert! Knife found on [M.name]!\"" - - if(seen_by_camera(M)) - // determine the name of the perp (goes by ID if wearing one) - var/perpname = M.name - if(M:wear_id && M:wear_id.registered_name) - perpname = M:wear_id.registered_name - // find the matching security record - for(var/datum/data/record/R in data_core.general) - if(R.fields["name"] == perpname) - for (var/datum/data/record/S in data_core.security) - if (S.fields["id"] == R.fields["id"]) - // now add to rap sheet - S.fields["criminal"] = "*Arrest*" - S.fields["mi_crim"] = "Carrying a knife." - break - - knifecount = 0 - else if(bombcount) - flick("metaldetector2",src) - playsound(src.loc, 'sound/effects/alert.ogg', 60, 0) - for (var/mob/O in viewers(O, null)) - O << "\red [src.name] beeps, \"Alert! Bomb found on [M.name]!\"" - - if(seen_by_camera(M)) - // determine the name of the perp (goes by ID if wearing one) - var/perpname = M.name - if(M:wear_id && M:wear_id.registered_name) - perpname = M:wear_id.registered_name - // find the matching security record - for(var/datum/data/record/R in data_core.general) - if(R.fields["name"] == perpname) - for (var/datum/data/record/S in data_core.security) - if (S.fields["id"] == R.fields["id"]) - // now add to rap sheet - S.fields["criminal"] = "*Arrest*" - S.fields["mi_crim"] = "Carrying a bomb." - break - - bombcount = 0 - else if(meleecount) - flick("metaldetector2",src) - playsound(src.loc, 'sound/effects/alert.ogg', 60, 0) - for (var/mob/O in viewers(O, null)) - O << "\red [src.name] beeps, \"Alert! Melee weapon found on [M.name]!\"" - - if(seen_by_camera(M)) - // determine the name of the perp (goes by ID if wearing one) - var/perpname = M.name - if(M:wear_id && M:wear_id.registered_name) - perpname = M:wear_id.registered_name - // find the matching security record - for(var/datum/data/record/R in data_core.general) - if(R.fields["name"] == perpname) - for (var/datum/data/record/S in data_core.security) - if (S.fields["id"] == R.fields["id"]) - // now add to rap sheet - S.fields["criminal"] = "*Arrest*" - S.fields["mi_crim"] = "Carrying a weapon." - break - - meleecount = 0 - else - flick("metaldetector1",src) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 6d303aa8fd2..77ff6660206 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -8,12 +8,12 @@ var/item_state = null var/lefthand_file = 'icons/mob/inhands/items_lefthand.dmi' var/righthand_file = 'icons/mob/inhands/items_righthand.dmi' - + //Dimensions of the lefthand_file and righthand_file vars //eg: 32x32 sprite, 64x64 sprite, etc. var/inhand_x_dimension = 32 - var/inhand_y_dimension = 32 - + var/inhand_y_dimension = 32 + var/r_speed = 1.0 var/health = null var/hitsound = null @@ -49,6 +49,9 @@ var/list/allowed = null //suit storage stuff. var/obj/item/device/uplink/hidden/hidden_uplink = null // All items can have an uplink hidden inside, just remember to add the triggers. + var/strip_delay = DEFAULT_ITEM_STRIP_DELAY + var/put_on_delay = DEFAULT_ITEM_PUTON_DELAY + /* Species-specific sprites, concept stolen from Paradise//vg/. ex: sprite_sheets = list( @@ -298,245 +301,11 @@ //the mob M is attempting to equip this item into the slot passed through as 'slot'. Return 1 if it can do this and 0 if it can't. //If you are making custom procs but would like to retain partial or complete functionality of this one, include a 'return ..()' to where you want this to happen. //Set disable_warning to 1 if you wish it to not give you outputs. -/obj/item/proc/mob_can_equip(M as mob, slot, disable_warning = 0) - if(!slot) return 0 - if(!M) return 0 - if(issmall(M)) - //START MONKEY - var/mob/living/carbon/human/H = M - - switch(slot) - if(slot_l_hand) - if(H.l_hand) - return 0 - return 1 - if(slot_r_hand) - if(H.r_hand) - return 0 - return 1 - if(slot_wear_mask) - if(H.wear_mask) - return 0 - if( !(slot_flags & SLOT_MASK) ) - return 0 - return 1 - if(slot_back) - if(H.back) - return 0 - if( !(slot_flags & SLOT_BACK) ) - return 0 - return 1 - if(slot_handcuffed) - if(H.handcuffed) - return 0 - if(!istype(src, /obj/item/weapon/restraints/handcuffs)) - return 0 - return 1 - if(slot_in_backpack) - if (H.back && istype(H.back, /obj/item/weapon/storage/backpack)) - var/obj/item/weapon/storage/backpack/B = H.back - if(B.contents.len < B.storage_slots && w_class <= B.max_w_class) - return 1 - return 0 - return 0 //Unsupported slot - //END MONKEY - if(ishuman(M)) - //START HUMAN - var/mob/living/carbon/human/H = M - - - if(istype(src, /obj/item/clothing/under) || istype(src, /obj/item/clothing/suit)) - if(FAT in H.mutations) - //testing("[M] TOO FAT TO WEAR [src]!") - if(!(flags & ONESIZEFITSALL)) - if(!disable_warning) - H << "\red You're too fat to wear the [name]." - return 0 - - switch(slot) - if(slot_l_hand) - if(H.l_hand) - return 0 - return 1 - if(slot_r_hand) - if(H.r_hand) - return 0 - return 1 - if(slot_wear_mask) - if(H.wear_mask) - return 0 - if( !(slot_flags & SLOT_MASK) ) - return 0 - return 1 - if(slot_back) - if(H.back) - return 0 - if( !(slot_flags & SLOT_BACK) ) - return 0 - return 1 - if(slot_wear_suit) - if(H.wear_suit) - return 0 - if( !(slot_flags & SLOT_OCLOTHING) ) - return 0 - return 1 - if(slot_gloves) - if(H.gloves) - return 0 - if( !(slot_flags & SLOT_GLOVES) ) - return 0 - return 1 - if(slot_shoes) - if(H.shoes) - return 0 - if( !(slot_flags & SLOT_FEET) ) - return 0 - return 1 - if(slot_belt) - if(H.belt) - return 0 - if(!H.w_uniform) - if(!disable_warning) - H << "\red You need a jumpsuit before you can attach this [name]." - return 0 - if( !(slot_flags & SLOT_BELT) ) - return - return 1 - if(slot_glasses) - if(H.glasses) - return 0 - if( !(slot_flags & SLOT_EYES) ) - return 0 - return 1 - if(slot_head) - if(H.head) - return 0 - if( !(slot_flags & SLOT_HEAD) ) - return 0 - return 1 - if(slot_l_ear) - if(H.l_ear) - return 0 - if( !(slot_flags & SLOT_EARS) ) - return 0 - if( (slot_flags & SLOT_TWOEARS) && H.r_ear ) - return 0 - return 1 - if(slot_r_ear) - if(H.r_ear) - return 0 - if( !(slot_flags & SLOT_EARS) ) - return 0 - if( (slot_flags & SLOT_TWOEARS) && H.l_ear ) - return 0 - return 1 - if(slot_w_uniform) - if(H.w_uniform) - return 0 - if( !(slot_flags & SLOT_ICLOTHING) ) - return 0 - return 1 - if(slot_wear_id) - if(H.wear_id) - return 0 - if(!H.w_uniform) - if(!disable_warning) - H << "\red You need a jumpsuit before you can attach this [name]." - return 0 - if( !(slot_flags & SLOT_ID) ) - return 0 - return 1 - if(slot_wear_pda) - if(H.wear_pda) - return 0 - if(!H.w_uniform) - if(!disable_warning) - H << "\red You need a jumpsuit before you can attach this [name]." - return 0 - if( !(slot_flags & SLOT_PDA) ) - return 0 - return 1 - if(slot_l_store) - if(flags & NODROP) //Pockets aren't visible, so you can't move NODROP items into them. - return 0 - if(H.l_store) - return 0 - if(!H.w_uniform) - if(!disable_warning) - H << "\red You need a jumpsuit before you can attach this [name]." - return 0 - if(slot_flags & SLOT_DENYPOCKET) - return - if( w_class <= 2 || (slot_flags & SLOT_POCKET) ) - return 1 - if(slot_r_store) - if(flags & NODROP) - return 0 - if(H.r_store) - return 0 - if(!H.w_uniform) - if(!disable_warning) - H << "\red You need a jumpsuit before you can attach this [name]." - return 0 - if(slot_flags & SLOT_DENYPOCKET) - return 0 - if( w_class <= 2 || (slot_flags & SLOT_POCKET) ) - return 1 - return 0 - if(slot_s_store) - if(flags & NODROP) //Suit storage NODROP items drop if you take a suit off, this is to prevent people exploiting this. - return 0 - if(H.s_store) - return 0 - if(!H.wear_suit) - if(!disable_warning) - H << "\red You need a suit before you can attach this [name]." - return 0 - if(!H.wear_suit.allowed) - if(!disable_warning) - usr << "You somehow have a suit with no defined allowed items for suit storage, stop that." - return 0 - if(src.w_class > 4) - if(!disable_warning) - usr << "The [name] is too big to attach." - return 0 - if( istype(src, /obj/item/device/pda) || istype(src, /obj/item/weapon/pen) || is_type_in_list(src, H.wear_suit.allowed) ) - return 1 - return 0 - if(slot_handcuffed) - if(H.handcuffed) - return 0 - if(!istype(src, /obj/item/weapon/restraints/handcuffs)) - return 0 - return 1 - if(slot_legcuffed) - if(H.legcuffed) - return 0 - if(!istype(src, /obj/item/weapon/restraints/legcuffs)) - return 0 - return 1 - if(slot_in_backpack) - if (H.back && istype(H.back, /obj/item/weapon/storage/backpack)) - var/obj/item/weapon/storage/backpack/B = H.back - if(B.contents.len < B.storage_slots && w_class <= B.max_w_class) - return 1 - return 0 - if(slot_tie) - if(!H.w_uniform) - if(!disable_warning) - H << "You need a jumpsuit before you can attach this [name]." - return 0 - var/obj/item/clothing/under/uniform = H.w_uniform - if(uniform.accessories.len && !uniform.can_attach_accessory(src)) - if (!disable_warning) - H << "You already have an accessory of this type attached to your [uniform]." - return 0 - if( !(slot_flags & SLOT_TIE) ) - return 0 - return 1 - return 0 //Unsupported slot - //END HUMAN +/obj/item/proc/mob_can_equip(mob/M, slot, disable_warning = 0) + if(!M) + return 0 + return M.can_equip(src, slot, disable_warning) /obj/item/verb/verb_pickup() set src in oview(1) @@ -713,7 +482,7 @@ /obj/item/proc/pwr_drain() return 0 // Process Kill - + /obj/item/proc/remove_item_from_storage(atom/newLoc) //please use this if you're going to snowflake an item out of a obj/item/weapon/storage if(!newLoc) return 0 @@ -722,4 +491,4 @@ S.remove_from_storage(src,newLoc) return 1 return 0 - + diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 62214dd86c2..f6f1fa5faa3 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -229,7 +229,7 @@ if(..()) return 1 - if (istype(M, /mob/living/carbon/human)) + if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting) var/limb = affecting.name @@ -238,6 +238,9 @@ return if(affecting.status & ORGAN_SPLINTED) user << "\red [M]'s [limb] is already splinted!" + if(alert(user, "Would you like to remove the splint from [M]'s [limb]?", "Removing.", "Yes", "No") == "Yes") + affecting.status &= ~ORGAN_SPLINTED + user << "You remove the splint from [M]'s [limb]." return if (M != user) user.visible_message("\red [user] starts to apply \the [src] to [M]'s [limb].", "\red You start to apply \the [src] to [M]'s [limb].", "\red You hear something being wrapped.") diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 87bd6a78d5d..0a91cc28708 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -96,10 +96,13 @@ if(ishuman(M)) // Would've done this via species instead of type, but the basic mob doesn't have a species, go figure. var/mob/living/carbon/human/H = M if(H.species.flags & NO_DNA_RAD) - return - - if (!usr.IsAdvancedToolUser()) - return + return 0 + + if (!user.IsAdvancedToolUser()) + return 0 + + if(inuse) + return 0 M.attack_log += text("\[[time_stamp()]\] Has been injected with [name] by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Used the [name] to inject [M.name] ([M.ckey])") @@ -110,91 +113,37 @@ else M.LAssailant = user - if (user) - if (istype(M, /mob/living/carbon/human)) - if(!inuse) - var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) - O.source = user - O.target = M - O.item = src - O.s_loc = user.loc - O.t_loc = M.loc - O.place = "dnainjector" - src.inuse = 1 - spawn(50) // Not the best fix. There should be an failure proc, for /effect/equip_e/, which is called when the first initital checks fail - inuse = 0 - M.requests += O - if (buf.types & DNA2_BUF_SE) - if(block)// Isolated injector - //testing("Isolated block [block] injector with contents: [GetValue()]") - if (GetState() && block == MONKEYBLOCK && istype(M, /mob/living/carbon/human) ) - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)") - log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name] (MONKEY)") - log_game("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)") - else - log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name]") - else - // testing("DNA injector with contents: [english_list(buf.dna.SE)]") - if (GetState(MONKEYBLOCK) && istype(M, /mob/living/carbon/human) ) - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)") - log_attack("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)") - log_game("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)") - else - // message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") - log_attack("[key_name(user)] injected [key_name(M)] with the [name]") - else - // message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") - log_attack("[key_name(user)] injected [key_name(M)] with the [name]") + if(buf.types & DNA2_BUF_SE) + + if(block) + if(GetState() && block == MONKEYBLOCK && ishuman(M)) + message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)") + log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name] (MONKEY)") + log_game("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)") + else + log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name]") - spawn( 0 ) - O.process() - return else - if(!inuse) + if(GetState(MONKEYBLOCK) && ishuman(M)) + message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)") + log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name] (MONKEY)") + log_game("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)") + else + log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name]") - for(var/mob/O in viewers(M, null)) - O.show_message(text("\red [] has been injected with [] by [].", M, src, user), 1) - //Foreach goto(192) - if (!(istype(M, /mob/living/carbon/human))) - user << "\red Apparently it didn't work." - return + else + log_attack("[key_name(user)] injected [key_name(M)] with the [name]") - if (buf.types & DNA2_BUF_SE) - if(block)// Isolated injector - // testing("Isolated block [block] injector with contents: [english_list(GetValue())]") - if (GetState() && block == MONKEYBLOCK && istype(M, /mob/living/carbon/human) ) - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)") - log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name] (MONKEY)") - log_game("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)") - else - log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name]") - else - // testing("DNA injector with contents: [english_list(buf.dna.SE)]") - if (GetState(MONKEYBLOCK) && istype(M, /mob/living/carbon/human)) - message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)") - log_game("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)") - else - // message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") - log_game("[key_name(user)] injected [key_name(M)] with the [name]") - else -// message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]") - log_game("[key_name(user)] injected [key_name(M)] with the [name]") - inuse = 1 - inject(M, user)//Now we actually do the heavy lifting. - spawn(50) - inuse = 0 - /* - A user injecting themselves could mean their own transformation and deletion of mob. - I don't have the time to figure out how this code works so this will do for now. - I did rearrange things a bit. - */ - if(user)//If the user still exists. Their mob may not. - if(M)//Runtime fix: If the mob doesn't exist, mob.name doesnt work. - Nodrak - user.show_message(text("\red You inject [M.name]")) - else - user.show_message(text("\red You finish the injection.")) - return + user.visible_message("\The [user] starts injecting \the [M] with \the [src]!", "You start injecting \the [M] with \the [src].") + if(do_after(user, 50, target = M)) + inject(M, user)//Now we actually do the heavy lifting + user.visible_message("\The [user] injects \the [M] with \the [src]!", "You inject \the [M] with \the [src].") + if(user)//If the user still exists. Their mob may not. + if(M)//Runtime fix: If the mob doesn't exist, mob.name doesnt work. - Nodrak + user.show_message("You inject [M.name]") + else + user.show_message("You finish the injection.") /obj/item/weapon/dnainjector/hulkmut diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index d9030d7147f..ae97f0e6ad2 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -1,8 +1,8 @@ /client/proc/Debug2() set category = "Debug" set name = "Debug-Game" - - if(!check_rights(R_DEBUG)) + + if(!check_rights(R_DEBUG)) return if(Debug2) @@ -30,7 +30,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that set category = "Debug" set name = "Advanced ProcCall" - if(!check_rights(R_PROCCALL)) + if(!check_rights(R_PROCCALL)) return spawn(0) @@ -186,10 +186,10 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/Cell() set category = "Debug" set name = "Air Status in Location" - + if(!check_rights(R_DEBUG)) - return - + return + if(!mob) return var/turf/T = mob.loc @@ -211,9 +211,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/cmd_admin_robotize(var/mob/M in mob_list) set category = "Event" set name = "Make Robot" - + if(!check_rights(R_SPAWN)) - return + return if(!ticker) alert("Wait until the game starts") @@ -229,9 +229,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/cmd_admin_animalize(var/mob/M in mob_list) set category = "Event" set name = "Make Simple Animal" - + if(!check_rights(R_SPAWN)) - return + return if(!ticker) alert("Wait until the game starts") @@ -254,7 +254,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that set category = "Event" set name = "Make pAI" set desc = "Specify a location to spawn a pAI device, then specify a key to play that pAI" - + if(!check_rights(R_SPAWN)) return @@ -283,9 +283,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/cmd_admin_alienize(var/mob/M in mob_list) set category = "Event" set name = "Make Alien" - + if(!check_rights(R_SPAWN)) - return + return if(!ticker) alert("Wait until the game starts") @@ -303,9 +303,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/cmd_admin_slimeize(var/mob/M in mob_list) set category = "Event" set name = "Make slime" - + if(!check_rights(R_SPAWN)) - return + return if(!ticker) alert("Wait until the game starts") @@ -323,9 +323,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/cmd_admin_super(var/mob/M in mob_list) set category = "Event" set name = "Make Superhero" - + if(!check_rights(R_SPAWN)) - return + return if(!ticker) alert("Wait until the game starts") @@ -346,7 +346,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that set name = "Del-All" if(!check_rights(R_DEBUG)) - return + return // to prevent REALLY stupid deletions var/blocked = list(/mob/living, /mob/living/carbon, /mob/living/carbon/human, /mob/dead, /mob/dead/observer, /mob/living/silicon, /mob/living/silicon/robot, /mob/living/silicon/ai) @@ -362,10 +362,10 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/cmd_debug_make_powernets() set category = "Debug" set name = "Make Powernets" - + if(!check_rights(R_DEBUG)) - return - + return + makepowernets() log_admin("[key_name(src)] has remade the powernet. makepowernets() called.") message_admins("[key_name_admin(src)] has remade the powernets. makepowernets() called.", 0) @@ -374,7 +374,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/cmd_admin_grantfullaccess(var/mob/M in mob_list) set category = "Admin" set name = "Grant Full Access" - + if(!check_rights(R_EVENT)) return @@ -410,9 +410,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that set name = "Assume direct control" set desc = "Direct intervention" - if(!check_rights(R_DEBUG|R_ADMIN)) + if(!check_rights(R_DEBUG|R_ADMIN)) return - + if(M.ckey) if(alert("This mob is being controlled by [M.ckey]. Are you sure you wish to assume control of it? [M.ckey] will be made a ghost.",,"Yes","No") != "Yes") return @@ -431,7 +431,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/cmd_admin_areatest() set category = "Mapping" set name = "Test areas" - + if(!check_rights(R_DEBUG)) return @@ -522,14 +522,14 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/cmd_admin_dress(var/mob/living/carbon/human/M in mob_list) set category = "Event" set name = "Select equipment" - + if(!check_rights(R_EVENT)) - return - + return + if(!ishuman(M)) alert("Invalid mob") return - + //log_admin("[key_name(src)] has alienized [M.key].") var/list/dresspacks = list( "strip", @@ -826,43 +826,43 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that M.equip_syndicate_commando() if("nanotrasen officer") - M.equip_if_possible(new /obj/item/clothing/under/rank/centcom/officer(M), slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/centcom(M), slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/color/white(M), slot_gloves) - M.equip_if_possible(new /obj/item/device/radio/headset/heads/captain/alt(M), slot_l_ear) - M.equip_if_possible(new /obj/item/clothing/head/beret/centcom/officer(M), slot_head) + + M.equip_or_collect(new /obj/item/clothing/shoes/centcom(M), slot_shoes) + M.equip_or_collect(new /obj/item/clothing/gloves/color/white(M), slot_gloves) + M.equip_or_collect(new /obj/item/device/radio/headset/heads/captain/alt(M), slot_l_ear) + M.equip_or_collect(new /obj/item/clothing/head/beret/centcom/officer(M), slot_head) var/obj/item/device/pda/centcom/pda = new(M) pda.owner = M.real_name pda.ownjob = "Nanotrasen Navy Officer" pda.name = "PDA-[M.real_name] ([pda.ownjob])" - M.equip_if_possible(pda, slot_r_store) - M.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store) - M.equip_if_possible(new /obj/item/weapon/gun/energy/pulse_rifle/pistol(M), slot_belt) + M.equip_or_collect(pda, slot_r_store) + M.equip_or_collect(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store) + M.equip_or_collect(new /obj/item/weapon/gun/energy/pulse_rifle/pistol(M), slot_belt) var/obj/item/weapon/card/id/centcom/W = new(M) W.name = "[M.real_name]'s ID Card (Nanotrasen Navy Officer)" W.assignment = "Nanotrasen Navy Officer" W.access = get_centcom_access(W.assignment) W.registered_name = M.real_name - M.equip_if_possible(W, slot_wear_id) + M.equip_or_collect(W, slot_wear_id) if("nanotrasen captain") - M.equip_if_possible(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/centcom(M), slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/color/white(M), slot_gloves) - M.equip_if_possible(new /obj/item/device/radio/headset/heads/captain/alt(M), slot_l_ear) - M.equip_if_possible(new /obj/item/clothing/head/beret/centcom/captain(M), slot_head) + M.equip_or_collect(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform) + M.equip_or_collect(new /obj/item/clothing/shoes/centcom(M), slot_shoes) + M.equip_or_collect(new /obj/item/clothing/gloves/color/white(M), slot_gloves) + M.equip_or_collect(new /obj/item/device/radio/headset/heads/captain/alt(M), slot_l_ear) + M.equip_or_collect(new /obj/item/clothing/head/beret/centcom/captain(M), slot_head) var/obj/item/device/pda/centcom/pda = new(M) pda.owner = M.real_name pda.ownjob = "Nanotrasen Navy Captain" pda.name = "PDA-[M.real_name] ([pda.ownjob])" - M.equip_if_possible(pda, slot_r_store) - M.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store) - M.equip_if_possible(new /obj/item/weapon/gun/energy/pulse_rifle/pistol(M), slot_belt) + M.equip_or_collect(pda, slot_r_store) + M.equip_or_collect(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store) + M.equip_or_collect(new /obj/item/weapon/gun/energy/pulse_rifle/pistol(M), slot_belt) var/obj/item/weapon/card/id/centcom/W = new(M) W.name = "[M.real_name]'s ID Card (Nanotrasen Navy Captain)" @@ -870,7 +870,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that W.assignment = "Nanotrasen Navy Captain" W.access = get_centcom_access(W.assignment) W.registered_name = M.real_name - M.equip_if_possible(W, slot_wear_id) + M.equip_or_collect(W, slot_wear_id) if("emergency response team member") M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform) @@ -947,7 +947,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that M.equip_to_slot_or_del(W, slot_wear_id) if("special ops formal") - M.equip_if_possible(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform) + M.equip_or_collect(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform) M.equip_to_slot_or_del(new /obj/item/device/radio/headset/ert/alt(src), slot_l_ear) M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves) M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes) @@ -957,7 +957,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/pistol/m1911(M), slot_belt) M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back) M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/matches(M), slot_r_store) - M.equip_if_possible(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_l_store) + M.equip_or_collect(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_l_store) var/obj/item/device/pda/centcom/pda = new(M) pda.owner = M.real_name @@ -966,10 +966,10 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that pda.name = "PDA-[M.real_name] ([pda.ownjob])" pda.desc = "A portable microcomputer by Thinktronic Systems, LTD. This is model is a special edition designed for military field work." - M.equip_if_possible(pda, slot_wear_pda) + M.equip_or_collect(pda, slot_wear_pda) - M.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store) - M.equip_if_possible(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_r_store) + M.equip_or_collect(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store) + M.equip_or_collect(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_r_store) var/obj/item/weapon/card/id/W = new(M) W.name = "[M.real_name]'s ID Card (Special Operations Officer)" @@ -1056,7 +1056,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that W.assignment = "Admiral" W.registered_name = M.real_name M.equip_to_slot_or_del(W, slot_wear_id) - + if("chrono legionnaire") M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/chronos(M), slot_head) M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/syndicate(src), slot_wear_mask) @@ -1086,8 +1086,8 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that set desc = "Sets up the singularity and all machines to get power flowing through the station" if(!check_rights(R_DEBUG)) - return - + return + if(alert("Are you sure? This will start up the engine. Should only be used during debug!",,"Yes","No") != "Yes") return @@ -1137,9 +1137,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that set category = "Debug" set name = "Debug Mob Lists" set desc = "For when you just gotta know" - + if(!check_rights(R_DEBUG)) - return + return switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Silicons","Clients","Respawnable Mobs")) if("Players") @@ -1162,7 +1162,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that /client/proc/cmd_admin_toggle_block(var/mob/M,var/block) if(!check_rights(R_SPAWN)) - return + return if(!ticker) alert("Wait until the game starts") diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 213cd81bfa9..19ab6d2a366 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -190,48 +190,48 @@ BLIND // can't see anything /obj/item/clothing/gloves/proc/Touch() return -/obj/item/clothing/under/proc/set_sensors(mob/usr as mob) - var/mob/M = usr +/obj/item/clothing/under/proc/set_sensors(mob/user as mob) + var/mob/M = user if (istype(M, /mob/dead/)) return - if (usr.stat || usr.restrained()) return + if (user.stat || user.restrained()) return if(has_sensor >= 2) - usr << "The controls are locked." + user << "The controls are locked." return 0 if(has_sensor <= 0) - usr << "This suit does not have any sensors." + user << "This suit does not have any sensors." return 0 var/list/modes = list("Off", "Binary sensors", "Vitals tracker", "Tracking beacon") var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes - if(get_dist(usr, src) > 1) - usr << "You have moved too far away." + if(get_dist(user, src) > 1) + user << "You have moved too far away." return sensor_mode = modes.Find(switchMode) - 1 - if (src.loc == usr) + if (src.loc == user) switch(sensor_mode) if(0) - usr << "You disable your suit's remote sensing equipment." + user << "You disable your suit's remote sensing equipment." if(1) - usr << "Your suit will now report whether you are live or dead." + user << "Your suit will now report whether you are live or dead." if(2) - usr << "Your suit will now report your vital lifesigns." + user << "Your suit will now report your vital lifesigns." if(3) - usr << "Your suit will now report your vital lifesigns as well as your coordinate position." + user << "Your suit will now report your vital lifesigns as well as your coordinate position." else if (istype(src.loc, /mob)) switch(sensor_mode) if(0) - for(var/mob/V in viewers(usr, 1)) - V.show_message("\red [usr] disables [src.loc]'s remote sensing equipment.", 1) + for(var/mob/V in viewers(user, 1)) + V.show_message("\red [user] disables [src.loc]'s remote sensing equipment.", 1) if(1) - for(var/mob/V in viewers(usr, 1)) - V.show_message("[usr] turns [src.loc]'s remote sensors to binary.", 1) + for(var/mob/V in viewers(user, 1)) + V.show_message("[user] turns [src.loc]'s remote sensors to binary.", 1) if(2) - for(var/mob/V in viewers(usr, 1)) - V.show_message("[usr] sets [src.loc]'s sensors to track vitals.", 1) + for(var/mob/V in viewers(user, 1)) + V.show_message("[user] sets [src.loc]'s sensors to track vitals.", 1) if(3) - for(var/mob/V in viewers(usr, 1)) - V.show_message("[usr] sets [src.loc]'s sensors to maximum.", 1) + for(var/mob/V in viewers(user, 1)) + V.show_message("[user] sets [src.loc]'s sensors to maximum.", 1) /obj/item/clothing/under/verb/toggle() set name = "Toggle Suit Sensors" diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index a9dd00c8ef9..7ca5f2ce444 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -30,7 +30,7 @@ sprite_sheets = list( "Vox" = 'icons/mob/species/vox/head.dmi' ) - + /obj/item/clothing/head/welding/flamedecal name = "flame decal welding helmet" desc = "A welding helmet adorned with flame decals, and several cryptic slogans of varying degrees of legibility." @@ -39,8 +39,8 @@ /obj/item/clothing/head/welding/flamedecal/blue name = "blue flame decal welding helmet" desc = "A welding helmet with blue flame decals on it." - icon_state = "welding_blueflame" - + icon_state = "welding_blueflame" + /obj/item/clothing/head/welding/white name = "white decal welding helmet" desc = "A white welding helmet with a character written across it." @@ -179,18 +179,24 @@ siemens_coefficient = 1.5 loose = 33 - update_icon(var/mob/living/carbon/human/user) - if(!istype(user)) return - mob = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kitty") +/obj/item/clothing/head/kitty/update_icon(var/mob/living/carbon/human/user) + if(!istype(user)) return + mob = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kitty") // mob2 = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kitty2") - Commented out because it seemingly does nothing. - mob.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD) + mob.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD) // mob2.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD) - Commented out because it seemingly does nothing. - var/icon/earbit = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kittyinner") + var/icon/earbit = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kittyinner") // var/icon/earbit2 = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kittyinner2") - Commented out because it seemingly does nothing. - mob.Blend(earbit, ICON_OVERLAY) + mob.Blend(earbit, ICON_OVERLAY) // mob2.Blend(earbit2, ICON_OVERLAY) - Commented out because it seemingly does nothing. + icon_override = mob + +/obj/item/clothing/head/kitty/equipped(var/mob/M, slot) + . = ..() + if(ishuman(M) && slot == slot_head) + update_icon(M) /obj/item/clothing/head/kitty/mouse @@ -198,10 +204,12 @@ desc = "A pair of mouse ears. Squeak!" icon_state = "mousey" - update_icon(var/mob/living/carbon/human/user) - if(!istype(user)) return - mob = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "mousey") - mob.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD) +/obj/item/clothing/head/kitty/mouse/update_icon(var/mob/living/carbon/human/user) + if(!istype(user)) return + mob = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "mousey") + mob.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD) - var/icon/earbit = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "mouseyinner") - mob.Blend(earbit, ICON_OVERLAY) + var/icon/earbit = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "mouseyinner") + mob.Blend(earbit, ICON_OVERLAY) + + icon_override = mob \ No newline at end of file diff --git a/code/modules/clothing/spacesuits/plasmamen.dm b/code/modules/clothing/spacesuits/plasmamen.dm index da245eec5c8..e86246c6930 100644 --- a/code/modules/clothing/spacesuits/plasmamen.dm +++ b/code/modules/clothing/spacesuits/plasmamen.dm @@ -8,7 +8,7 @@ armor = list(melee = 0, bullet = 0, laser = 0 ,energy = 0, bomb = 0, bio = 100, rad = 20) heat_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS - flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT + flags_inv = HIDEGLOVES|HIDESHOES max_heat_protection_temperature = SPACE_SUIT_MAX_TEMP_PROTECT species_restricted = list("Plasmaman") flags = STOPSPRESSUREDMAGE | PLASMAGUARD @@ -53,19 +53,19 @@ user << "You cannot turn the light on while in this [user.loc]." //To prevent some lighting anomalities. return toggle_light(user) - -/obj/item/clothing/head/helmet/space/eva/plasmaman/proc/toggle_light(mob/user) + +/obj/item/clothing/head/helmet/space/eva/plasmaman/proc/toggle_light(mob/user) on = !on icon_state = "[base_state][on]" - if(on) + if(on) set_light(brightness_on) - else + else set_light(0) if(istype(user,/mob/living/carbon/human)) var/mob/living/carbon/human/H = user - H.update_inv_head() + H.update_inv_head() // ENGINEERING /obj/item/clothing/suit/space/eva/plasmaman/assistant diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 93c9733eae0..18735c73cc9 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -38,7 +38,7 @@ I.dna_hash = C.dna_hash I.fingerprint_hash = C.fingerprint_hash qdel(C) - ok = M.equip_if_possible(I, slot_wear_id, 0) //if 1, last argument deletes on fail + ok = M.equip_or_collect(I, slot_wear_id, 0) //if 1, last argument deletes on fail break else if(istype(M.back, /obj/item/weapon/storage)) // Try to place it in something on the mob's back var/obj/item/weapon/storage/S = M.back @@ -68,7 +68,7 @@ /proc/HackProperties(var/mob/living/carbon/human/M,var/obj/item/I,var/script) var/list/statements = text2list(script,";") if(statements.len == 0) - return + return for(var/statement in statements) var/list/assignmentChunks = text2list(statement,"=") var/varname = assignmentChunks[1] diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index e5b37c78657..3d067d0c8fa 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -3,28 +3,26 @@ //Returns the thing in our active hand /mob/proc/get_active_hand() - if(issilicon(src)) - if(isrobot(src)) - if(src:module_active) - return src:module_active - else - if(hand) return l_hand - else return r_hand + if(hand) return l_hand + else return r_hand //Returns the thing in our inactive hand /mob/proc/get_inactive_hand() if(hand) return r_hand else return l_hand +//Returns if a certain item can be equipped to a certain slot. +// Currently invalid for two-handed items - call obj/item/mob_can_equip() instead. +/mob/proc/can_equip(obj/item/I, slot, disable_warning = 0) + return 0 + // Because there's several different places it's stored. /mob/proc/get_multitool(var/if_active=0) return null //Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success. /mob/proc/put_in_l_hand(var/obj/item/W) - if(lying && !(W.flags & ABSTRACT)) - return 0 - if(!istype(W)) + if(!put_in_hand_check(W)) return 0 if(!l_hand) W.forceMove(src) //TODO: move to equipped? @@ -40,9 +38,7 @@ //Puts the item into your r_hand if possible and calls all necessary triggers/updates. returns 1 on success. /mob/proc/put_in_r_hand(var/obj/item/W) - if(lying && !(W.flags & ABSTRACT)) - return 0 - if(!istype(W)) + if(!put_in_hand_check(W)) return 0 if(!r_hand) W.forceMove(src) @@ -56,6 +52,11 @@ return 1 return 0 +/mob/proc/put_in_hand_check(var/obj/item/W) + if(lying && !(W.flags & ABSTRACT)) return 0 + if(!istype(W)) return 0 + return 1 + //Puts the item into our active hand if possible. returns 1 on success. /mob/proc/put_in_active_hand(var/obj/item/W) if(hand) return put_in_l_hand(W) @@ -97,6 +98,13 @@ //Here lie unEquip and before_item_take, already forgotten and not missed. +/mob/proc/canUnEquip(obj/item/I, force) + if(!I) + return 1 + if((I.flags & NODROP) && !force) + return 0 + return 1 + /mob/proc/unEquip(obj/item/I, force) //Force overrides NODROP for things like wizarditis and admin undress. if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for NODROP. return 1 @@ -152,120 +160,19 @@ return items -/** BS12's proc to get the item in the active hand. Couldn't find the /tg/ equivalent. **/ -/mob/proc/equipped() - if(issilicon(src)) - if(isrobot(src)) - if(src:module_active) - return src:module_active - else - if (hand) - return l_hand - else - return r_hand - return - -/mob/living/carbon/human/proc/equip_if_possible(obj/item/W, slot, del_on_fail = 1) // since byond doesn't seem to have pointers, this seems like the best way to do this :/ - //warning: icky code - var/equipped = 0 - switch(slot) - if(slot_back) - if(!src.back) - src.back = W - equipped = 1 - if(slot_wear_mask) - if(!src.wear_mask) - src.wear_mask = W - equipped = 1 - if(slot_handcuffed) - if(!src.handcuffed) - src.handcuffed = W - equipped = 1 - if(slot_l_hand) - if(!src.l_hand) - src.l_hand = W - equipped = 1 - if(slot_r_hand) - if(!src.r_hand) - src.r_hand = W - equipped = 1 - if(slot_belt) - if(!src.belt && src.w_uniform) - src.belt = W - equipped = 1 - if(slot_wear_id) - if(!src.wear_id && src.w_uniform) - src.wear_id = W - equipped = 1 - if(slot_wear_pda) - if(!src.wear_pda && src.w_uniform) - src.wear_pda = W - equipped = 1 - if(slot_l_ear) - if(!src.l_ear) - src.l_ear = W - equipped = 1 - if(slot_r_ear) - if(!src.r_ear) - src.r_ear = W - equipped = 1 - if(slot_glasses) - if(!src.glasses) - src.glasses = W - equipped = 1 - if(slot_gloves) - if(!src.gloves) - src.gloves = W - equipped = 1 - if(slot_head) - if(!src.head) - src.head = W - equipped = 1 - if(slot_shoes) - if(!src.shoes) - src.shoes = W - equipped = 1 - if(slot_wear_suit) - if(!src.wear_suit) - src.wear_suit = W - equipped = 1 - if(slot_w_uniform) - if(!src.w_uniform) - src.w_uniform = W - equipped = 1 - if(slot_l_store) - if(!src.l_store && src.w_uniform) - src.l_store = W - equipped = 1 - if(slot_r_store) - if(!src.r_store && src.w_uniform) - src.r_store = W - equipped = 1 - if(slot_s_store) - if(!src.s_store && src.wear_suit) - src.s_store = W - equipped = 1 - if(slot_in_backpack) - if (src.back && istype(src.back, /obj/item/weapon/storage/backpack)) - var/obj/item/weapon/storage/backpack/B = src.back - if(B.contents.len < B.storage_slots && W.w_class <= B.max_w_class) - W.forceMove(B) - equipped = 1 - - if(equipped) - W.layer = 20 - if(src.back && W.loc != src.back) - W.forceMove(src) - else - if (del_on_fail) - qdel(W) - return equipped - /mob/proc/get_all_slots() - return list(wear_mask, back, l_hand, r_hand) - + return list(wear_mask, back, l_hand, r_hand) + /mob/proc/get_id_card() for(var/obj/item/I in src.get_all_slots()) . = I.GetID() if(.) - break \ No newline at end of file + break + +/mob/proc/get_item_by_slot(slot_id) + switch(slot_id) + if(slot_l_hand) + return l_hand + if(slot_r_hand) + return r_hand + return null \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 19b3c07c8c6..0fd832ebc0c 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -2,8 +2,6 @@ name = "alien" icon_state = "alien_s" - var/obj/item/clothing/suit/wear_suit = null //TODO: necessary? Are they even used? ~Carn - var/obj/item/clothing/head/head = null // var/obj/item/weapon/r_store = null var/obj/item/weapon/l_store = null var/caste = "" diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 68f6020c440..1ea66f59c61 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -513,7 +513,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, if(I == back) back = null - update_inv_back(0) + update_inv_back() else if(I == wear_mask) if(istype(src, /mob/living/carbon/human)) //If we don't do this hair won't be properly rebuilt. return @@ -523,10 +523,10 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, handcuffed = null if(buckled && buckled.buckle_requires_restraints) buckled.unbuckle_mob() - update_inv_handcuffed(1) + update_inv_handcuffed() else if(I == legcuffed) legcuffed = null - update_inv_legcuffed(1) + update_inv_legcuffed() /mob/living/carbon/proc/get_temperature(var/datum/gas_mixture/environment) var/loc_temp = T0C @@ -558,24 +558,73 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, return loc_temp -/mob/living/carbon/show_inv(mob/living/carbon/user as mob) +/mob/living/carbon/show_inv(mob/user) user.set_machine(src) var/dat = {" -
[name]
-

-
Head(Mask): [(wear_mask && !(wear_mask.flags & ABSTRACT)) ? wear_mask : "Nothing"] -
Left Hand: [(l_hand && !(l_hand.flags & ABSTRACT)) ? l_hand : "Nothing"] -
Right Hand: [(r_hand && !(r_hand.flags & ABSTRACT)) ? r_hand : "Nothing"] -
Back: [(back ? back : "Nothing")] [((istype(wear_mask, /obj/item/clothing/mask) && istype(back, /obj/item/weapon/tank) && !( internal )) ? text(" Set Internal", src) : "")] -
[(handcuffed ? text("Handcuffed") : text("Not Handcuffed"))] -
[(internal ? text("Remove Internal") : "")] -
Empty Pockets -
Refresh +
+ [name] +
+
Head: [(head && !(head.flags&ABSTRACT)) ? head : "Nothing"] +
Mask: [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Nothing"] +
Left Hand: [(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Nothing"] +
Right Hand: [(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"]"} + + dat += "
Back: [back ? back : "Nothing"]" + + if(istype(wear_mask, /obj/item/clothing/mask) && istype(back, /obj/item/weapon/tank)) + dat += "
[internal ? "Disable Internals" : "Set Internals"]" + + if(handcuffed) + dat += "
Handcuffed" + if(legcuffed) + dat += "
Legcuffed" + + dat += {" +

Close -
"} - user << browse(dat, text("window=mob\ref[src];size=325x500")) + "} + user << browse(dat, "window=mob\ref[src];size=325x500") onclose(user, "mob\ref[src]") - return + +/mob/living/carbon/Topic(href, href_list) + ..() + //strip panel + if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr)) + if(href_list["internal"]) + var/slot = text2num(href_list["internal"]) + var/obj/item/ITEM = get_item_by_slot(slot) + if(ITEM && istype(ITEM, /obj/item/weapon/tank) && wear_mask && (wear_mask.flags & MASKINTERNALS)) + visible_message("[usr] tries to [internal ? "close" : "open"] the valve on [src]'s [ITEM].", \ + "[usr] tries to [internal ? "close" : "open"] the valve on [src]'s [ITEM].") + if(do_mob(usr, src, POCKET_STRIP_DELAY)) + if(internal) + internal = null + if(internals) + internals.icon_state = "internal0" + else if(ITEM && istype(ITEM, /obj/item/weapon/tank) && wear_mask && (wear_mask.flags & MASKINTERNALS)) + internal = ITEM + if(internals) + internals.icon_state = "internal1" + + visible_message("[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].", \ + "[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].") + +/mob/living/carbon/get_item_by_slot(slot_id) + switch(slot_id) + if(slot_back) + return back + if(slot_wear_mask) + return wear_mask + if(slot_handcuffed) + return handcuffed + if(slot_legcuffed) + return legcuffed + if(slot_l_hand) + return l_hand + if(slot_r_hand) + return r_hand + return null + //generates realistic-ish pulse output based on preset levels /mob/living/carbon/proc/get_pulse(var/method) //method 0 is for hands, 1 is for machines, more accurate diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index b6852c8a8dc..b3b8db03ad7 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -13,6 +13,10 @@ var/number_wounds = 0 var/obj/item/handcuffed = null //Whether or not the mob is handcuffed var/obj/item/legcuffed = null //Same as handcuffs but for legs. Bear traps use this. + + var/obj/item/head = null + var/obj/item/clothing/suit/wear_suit = null //TODO: necessary? Are they even used? ~Carn + //Surgery info var/datum/surgery_status/op_stage = new/datum/surgery_status //Active emote/pose diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 0c40aa4b50f..3941e883cb9 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1,4 +1,3 @@ -#define STRIP_DELAY 40 //time taken (in deciseconds) to strip somebody /mob/living/carbon/human name = "unknown" real_name = "unknown" @@ -523,54 +522,108 @@ /mob/living/carbon/human/var/temperature_resistance = T0C+75 -/mob/living/carbon/human/show_inv(mob/user as mob) - var/obj/item/clothing/under/suit = null - if (istype(w_uniform, /obj/item/clothing/under)) - suit = w_uniform - - var/obj/item/clothing/gloves/G - var/pickpocket = 0 - if(ishuman(user)) - if(user:gloves) - G = user:gloves - pickpocket = G.pickpocket +/mob/living/carbon/human/show_inv(mob/user) user.set_machine(src) - var/dat = {" -
[name]
-

-
Back: [(back && !(back.flags & ABSTRACT)) ? back : "Nothing"] [((istype(wear_mask, /obj/item/clothing/mask) && istype(back, /obj/item/weapon/tank) && !( internal )) ? text(" Set Internal", src) : "")] -
Head(Mask): [(wear_mask && !(wear_mask.flags & ABSTRACT)) ? wear_mask : "Nothing"] -
Left Hand: [(l_hand && !(l_hand.flags & ABSTRACT)) ? l_hand : "Nothing"] -
Right Hand: [(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"]"} + var/has_breathable_mask = istype(wear_mask, /obj/item/clothing/mask) + var/list/obscured = check_obscured_slots() + + var/dat = {" + + + "} + + dat += "" + + dat += "" + + if(slot_wear_mask in obscured) + dat += "" + else + dat += "" + if(!issmall(src)) - dat += {" -
Gloves:[(gloves && !(gloves.flags & ABSTRACT)) ? gloves : "Nothing"] -
Eyes:[(glasses && !(glasses.flags & ABSTRACT)) ? glasses : "Nothing"] -
Left Ear:[(l_ear && !(l_ear.flags & ABSTRACT)) ? l_ear : "Nothing"] -
Right Ear:[(r_ear && !(r_ear.flags & ABSTRACT)) ? r_ear : "Nothing"] -
Head:[(head && !(head.flags & ABSTRACT)) ? head : "Nothing"] -
Shoes:[(shoes && !(shoes.flags & ABSTRACT)) ? shoes : "Nothing"] -
Belt:[(belt && !(belt.flags & ABSTRACT)) ? belt : "Nothing"] [((istype(wear_mask, /obj/item/clothing/mask) && istype(belt, /obj/item/weapon/tank) && !( internal )) ? text(" Set Internal", src) : "")] -
Uniform:[(w_uniform && !(w_uniform.flags & ABSTRACT)) ? w_uniform : "Nothing"] [(suit) ? ((suit.has_sensor == 1) ? text(" Sensors", src) : "") :] -
(Exo)Suit:[(wear_suit && !(wear_suit.flags & ABSTRACT)) ? wear_suit : "Nothing"] -
ID:[(wear_id && !(wear_id.flags & ABSTRACT)) ? wear_id : "Nothing"] -
PDA:[(wear_pda && !(wear_pda.flags & ABSTRACT)) ? wear_pda : "Nothing"] -
Suit Storage:[(s_store && !(s_store.flags & ABSTRACT)) ? s_store : "Nothing"] -

Left Pocket ([(l_store && !(l_store.flags & ABSTRACT)) ? (pickpocket ? l_store.name : "Full") : "Empty"]) -
Right Pocket ([(r_store && !(r_store.flags & ABSTRACT)) ? (pickpocket ? r_store.name : "Full") : "Empty"]) -
Empty Both Pockets"} - dat += {" -

[(handcuffed ? text("Handcuffed") : text("Not Handcuffed"))] -
[(legcuffed ? text("Legcuffed") : text(""))] - [(suit) ? ((suit.accessories.len) ? text("
Remove Accessory", src) : "") :] - [(internal ? text("
Remove Internal") : "")] -
Remove Splints -
Refresh -
Close -
"} - user << browse(dat, text("window=mob\ref[src];size=340x480")) - onclose(user, "mob\ref[src]") - return + if(slot_glasses in obscured) + dat += "" + else + dat += "" + + if(slot_l_ear in obscured) + dat += "" + else + dat += "" + + if(slot_r_ear in obscured) + dat += "" + else + dat += "" + + dat += "" + + dat += "" + if(wear_suit) + dat += "" + else + dat += "" + + if(slot_shoes in obscured) + dat += "" + else + dat += "" + + if(slot_gloves in obscured) + dat += "" + else + dat += "" + + if(slot_w_uniform in obscured) + dat += "" + else + dat += "" + + if(w_uniform == null || (slot_w_uniform in obscured)) + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" + else + dat += "" + dat += "" + dat += "" + dat += "" + + if(istype(w_uniform, /obj/item/clothing/under)) + var/obj/item/clothing/under/U = w_uniform + dat += "" + + if(U.accessories.len) + dat += "" + + + if(handcuffed) + dat += "" + if(legcuffed) + dat += "" + + dat += {"
Left Hand:[(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Empty"]
Right Hand:[(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Empty"]
 
Back:[(back && !(back.flags&ABSTRACT)) ? back : "Empty"]" + if(has_breathable_mask && istype(back, /obj/item/weapon/tank)) + dat += " [internal ? "Disable Internals" : "Set Internals"]" + + dat += "
 
Head:[(head && !(head.flags&ABSTRACT)) ? head : "Empty"]
Mask:Obscured
Mask:[(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Empty"]
Eyes:Obscured
Eyes:[(glasses && !(glasses.flags&ABSTRACT)) ? glasses : "Empty"]
Left Ear:Obscured
Left Ear:[(l_ear && !(l_ear.flags&ABSTRACT)) ? l_ear : "Empty"]
Right Ear:Obscured
Right Ear:[(r_ear && !(r_ear.flags&ABSTRACT)) ? r_ear : "Empty"]
 
Exosuit:[(wear_suit && !(wear_suit.flags&ABSTRACT)) ? wear_suit : "Empty"]
 ↳Suit Storage:[(s_store && !(s_store.flags&ABSTRACT)) ? s_store : "Empty"]" + if(has_breathable_mask && istype(s_store, /obj/item/weapon/tank)) + dat += " [internal ? "Disable Internals" : "Set Internals"]" + dat += "
 ↳Suit Storage:
Shoes:Obscured
Shoes:[(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "Empty"]
Gloves:Obscured
Gloves:[(gloves && !(gloves.flags&ABSTRACT)) ? gloves : "Empty"]
Uniform:Obscured
Uniform:[(w_uniform && !(w_uniform.flags&ABSTRACT)) ? w_uniform : "Empty"]
 ↳Pockets:
 ↳ID:
 ↳Belt:
 ↳Suit Sensors:
 ↳PDA:
 ↳Belt:[(belt && !(belt.flags&ABSTRACT)) ? belt : "Empty"]" + if(has_breathable_mask && istype(belt, /obj/item/weapon/tank)) + dat += " [internal ? "Disable Internals" : "Set Internals"]" + dat += "
 ↳Pockets:[(l_store && !(l_store.flags&ABSTRACT)) ? "Left (Full)" : "Left (Empty)"]" + dat += " [(r_store && !(r_store.flags&ABSTRACT)) ? "Right (Full)" : "Right (Empty)"]
 ↳ID:[(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "Empty"]
 ↳PDA:[(wear_pda && !(wear_pda.flags&ABSTRACT)) ? wear_pda : "Empty"]
 ↳Suit Sensors:[U.has_sensor >= 2 ? "--SENSORS LOCKED--" : "Set Sensors"]
 ↳Remove Accessory
Handcuffed: Remove
Legcuffed
+ Close + "} + + var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 440, 540) + popup.set_content(dat) + popup.open() + // called when something steps onto a human // this handles mulebots and vehicles @@ -688,94 +741,66 @@ /mob/living/carbon/human/Topic(href, href_list) - var/pickpocket = 0 - - if(ishuman(usr)) - var/mob/living/carbon/human/H = usr - var/obj/item/clothing/gloves/G = H.gloves - if(G) - pickpocket = G.pickpocket - if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr)) - // if looting pockets with gloves, do it quietly - if(href_list["pockets"]) - if(isanimal(usr)) - return //animals cannot strip people - - if(frozen) - usr << "\red Do not attempt to strip frozen people." + if(href_list["item"]) + var/slot = text2num(href_list["item"]) + if(slot in check_obscured_slots()) + usr << "You can't reach that! Something is covering it." return + + if(href_list["pockets"]) var/pocket_side = href_list["pockets"] var/pocket_id = (pocket_side == "right" ? slot_r_store : slot_l_store) - var/obj/item/pocket_item = (pocket_id == slot_r_store ? src.r_store : src.l_store) + var/obj/item/pocket_item = (pocket_id == slot_r_store ? r_store : l_store) var/obj/item/place_item = usr.get_active_hand() // Item to place in the pocket, if it's empty - if(pocket_item && !(pocket_item.flags & ABSTRACT)) + var/delay_denominator = 1 + if(pocket_item && !(pocket_item.flags&ABSTRACT)) if(pocket_item.flags & NODROP) - usr << "You try to empty [src]'s [pocket_side] pocket, it seems to be stuck!" + usr << "You try to empty [src]'s [pocket_side] pocket, it seems to be stuck!" usr << "You try to empty [src]'s [pocket_side] pocket." - else if(place_item && place_item.mob_can_equip(src, pocket_id, 1) && !(place_item.flags & ABSTRACT)) + else if(place_item && place_item.mob_can_equip(src, pocket_id, 1) && !(place_item.flags&ABSTRACT)) usr << "You try to place [place_item] into [src]'s [pocket_side] pocket." + delay_denominator = 4 else return - if(do_mob(usr, src, STRIP_DELAY)) + if(do_mob(usr, src, POCKET_STRIP_DELAY/delay_denominator)) //placing an item into the pocket is 4 times faster if(pocket_item) - unEquip(pocket_item) - usr.put_in_hands(pocket_item) + if(pocket_item == (pocket_id == slot_r_store ? r_store : l_store)) //item still in the pocket we search + unEquip(pocket_item) else - if(place_item && !(place_item.flags & NODROP)) + if(place_item) usr.unEquip(place_item) equip_to_slot_if_possible(place_item, pocket_id, 0, 1) // Update strip window if(usr.machine == src && in_range(src, usr)) show_inv(usr) - - else if(!pickpocket) + else // Display a warning if the user mocks up src << "You feel your [pocket_side] pocket being fumbled with!" - // if looting id with gloves, do it quietly - this allows pickpocket gloves to take/place id stealthily - Bone White - if(href_list["item"]) - if(isanimal(usr)) - return //animals cannot strip people + if(href_list["set_sensor"]) + if(istype(w_uniform, /obj/item/clothing/under)) + var/obj/item/clothing/under/U = w_uniform + U.set_sensors(usr) - if(frozen) - usr << "\red Do not attempt to strip frozen people." - return - var/itemTarget = href_list["item"] - if(itemTarget == "id") - if(pickpocket) - var/obj/item/worn_id = src.wear_id - var/obj/item/place_item = usr.get_active_hand() // Item to place in the pocket, if it's empty + if(href_list["strip_accessory"]) + if(istype(w_uniform, /obj/item/clothing/under)) + var/obj/item/clothing/under/U = w_uniform + if(U.accessories.len) + var/obj/item/clothing/accessory/A = U.accessories[1] + usr.visible_message("\The [usr] starts to take off \the [A] from \the [src]'s [U]!", \ + "You start to take off \the [A] from \the [src]'s [U]!") - if(worn_id) - usr << "You try to remove [src]'s ID." - else if(place_item && place_item.mob_can_equip(src, slot_wear_id, 1)) - usr << "You try to place [place_item] onto [src]." - else - return - - if(do_mob(usr, src, STRIP_DELAY)) - if(worn_id) - unEquip(worn_id) - usr.put_in_hands(worn_id) - else - if(place_item) - usr.unEquip(place_item) - equip_to_slot_if_possible(place_item, slot_wear_id, 0, 1) - - // Update strip window - if(usr.machine == src && in_range(src, usr)) - show_inv(usr) - - - - else if(!pickpocket) - // Display a warning if the user mocks up - src << "You feel your ID slot being fumbled with!" + if(do_mob(usr, src, 40) && A && U.accessories.len) + usr.visible_message("\The [usr] takes \the [A] off of \the [src]'s [U]!", \ + "You take \the [A] off of \the [src]'s [U]!") + A.on_removed(usr) + U.accessories -= A + update_inv_w_uniform() if (href_list["refresh"]) if((machine)&&(in_range(src, usr))) @@ -786,21 +811,6 @@ unset_machine() src << browse(null, t1) - if ((href_list["item"] && !( usr.stat ) && usr.canmove && !( usr.restrained() ) && in_range(src, usr) && ticker)) //if game hasn't started, can't make an equip_e - var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( ) - if(!pickpocket || href_list["item"] != "id") // Stop the non-stealthy verbose strip if pickpocketing id. - O.source = usr - O.target = src - O.item = usr.get_active_hand() - O.s_loc = usr.loc - O.t_loc = loc - O.place = href_list["item"] - O.pickpocket = pickpocket //Stealthy - requests += O - spawn( 0 ) - O.process() - return - if (href_list["criminal"]) if(hasHUD(usr,"security")) @@ -950,7 +960,6 @@ if (E.fields["name"] == perpname) for (var/datum/data/record/R in data_core.general) if (R.fields["id"] == E.fields["id"]) - var/setmedical = input(usr, "Specify a new medical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("*SSD*", "*Deceased*", "Physically Unfit", "Active", "Disabled", "Cancel") if(hasHUD(usr,"medical")) @@ -1068,8 +1077,7 @@ if (href_list["lookmob"]) var/mob/M = locate(href_list["lookmob"]) src.examinate(M) - ..() - return + . = ..() ///eyecheck() @@ -1165,6 +1173,31 @@ fail_msg = "There is no exposed flesh or thin material [target_zone == "head" ? "on their head" : "on their body"] to inject into." user << "[fail_msg]" +/mob/living/carbon/human/proc/check_obscured_slots() + var/list/obscured = list() + + if(wear_suit) + if(wear_suit.flags_inv & HIDEGLOVES) + obscured |= slot_gloves + if(wear_suit.flags_inv & HIDEJUMPSUIT) + obscured |= slot_w_uniform + if(wear_suit.flags_inv & HIDESHOES) + obscured |= slot_shoes + + if(head) + if(head.flags_inv & HIDEMASK) + obscured |= slot_wear_mask + if(head.flags_inv & HIDEEYES) + obscured |= slot_glasses + if(head.flags_inv & HIDEEARS) + obscured |= slot_r_ear + obscured |= slot_l_ear + + if(obscured.len > 0) + return obscured + else + return null + /mob/living/carbon/human/proc/check_has_mouth() // Todo, check stomach organ when implemented. var/obj/item/organ/external/head/H = get_organ("head") diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index c863249b79a..09bca41ed3f 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -76,17 +76,22 @@ M << "Remove his mask!" return 0 - var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human() - O.source = M - O.target = src - O.s_loc = M.loc - O.t_loc = loc - O.place = "CPR" - requests += O - spawn(0) - O.process() - add_logs(src, M, "CPRed") - return 1 + M.visible_message("\The [M] is trying to perform CPR on \the [src]!", \ + "You try to perform CPR on \the [src]!") + if(do_mob(M, src, 40)) + if(health > config.health_threshold_dead && health <= config.health_threshold_crit) + var/suff = min(getOxyLoss(), 7) + adjustOxyLoss(-suff) + updatehealth() + M.visible_message("\The [M] performs CPR on \the [src]!", \ + "You perform CPR on \the [src].") + + src << "You feel a breath of fresh air enter your lungs. It feels good." + M << "Repeat at least every 7 seconds." + add_logs(src, M, "CPRed") + return 1 + else + M << "You need to stay still while performing CPR!" if(I_GRAB) if(attacker_style && attacker_style.grab_act(H, src)) diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index ef88db4a6dc..eb53f62a774 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -35,13 +35,11 @@ var/backbag = 2 //Which backpack type the player has chosen. Nothing, Satchel or Backpack. //Equipment slots - var/obj/item/wear_suit = null var/obj/item/w_uniform = null var/obj/item/shoes = null var/obj/item/belt = null var/obj/item/gloves = null var/obj/item/glasses = null - var/obj/item/head = null var/obj/item/l_ear = null var/obj/item/r_ear = null var/obj/item/wear_id = null diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 010e15ab984..fae439fd414 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -183,12 +183,6 @@ else if(I == back) back = null update_inv_back() - else if(I == handcuffed) - handcuffed = null - update_inv_handcuffed() - else if(I == legcuffed) - legcuffed = null - update_inv_legcuffed() else if(I == r_hand) r_hand = null update_inv_r_hand() @@ -213,107 +207,90 @@ src.r_hand = null update_inv_r_hand() + W.screen_loc = null W.loc = src + W.equipped(src, slot) + W.layer = 20 + switch(slot) if(slot_back) - src.back = W - W.equipped(src, slot) + back = W update_inv_back(redraw_mob) if(slot_wear_mask) - src.wear_mask = W + wear_mask = W if((wear_mask.flags & BLOCKHAIR) || (wear_mask.flags & BLOCKHEADHAIR)) update_hair(redraw_mob) //rebuild hair - W.equipped(src, slot) update_inv_wear_mask(redraw_mob) if(slot_handcuffed) - src.handcuffed = W + handcuffed = W update_inv_handcuffed(redraw_mob) if(slot_legcuffed) - src.legcuffed = W - W.equipped(src, slot) + legcuffed = W update_inv_legcuffed(redraw_mob) if(slot_l_hand) - src.l_hand = W - W.equipped(src, slot) + l_hand = W update_inv_l_hand(redraw_mob) if(slot_r_hand) - src.r_hand = W - W.equipped(src, slot) + r_hand = W update_inv_r_hand(redraw_mob) if(slot_belt) - src.belt = W - W.equipped(src, slot) + belt = W update_inv_belt(redraw_mob) if(slot_wear_id) - src.wear_id = W - W.equipped(src, slot) + wear_id = W update_inv_wear_id(redraw_mob) if(slot_wear_pda) - src.wear_pda = W - W.equipped(src, slot) + wear_pda = W update_inv_wear_pda(redraw_mob) if(slot_l_ear) - src.l_ear = W + l_ear = W if(l_ear.slot_flags & SLOT_TWOEARS) var/obj/item/clothing/ears/offear/O = new(W) O.loc = src - src.r_ear = O + r_ear = O O.layer = 20 - W.equipped(src, slot) update_inv_ears(redraw_mob) if(slot_r_ear) - src.r_ear = W + r_ear = W if(r_ear.slot_flags & SLOT_TWOEARS) var/obj/item/clothing/ears/offear/O = new(W) O.loc = src - src.l_ear = O + l_ear = O O.layer = 20 - W.equipped(src, slot) update_inv_ears(redraw_mob) if(slot_glasses) - src.glasses = W - W.equipped(src, slot) + glasses = W update_inv_glasses(redraw_mob) if(slot_gloves) - src.gloves = W - W.equipped(src, slot) + gloves = W update_inv_gloves(redraw_mob) if(slot_head) - src.head = W + head = W if((head.flags & BLOCKHAIR) || (head.flags & BLOCKHEADHAIR)) update_hair(redraw_mob) //rebuild hair - if(istype(W,/obj/item/clothing/head/kitty)) - W.update_icon(src) - W.equipped(src, slot) update_inv_head(redraw_mob) if(slot_shoes) - src.shoes = W - W.equipped(src, slot) + shoes = W update_inv_shoes(redraw_mob) if(slot_wear_suit) - src.wear_suit = W - W.equipped(src, slot) + wear_suit = W update_inv_wear_suit(redraw_mob) if(slot_w_uniform) - src.w_uniform = W - W.equipped(src, slot) + w_uniform = W update_inv_w_uniform(redraw_mob) if(slot_l_store) - src.l_store = W - W.equipped(src, slot) + l_store = W update_inv_pockets(redraw_mob) if(slot_r_store) - src.r_store = W - W.equipped(src, slot) + r_store = W update_inv_pockets(redraw_mob) if(slot_s_store) - src.s_store = W - W.equipped(src, slot) + s_store = W update_inv_s_store(redraw_mob) if(slot_in_backpack) - if(src.get_active_hand() == W) - src.unEquip(W) - W.loc = src.back + if(get_active_hand() == W) + unEquip(W) + W.loc = back if(slot_tie) var/obj/item/clothing/under/uniform = src.w_uniform uniform.attackby(W,src) @@ -321,10 +298,6 @@ src << "You are trying to equip this item to an unsupported inventory slot. Report this to a coder!" return - W.layer = 20 - - return - /mob/living/carbon/human/put_in_hands(obj/item/W) if(!W) return 0 if(put_in_active_hand(W)) return 1 @@ -332,520 +305,6 @@ else ..() -/obj/effect/equip_e - name = "equip e" - var/mob/source = null - var/s_loc = null //source location - var/t_loc = null //target location - var/obj/item/item = null - var/place = null - var/pickpocket = null - -/obj/effect/equip_e/human - name = "human" - var/mob/living/carbon/human/target = null - -/obj/effect/equip_e/process() - return - -/obj/effect/equip_e/proc/done() - return - -/obj/effect/equip_e/New() - if (!ticker) - qdel(src) - spawn(100) - qdel(src) - ..() - return - -/obj/effect/equip_e/human/process() - if (item) - item.add_fingerprint(source) - if (item.flags & NODROP) - source << "\The [item] is stuck to you!" - qdel(src) - return - else - switch(place) - if("mask") - if (!( target.wear_mask )) - qdel(src) - if("l_hand") - if (!( target.l_hand )) - qdel(src) - if("r_hand") - if (!( target.r_hand )) - qdel(src) - if("suit") - if (!( target.wear_suit )) - qdel(src) - if("uniform") - if (!( target.w_uniform )) - qdel(src) - if("back") - if (!( target.back )) - qdel(src) - if("syringe") - return - if("pill") - return - if("fuel") - return - if("drink") - return - if("dnainjector") - return - if("handcuff") - if (!( target.handcuffed )) - qdel(src) - if("id") - if ((!( target.wear_id ) || !( target.w_uniform ))) - qdel(src) - if("splints") - var/count = 0 - for(var/organ in list("l_leg","r_leg","l_arm","r_arm")) - var/obj/item/organ/external/o = target.organs_by_name[organ] - if(o.status & ORGAN_SPLINTED) - count = 1 - break - if(count == 0) - qdel(src) - return - if("internal") - if ((!( (istype(target.wear_mask, /obj/item/clothing/mask) && (istype(target.back, /obj/item/weapon/tank) || istype(target.belt, /obj/item/weapon/tank) || istype(target.s_store, /obj/item/weapon/tank)) && !( target.internal )) ) && !( target.internal ))) - qdel(src) - - var/message=null - if(target.frozen) - source << "\red Do not attempt to strip frozen people." - return - - - switch(place) - if("syringe") - message = "\red [source] is trying to inject [target]!" - if("pill") - message = "\red [source] is trying to force [target] to swallow [item]!" - if("drink") - message = "\red [source] is trying to force [target] to swallow a gulp of [item]!" - if("dnainjector") - message = "\red [source] is trying to inject [target] with the [item]!" - if("mask") - target.attack_log += text("\[[time_stamp()]\] Had their mask removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) mask") - if(target.wear_mask && (target.wear_mask.flags & NODROP)) - message = "\red [source] fails to take off \a [target.wear_mask] from [target]'s head!" - return - else if(target.wear_mask) - message = "\red [source] is trying to take off \a [target.wear_mask] from [target]'s head!" - if("l_hand") - target.attack_log += text("\[[time_stamp()]\] Has had their left hand item ([target.l_hand]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) left hand item ([target.l_hand])") - message = "\red [source] is trying to take off \a [target.l_hand] from [target]'s left hand!" - if("r_hand") - target.attack_log += text("\[[time_stamp()]\] Has had their right hand item ([target.r_hand]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) right hand item ([target.r_hand])") - message = "\red [source] is trying to take off \a [target.r_hand] from [target]'s right hand!" - if("gloves") - target.attack_log += text("\[[time_stamp()]\] Has had their gloves ([target.gloves]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) gloves ([target.gloves])") - if(target.gloves && (target.gloves.flags & NODROP)) - message = "\red [source] fails to take off \a [target.gloves] from [target]'s hands!" - return - else if(target.gloves) - message = "\red [source] is trying to take off the [target.gloves] from [target]'s hands!" - if("eyes") - target.attack_log += text("\[[time_stamp()]\] Has had their eyewear ([target.glasses]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) eyewear ([target.glasses])") - if(target.glasses && (target.glasses.flags & NODROP)) - message = "\red [source] fails to take off \a [target.glasses] from [target]'s eyes!" - return - else if(target.glasses) - message = "\red [source] is trying to take off the [target.glasses] from [target]'s eyes!" - if("l_ear") - target.attack_log += text("\[[time_stamp()]\] Has had their left ear item ([target.l_ear]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) left ear item ([target.l_ear])") - if(target.l_ear && (target.l_ear.flags & NODROP)) - message = "\red [source] fails to take off \a [target.l_ear] from [target]'s left ear!" - return - else if(target.l_ear) - message = "\red [source] is trying to take off the [target.l_ear] from [target]'s left ear!" - if("r_ear") - target.attack_log += text("\[[time_stamp()]\] Has had their right ear item ([target.r_ear]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) right ear item ([target.r_ear])") - if(target.r_ear && (target.r_ear.flags & NODROP)) - message = "\red [source] fails to take off \a [target.r_ear] from [target]'s right ear!" - return - else if(target.r_ear) - message = "\red [source] is trying to take off the [target.r_ear] from [target]'s right ear!" - if("head") - target.attack_log += text("\[[time_stamp()]\] Has had their hat ([target.head]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) hat ([target.head])") - if(target.head && (target.head.flags & NODROP)) - message = "\red [source] fails to take off \a [target.head] from [target]'s head!" - return - else if(target.head) - message = "\red [source] is trying to take off the [target.head] from [target]'s head!" - if("shoes") - target.attack_log += text("\[[time_stamp()]\] Has had their shoes ([target.shoes]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) shoes ([target.shoes])") - if(target.shoes && (target.shoes.flags & NODROP)) - message = "\red [source] fails to take off \a [target.shoes] from [target]'s feet!" - return - else if(target.shoes) - message = "\red [source] is trying to take off [target.shoes] from [target]'s feet!" - if("belt") - target.attack_log += text("\[[time_stamp()]\] Has had their belt item ([target.belt]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) belt item ([target.belt])") - if(!pickpocket && target.belt) - message = "\red [source] is trying to take off \a [target.belt] from [target]'s belt!" - if("suit") - target.attack_log += text("\[[time_stamp()]\] Has had their suit ([target.wear_suit]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) suit ([target.wear_suit])") - if(target.wear_suit && (target.wear_suit.flags & NODROP)) - message = "\red [source] fails to take off \a [target.wear_suit] from [target]'s body!" - return - else if(target.wear_suit) - message = "\red [source] is trying to take off \a [target.wear_suit] from [target]'s body!" - if("back") - target.attack_log += text("\[[time_stamp()]\] Has had their back item ([target.back]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) back item ([target.back])") - message = "\red [source] is trying to take off \a [target.back] from [target]'s back!" - if("handcuff") - target.attack_log += text("\[[time_stamp()]\] Was unhandcuffed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to unhandcuff [target.name]'s ([target.ckey])") - if(target.handcuffed) - message = "\red [source] is trying to unhandcuff [target]!" - if("legcuff") - target.attack_log += text("\[[time_stamp()]\] Was unlegcuffed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to unlegcuff [target.name]'s ([target.ckey])") - if(target.legcuffed) - message = "\red [source] is trying to unlegcuff [target]!" - else - message = "\red [source] is trying to legcuff [target]!" - if("uniform") - target.attack_log += text("\[[time_stamp()]\] Has had their uniform ([target.w_uniform]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) uniform ([target.w_uniform])") - for(var/obj/item/I in list(target.l_store, target.r_store)) - if(I.on_found(source)) - return - if(target.w_uniform && (target.w_uniform.flags & NODROP)) - message = "\red [source] fails to take off \a [target.w_uniform] from [target]'s body!" - return - else - message = "\red [source] is trying to take off \a [target.w_uniform] from [target]'s body!" - if("tie") - var/obj/item/clothing/under/suit = target.w_uniform - if(suit.accessories.len) - var/obj/item/clothing/accessory/A = suit.accessories[1] - target.attack_log += "\[[time_stamp()]\] Has had their accessory ([A]) removed by [source.name] ([source.ckey])" - source.attack_log += "\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) accessory ([A])" - if(istype(A, /obj/item/clothing/accessory/holobadge) || istype(A, /obj/item/clothing/accessory/medal)) - for(var/mob/M in viewers(target, null)) - M.show_message("\red [source] tears off \the [A] from [target]'s [suit]!" , 1) - done() - return - else - message = "\red [source] is trying to take off \a [A] from [target]'s [suit]!" - if("s_store") - target.attack_log += text("\[[time_stamp()]\] Has had their suit storage item ([target.s_store]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) suit storage item ([target.s_store])") - message = "\red [source] is trying to take off \a [target.s_store] from [target]'s suit!" - if("pockets") - target.attack_log += text("\[[time_stamp()]\] Has had their pockets emptied by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to empty [target.name]'s ([target.ckey]) pockets") - for(var/obj/item/I in list(target.l_store, target.r_store)) - if(I.on_found(source)) - return - message = "\red [source] is trying to empty [target]'s pockets!" - if("CPR") - if (!target.cpr_time) - qdel(src) - target.cpr_time = 0 - message = "\red [source] is trying perform CPR on [target]!" - if("id") - target.attack_log += text("\[[time_stamp()]\] Has had their ID ([target.wear_id]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) ID ([target.wear_id])") - if(!pickpocket) - message = "\red [source] is trying to take off [target.wear_id] from [target]'s uniform!" - else - source << "\blue You try to take off [target.wear_id] from [target]'s uniform!" - if("pda") - target.attack_log += text("\[[time_stamp()]\] Has had their PDA ([target.wear_pda]) removed by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to remove [target.name]'s ([target.ckey]) PDA ([target.wear_pda])") - message = "\red [source] is trying to take off [target.wear_pda] from [target]'s uniform!" - if("internal") - target.attack_log += text("\[[time_stamp()]\] Has had their internals toggled by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to toggle [target.name]'s ([target.ckey]) internals") - if (target.internal) - message = "\red [source] is trying to remove [target]'s internals!" - else - message = "\red [source] is trying to set on [target]'s internals." - if("splints") - message = "\red [source] is trying to remove [target]'s splints!" - if("sensor") - target.attack_log += text("\[[time_stamp()]\] Has had their sensors toggled by [source.name] ([source.ckey])") - source.attack_log += text("\[[time_stamp()]\] Attempted to toggle [target.name]'s ([target.ckey]) sensors") - var/obj/item/clothing/under/suit = target.w_uniform - if (suit.has_sensor >= 2) - source << "The controls are locked." - return - message = "\red [source] is trying to set [target]'s suit sensors!" - - for(var/mob/M in viewers(target, null)) - if(findtext(message, "is trying to take off from", 1, 0) > 0 || message == null) - message = "\red [source] is trying to put \a [item] on [target]!" - if(findtext(message, "is trying to put on", 1, 0) > 0) - return - else - M.show_message(message, 1) - else - M.show_message(message, 1) - spawn( HUMAN_STRIP_DELAY ) - done() - return - return - -/* -This proc equips stuff (or does something else) when removing stuff manually from the character window when you click and drag. -It works in conjuction with the process() above. -This proc works for humans only. Aliens stripping humans and the like will all use this proc. Stripping monkeys or somesuch will use their version of this proc. -The first if statement for "mask" and such refers to items that are already equipped and un-equipping them. -The else statement is for equipping stuff to empty slots. -The NODROP flag refers to variable of /obj/item/clothing which either allows or disallows that item to be removed. -It can still be worn/put on as normal. -*/ -/obj/effect/equip_e/human/done() //TODO: And rewrite this :< ~Carn - target.cpr_time = 1 - if(isanimal(source)) return //animals cannot strip people - if(!source || !target) return //Target or source no longer exist - if(source.loc != s_loc) return //source has moved - if(target.loc != t_loc) return //target has moved - if(!in_range(source, target)) return - if(item && source.get_active_hand() != item) return //Swapped hands / removed item from the active one - if ((source.restrained() || source.stat)) return //Source restrained or unconscious / dead - if(target.frozen) - source << "\red Do not attempt to strip frozen people." - return - - - var/slot_to_process - var/strip_item //this will tell us which item we will be stripping - if any. - - switch(place) //here we go again... - if("mask") - slot_to_process = slot_wear_mask - if (target.wear_mask && !(target.wear_mask.flags & NODROP)) - strip_item = target.wear_mask - if("gloves") - slot_to_process = slot_gloves - if (target.gloves && !(target.gloves.flags & NODROP)) - strip_item = target.gloves - if("eyes") - slot_to_process = slot_glasses - if (target.glasses) - strip_item = target.glasses - if("belt") - slot_to_process = slot_belt - if (target.belt) - strip_item = target.belt - if("s_store") - slot_to_process = slot_s_store - if (target.s_store) - strip_item = target.s_store - if("head") - slot_to_process = slot_head - if (target.head && !(target.head.flags & NODROP)) - strip_item = target.head - if("l_ear") - slot_to_process = slot_l_ear - if (target.l_ear) - strip_item = target.l_ear - if("r_ear") - slot_to_process = slot_r_ear - if (target.r_ear) - strip_item = target.r_ear - if("shoes") - slot_to_process = slot_shoes - if (target.shoes && !(target.shoes.flags & NODROP)) - strip_item = target.shoes - if("l_hand") - if (istype(target, /obj/item/clothing/suit/straight_jacket)) - qdel(src) - slot_to_process = slot_l_hand - if (target.l_hand) - strip_item = target.l_hand - if("r_hand") - if (istype(target, /obj/item/clothing/suit/straight_jacket)) - qdel(src) - slot_to_process = slot_r_hand - if (target.r_hand) - strip_item = target.r_hand - if("uniform") - slot_to_process = slot_w_uniform - if(target.w_uniform && !(target.w_uniform.flags & NODROP)) - strip_item = target.w_uniform - if("suit") - slot_to_process = slot_wear_suit - if (target.wear_suit && !(target.wear_suit.flags & NODROP)) - strip_item = target.wear_suit - if("tie") - var/obj/item/clothing/under/suit = target.w_uniform - //var/obj/item/clothing/accessory/tie = suit.hastie - /*if(tie) - if (istype(tie,/obj/item/clothing/accessory/storage)) - var/obj/item/clothing/accessory/storage/W = tie - if (W.hold) - W.hold.close(usr) - usr.put_in_hands(tie) - suit.hastie = null*/ - if(suit && suit.accessories.len) - var/obj/item/clothing/accessory/A = suit.accessories[1] - A.on_removed(usr) - suit.accessories -= A - target.update_inv_w_uniform() - if("id") - slot_to_process = slot_wear_id - if (target.wear_id) - strip_item = target.wear_id - if("pda") - slot_to_process = slot_wear_pda - if (target.wear_pda) - strip_item = target.wear_pda - if("back") - slot_to_process = slot_back - if (target.back) - strip_item = target.back - if("handcuff") - slot_to_process = slot_handcuffed - if (target.handcuffed) - strip_item = target.handcuffed - if("legcuff") - slot_to_process = slot_legcuffed - if (target.legcuffed) - strip_item = target.legcuffed - if("splints") - for(var/organ in list("l_leg","r_leg","l_arm","r_arm")) - var/obj/item/organ/external/o = target.get_organ(organ) - if (o && o.status & ORGAN_SPLINTED) - var/obj/item/W = new /obj/item/stack/medical/splint/single() - o.status &= ~ORGAN_SPLINTED - if (W) - W.loc = target.loc - W.layer = initial(W.layer) - W.add_fingerprint(source) - if("CPR") - if ((target.health > config.health_threshold_dead && target.health <= config.health_threshold_crit)) - var/suff = min(target.getOxyLoss(), 7) - target.adjustOxyLoss(-suff) - target.updatehealth() - for(var/mob/O in viewers(source, null)) - O.show_message("\red [source] performs CPR on [target]!", 1) - target << "\blue You feel a breath of fresh air enter your lungs. It feels good." - source << "\red Repeat at least every 7 seconds." - if("dnainjector") - var/obj/item/weapon/dnainjector/S = item - if(S) - S.add_fingerprint(source) - if (!( istype(S, /obj/item/weapon/dnainjector) )) - S.inuse = 0 - qdel(src) - S.inject(target, source) - if (S.s_time >= world.time + 30) - S.inuse = 0 - qdel(src) - S.s_time = world.time - for(var/mob/O in viewers(source, null)) - O.show_message("\red [source] injects [target] with the DNA Injector!", 1) - S.inuse = 0 - if("pockets") - slot_to_process = slot_l_store - strip_item = target.l_store //We'll do both - if("sensor") - var/obj/item/clothing/under/suit = target.w_uniform - if (suit) - if(suit.has_sensor >= 2) - source << "The controls are locked." - else - suit.set_sensors(source) - if("internal") - if (target.internal) - target.internal.add_fingerprint(source) - target.internal = null - if (target.internals) - target.internals.icon_state = "internal0" - else - if (!( istype(target.wear_mask, /obj/item/clothing/mask) )) - return - else - if (istype(target.back, /obj/item/weapon/tank)) - target.internal = target.back - else if (istype(target.s_store, /obj/item/weapon/tank)) - target.internal = target.s_store - else if (istype(target.belt, /obj/item/weapon/tank)) - target.internal = target.belt - if (target.internal) - for(var/mob/M in viewers(target, 1)) - M.show_message("[target] is now running on internals.", 1) - target.internal.add_fingerprint(source) - if (target.internals) - target.internals.icon_state = "internal1" - if(slot_to_process) - if(strip_item) //Stripping an item from the mob - var/obj/item/W = strip_item - if((W.flags & NODROP) || (W.flags & ABSTRACT)) //Just to be sure - return - target.unEquip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.layer = initial(W.layer) - W.dropped(target) - W.add_fingerprint(source) - if(slot_to_process == slot_l_store) //pockets! Needs to process the other one too. Snowflake code, wooo! It's not like anyone will rewrite this anytime soon. If I'm wrong then... CONGRATULATIONS! ;) - if(target.r_store) - target.unEquip(target.r_store) //At this stage l_store is already processed by the code above, we only need to process r_store. - else - if(item && target.has_organ_for_slot(slot_to_process)) //Placing an item on the mob - if(item.mob_can_equip(target, slot_to_process, 0)) - source.unEquip(item) - target.equip_to_slot_if_possible(item, slot_to_process, 0, 1, 1) - item.dropped(source) - source.update_icons() - target.update_icons() - - if(source && target) - if(source.machine == target) - target.show_inv(source) - qdel(src) - - -/mob/proc/get_item_by_slot(slot_id) - switch(slot_id) - if(slot_l_hand) - return l_hand - if(slot_r_hand) - return r_hand - return null - -/mob/living/carbon/get_item_by_slot(slot_id) - switch(slot_id) - if(slot_back) - return back - if(slot_wear_mask) - return wear_mask - if(slot_handcuffed) - return handcuffed - if(slot_legcuffed) - return legcuffed - if(slot_l_hand) - return l_hand - if(slot_r_hand) - return r_hand - return null - // Return the item currently in the slot ID /mob/living/carbon/human/get_item_by_slot(slot_id) switch(slot_id) @@ -865,6 +324,8 @@ It can still be worn/put on as normal. return belt if(slot_wear_id) return wear_id + if(slot_wear_pda) + return wear_pda if(slot_l_ear) return l_ear if(slot_r_ear) @@ -905,6 +366,7 @@ It can still be worn/put on as normal. shoes, belt, wear_id, + wear_pda, l_store, r_store, w_uniform @@ -917,4 +379,219 @@ It can still be worn/put on as normal. glasses, r_ear, l_ear, - ) \ No newline at end of file + ) + +// humans have their pickpocket gloves, so they get no message when stealing things +/mob/living/carbon/human/stripPanelUnequip(obj/item/what, mob/who, where) + var/is_silent = 0 + var/obj/item/clothing/gloves/G = gloves + if(istype(G)) + is_silent = G.pickpocket + + ..(what, who, where, silent = is_silent) + +// humans have their pickpocket gloves, so they get no message when stealing things +/mob/living/carbon/human/stripPanelEquip(obj/item/what, mob/who, where) + var/is_silent = 0 + var/obj/item/clothing/gloves/G = gloves + if(istype(G)) + is_silent = G.pickpocket + + ..(what, who, where, silent = is_silent) + +/mob/living/carbon/human/can_equip(obj/item/I, slot, disable_warning = 0) + switch(species.handle_can_equip(I, slot, disable_warning, src)) + if(1) return 1 + if(2) return 0 //if it returns 2, it wants no normal handling + + if(istype(I, /obj/item/clothing/under) || istype(I, /obj/item/clothing/suit)) + if(FAT in mutations) + //testing("[M] TOO FAT TO WEAR [src]!") + if(!(I.flags & ONESIZEFITSALL)) + if(!disable_warning) + src << "You're too fat to wear the [I]." + return 0 + + switch(slot) + if(slot_l_hand) + if(l_hand) + return 0 + return 1 + if(slot_r_hand) + if(r_hand) + return 0 + return 1 + if(slot_wear_mask) + if(wear_mask) + return 0 + if(!(I.slot_flags & SLOT_MASK)) + return 0 + return 1 + if(slot_back) + if(back) + return 0 + if(!(I.slot_flags & SLOT_BACK)) + return 0 + return 1 + if(slot_wear_suit) + if(wear_suit) + return 0 + if(!(I.slot_flags & SLOT_OCLOTHING)) + return 0 + return 1 + if(slot_gloves) + if(gloves) + return 0 + if(!(I.slot_flags & SLOT_GLOVES)) + return 0 + return 1 + if(slot_shoes) + if(shoes) + return 0 + if(!(I.slot_flags & SLOT_FEET)) + return 0 + return 1 + if(slot_belt) + if(belt) + return 0 + if(!w_uniform) + if(!disable_warning) + src << "You need a jumpsuit before you can attach this [name]." + return 0 + if(!(I.slot_flags & SLOT_BELT)) + return + return 1 + if(slot_glasses) + if(glasses) + return 0 + if(!(I.slot_flags & SLOT_EYES)) + return 0 + return 1 + if(slot_head) + if(head) + return 0 + if(!(I.slot_flags & SLOT_HEAD)) + return 0 + return 1 + if(slot_l_ear) + if(l_ear) + return 0 + if(!(I.slot_flags & SLOT_EARS)) + return 0 + if((I.slot_flags & SLOT_TWOEARS) && r_ear ) + return 0 + return 1 + if(slot_r_ear) + if(r_ear) + return 0 + if(!(I.slot_flags & SLOT_EARS)) + return 0 + if((I.slot_flags & SLOT_TWOEARS) && l_ear) + return 0 + return 1 + if(slot_w_uniform) + if(w_uniform) + return 0 + if(!(I.slot_flags & SLOT_ICLOTHING)) + return 0 + return 1 + if(slot_wear_id) + if(wear_id) + return 0 + if(!w_uniform) + if(!disable_warning) + src << "You need a jumpsuit before you can attach this [name]." + return 0 + if(!(I.slot_flags & SLOT_ID)) + return 0 + return 1 + if(slot_wear_pda) + if(wear_pda) + return 0 + if(!w_uniform) + if(!disable_warning) + src << "You need a jumpsuit before you can attach this [name]." + return 0 + if(!(I.slot_flags & SLOT_PDA)) + return 0 + return 1 + if(slot_l_store) + if(I.flags & NODROP) //Pockets aren't visible, so you can't move NODROP items into them. + return 0 + if(l_store) + return 0 + if(!w_uniform) + if(!disable_warning) + src << "You need a jumpsuit before you can attach this [name]." + return 0 + if(I.slot_flags & SLOT_DENYPOCKET) + return + if(I.w_class <= 2 || (I.slot_flags & SLOT_POCKET)) + return 1 + if(slot_r_store) + if(I.flags & NODROP) + return 0 + if(r_store) + return 0 + if(!w_uniform) + if(!disable_warning) + src << "You need a jumpsuit before you can attach this [name]." + return 0 + if(I.slot_flags & SLOT_DENYPOCKET) + return 0 + if(I.w_class <= 2 || (I.slot_flags & SLOT_POCKET)) + return 1 + return 0 + if(slot_s_store) + if(I.flags & NODROP) //Suit storage NODROP items drop if you take a suit off, this is to prevent people exploiting this. + return 0 + if(s_store) + return 0 + if(!wear_suit) + if(!disable_warning) + src << "You need a suit before you can attach this [name]." + return 0 + if(!wear_suit.allowed) + if(!disable_warning) + src << "You somehow have a suit with no defined allowed items for suit storage, stop that." + return 0 + if(I.w_class > 4) + if(!disable_warning) + src << "The [name] is too big to attach." + return 0 + if(istype(I, /obj/item/device/pda) || istype(I, /obj/item/weapon/pen) || is_type_in_list(I, wear_suit.allowed)) + return 1 + return 0 + if(slot_handcuffed) + if(handcuffed) + return 0 + if(!istype(I, /obj/item/weapon/restraints/handcuffs)) + return 0 + return 1 + if(slot_legcuffed) + if(legcuffed) + return 0 + if(!istype(I, /obj/item/weapon/restraints/legcuffs)) + return 0 + return 1 + if(slot_in_backpack) + if(back && istype(back, /obj/item/weapon/storage/backpack)) + var/obj/item/weapon/storage/backpack/B = back + if(B.contents.len < B.storage_slots && I.w_class <= B.max_w_class) + return 1 + return 0 + if(slot_tie) + if(!w_uniform) + if(!disable_warning) + src << "You need a jumpsuit before you can attach this [name]." + return 0 + var/obj/item/clothing/under/uniform = w_uniform + if(uniform.accessories.len && !uniform.can_attach_accessory(src)) + if(!disable_warning) + src << "You already have an accessory of this type attached to your [uniform]." + return 0 + if(!(I.slot_flags & SLOT_TIE)) + return 0 + return 1 + + return 0 //Unsupported slot \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/monkey.dm b/code/modules/mob/living/carbon/human/species/monkey.dm index c7c6f49bd57..e1212758309 100644 --- a/code/modules/mob/living/carbon/human/species/monkey.dm +++ b/code/modules/mob/living/carbon/human/species/monkey.dm @@ -52,10 +52,46 @@ datum/species/monkey/get_random_name(var/gender) /datum/species/monkey/handle_dna(var/mob/living/carbon/human/H) H.dna.SetSEState(MONKEYBLOCK,1) +/datum/species/monkey/handle_can_equip(obj/item/I, slot, disable_warning = 0, mob/living/carbon/human/user) + switch(slot) + if(slot_l_hand) + if(user.l_hand) + return 2 + return 1 + if(slot_r_hand) + if(user.r_hand) + return 2 + return 1 + if(slot_wear_mask) + if(user.wear_mask) + return 2 + if(!(I.slot_flags & SLOT_MASK)) + return 2 + return 1 + if(slot_back) + if(user.back) + return 2 + if(!(I.slot_flags & SLOT_BACK)) + return 2 + return 1 + if(slot_handcuffed) + if(user.handcuffed) + return 2 + if(!istype(I, /obj/item/weapon/restraints/handcuffs)) + return 2 + return 1 + if(slot_in_backpack) + if(user.back && istype(user.back, /obj/item/weapon/storage/backpack)) + var/obj/item/weapon/storage/backpack/B = user.back + if(B.contents.len < B.storage_slots && I.w_class <= B.max_w_class) + return 1 + return 2 + return 2 + /datum/species/monkey/tajaran name = "Farwa" name_plural = "Farwa" - + icobase = 'icons/mob/human_races/monkeys/r_farwa.dmi' deform = 'icons/mob/human_races/monkeys/r_farwa.dmi' diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 2f50a3a4d51..1ed4360db60 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -78,7 +78,7 @@ //Used in icon caching. var/race_key = 0 var/icon/icon_template - + var/is_small var/show_ssd = 1 var/virus_immune @@ -103,7 +103,7 @@ "brain" = /obj/item/organ/brain, "appendix" = /obj/item/organ/appendix, "eyes" = /obj/item/organ/eyes - ) + ) var/vision_organ // If set, this organ is required for vision. Defaults to "eyes" if the species has them. var/list/has_limbs = list( "chest" = list("path" = /obj/item/organ/external/chest), @@ -364,3 +364,6 @@ /datum/unarmed_attack/claws/armalis attack_verb = list("slash", "claw") damage = 6 //they're huge! they should do a little more damage, i'd even go for 15-20 maybe... + +/datum/species/proc/handle_can_equip(obj/item/I, slot, disable_warning = 0, mob/living/carbon/human/user) + return 0 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index eb427777fc9..1e22f34bfe8 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -692,15 +692,12 @@ var/global/list/damage_icon_parts = list() if(head) head.screen_loc = ui_head //TODO var/image/standing - if(istype(head,/obj/item/clothing/head/kitty)) - standing = image("icon" = head:mob) + if(head.icon_override) + standing = image("icon" = head.icon_override, "icon_state" = "[head.icon_state]") + else if(head.sprite_sheets && head.sprite_sheets[species.name]) + standing = image("icon" = head.sprite_sheets[species.name], "icon_state" = "[head.icon_state]") else - if(head.icon_override) - standing = image("icon" = head.icon_override, "icon_state" = "[head.icon_state]") - else if(head.sprite_sheets && head.sprite_sheets[species.name]) - standing = image("icon" = head.sprite_sheets[species.name], "icon_state" = "[head.icon_state]") - else - standing = image("icon" = 'icons/mob/head.dmi', "icon_state" = "[head.icon_state]") + standing = image("icon" = 'icons/mob/head.dmi', "icon_state" = "[head.icon_state]") if(head.blood_DNA) var/image/bloodsies = image("icon" = species.blood_mask, "icon_state" = "helmetblood") diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 452493b4fdb..f3cb5145f78 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -890,6 +890,40 @@ /mob/living/proc/can_use_vents() return "You can't fit into that vent." +// The src mob is trying to strip an item from someone +// Override if a certain type of mob should be behave differently when stripping items (can't, for example) +/mob/living/stripPanelUnequip(obj/item/what, mob/who, where, var/silent = 0) + if(what.flags & NODROP) + src << "You can't remove \the [what.name], it appears to be stuck!" + return + if(!silent) + who.visible_message("[src] tries to remove [who]'s [what.name].", \ + "[src] tries to remove [who]'s [what.name].") + what.add_fingerprint(src) + if(do_mob(src, who, what.strip_delay)) + if(what && what == who.get_item_by_slot(where) && Adjacent(who)) + who.unEquip(what) + add_logs(who, src, "stripped", addition="of [what]") + +// The src mob is trying to place an item on someone +// Override if a certain mob should be behave differently when placing items (can't, for example) +/mob/living/stripPanelEquip(obj/item/what, mob/who, where, var/silent = 0) + what = src.get_active_hand() + if(what && (what.flags & NODROP)) + src << "You can't put \the [what.name] on [who], it's stuck to your hand!" + return + if(what) + if(!what.mob_can_equip(who, where, 1)) + src << "\The [what.name] doesn't fit in that place!" + return + if(!silent) + visible_message("[src] tries to put [what] on [who].") + if(do_mob(src, who, what.put_on_delay)) + if(what && Adjacent(who)) + unEquip(what) + who.equip_to_slot_if_possible(what, where, 0, 1) + add_logs(who, src, "equipped", what) + /mob/living/singularity_act() var/gain = 20 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 41a7a5ce048..ae830d920b3 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -469,23 +469,18 @@ var/list/slot_equipment_priority = list( \ return -/mob/proc/show_inv(mob/user as mob) +/mob/proc/show_inv(mob/user) user.set_machine(src) var/dat = {" -
[name]
-

-
Head(Mask): [(wear_mask ? wear_mask : "Nothing")] -
Left Hand: [(l_hand && !(l_hand.flags & ABSTRACT)) ? l_hand : "Nothing"] -
Right Hand: [(r_hand && !(r_hand.flags & ABSTRACT)) ? r_hand : "Nothing"] -
Back: [(back && !(back.flags & ABSTRACT)) ? back : "Nothing"] [((istype(wear_mask, /obj/item/clothing/mask) && istype(back, /obj/item/weapon/tank) && !( internal )) ? text(" Set Internal", src) : "")] -
[(internal ? text("Remove Internal") : "")] -
Empty Pockets -
Refresh +
+ [name] +
+
Left Hand: [(l_hand&&!(l_hand.flags&ABSTRACT)) ? l_hand : "Nothing"] +
Right Hand: [(r_hand&&!(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"]
Close -
"} - user << browse(dat, text("window=mob[];size=325x500", name)) + "} + user << browse(dat, "window=mob\ref[src];size=325x500") onclose(user, "mob\ref[src]") - return //mob verbs are faster than object verbs. See http://www.byond.com/forum/?post=1326139&page=2#comment8198716 for why this isn't atom/verb/examine() /mob/verb/examinate(atom/A as mob|obj|turf in view()) @@ -786,6 +781,26 @@ var/list/slot_equipment_priority = list( \ unset_machine() src << browse(null, t1) + if(href_list["refresh"]) + if(machine && in_range(src, usr)) + show_inv(machine) + + if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr)) + if(href_list["item"]) + var/slot = text2num(href_list["item"]) + var/obj/item/what = get_item_by_slot(slot) + + if(what) + usr.stripPanelUnequip(what,src,slot) + else + usr.stripPanelEquip(what,src,slot) + + if(usr.machine == src) + if(Adjacent(usr)) + show_inv(usr) + else + usr << browse(null,"window=mob\ref[src]") + if(href_list["flavor_more"]) usr << browse(text("[][]", name, replacetext(flavor_text, "\n", "
")), text("window=[];size=500x200", name)) onclose(usr, "[name]") @@ -794,6 +809,16 @@ var/list/slot_equipment_priority = list( \ return +// The src mob is trying to strip an item from someone +// Defined in living.dm +/mob/proc/stripPanelUnequip(obj/item/what, mob/who) + return + +// The src mob is trying to place an item on someone +// Defined in living.dm +/mob/proc/stripPanelEquip(obj/item/what, mob/who) + return + /mob/proc/pull_damage() if(ishuman(src)) diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm index c3f7b695ef5..5b4811a0486 100644 --- a/code/modules/projectiles/targeting.dm +++ b/code/modules/projectiles/targeting.dm @@ -74,7 +74,7 @@ var/mob/living/M = loc if(M == T) return if(!istype(M)) return - if(src != M.equipped()) + if(src != M.get_active_hand()) stop_aim() return M.last_move_intent = world.time diff --git a/paradise.dme b/paradise.dme index 427b96b8d03..e6e46fa8d33 100644 --- a/paradise.dme +++ b/paradise.dme @@ -426,7 +426,6 @@ #include "code\game\machinery\machinery.dm" #include "code\game\machinery\magnet.dm" #include "code\game\machinery\mass_driver.dm" -#include "code\game\machinery\metaldetector.dm" #include "code\game\machinery\navbeacon.dm" #include "code\game\machinery\newscaster.dm" #include "code\game\machinery\OpTable.dm"