diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 492dba931b..4bd110015a 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -589,11 +589,11 @@ datum/mind var/obj/item/weapon/tome/T = new(H) var/list/slots = list ( - "backpack" = H.slot_in_backpack, - "left pocket" = H.slot_l_store, - "right pocket" = H.slot_r_store, - "left hand" = H.slot_l_hand, - "right hand" = H.slot_r_hand, + "backpack" = slot_in_backpack, + "left pocket" = slot_l_store, + "right pocket" = slot_r_store, + "left hand" = slot_l_hand, + "right hand" = slot_r_hand, ) var/where = H.equip_in_one_of_slots(T, slots) if (!where) @@ -1050,11 +1050,11 @@ datum/mind var/obj/item/weapon/tome/T = new(H) var/list/slots = list ( - "backpack" = H.slot_in_backpack, - "left pocket" = H.slot_l_store, - "right pocket" = H.slot_r_store, - "left hand" = H.slot_l_hand, - "right hand" = H.slot_r_hand, + "backpack" = slot_in_backpack, + "left pocket" = slot_l_store, + "right pocket" = slot_r_store, + "left hand" = slot_l_hand, + "right hand" = slot_r_hand, ) var/where = H.equip_in_one_of_slots(T, slots) if (!where) diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 233c0e9f9b..1942aa37bb 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -90,22 +90,6 @@ //This list tracks characters spawned in the world and cannot be modified in-game. Currently referenced by respawn_character(). var/locked[] = list() -/obj/effect/equip_e - name = "equip e" - var/mob/source = null - var/s_loc = null - var/t_loc = null - var/obj/item/item = null - var/place = null - -/obj/effect/equip_e/human - name = "human" - var/mob/living/carbon/human/target = null - -/obj/effect/equip_e/monkey - name = "monkey" - var/mob/living/carbon/monkey/target = null - /obj/effect/sign/securearea desc = "A warning sign which reads 'SECURE AREA'. This obviously applies to a nun-Clown." name = "SECURE AREA" @@ -345,6 +329,181 @@ var/armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) var/list/allowed = null //suit storage stuff. +//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(ishuman(M)) + //START HUMAN + var/mob/living/carbon/human/H = M + + if(FAT in H.mutations) + 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_ears) + if(H.ears) + return 0 + if( !(slot_flags & SLOT_EARS) ) + 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_l_store) + 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(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(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( 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_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 HUMAN + + else if(ismonkey(M)) + //START MONKEY + var/mob/living/carbon/monkey/MO = M + switch(slot) + if(slot_l_hand) + if(MO.l_hand) + return 0 + return 1 + if(slot_r_hand) + if(MO.r_hand) + return 0 + return 1 + if(slot_wear_mask) + if(MO.wear_mask) + return 0 + if( !(slot_flags & SLOT_MASK) ) + return 0 + return 1 + if(slot_back) + if(MO.back) + return 0 + if( !(slot_flags & SLOT_BACK) ) + return 0 + return 1 + return 0 //Unsupported slot + + //END MONKEY + + /obj/item/verb/verb_pickup() set src in oview(1) set category = "Object" diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index f609339451..f973540303 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -135,11 +135,11 @@ var/obj/item/weapon/paper/talisman/supply/T = new(mob) var/list/slots = list ( - "backpack" = mob.slot_in_backpack, - "left pocket" = mob.slot_l_store, - "right pocket" = mob.slot_r_store, - "left hand" = mob.slot_l_hand, - "right hand" = mob.slot_r_hand, + "backpack" = slot_in_backpack, + "left pocket" = slot_l_store, + "right pocket" = slot_r_store, + "left hand" = slot_l_hand, + "right hand" = slot_r_hand, ) var/where = mob.equip_in_one_of_slots(T, slots) if (!where) diff --git a/code/game/gamemodes/events/space_ninja.dm b/code/game/gamemodes/events/space_ninja.dm index 2e4e3b1818..5fc72ca1ba 100644 --- a/code/game/gamemodes/events/space_ninja.dm +++ b/code/game/gamemodes/events/space_ninja.dm @@ -485,20 +485,20 @@ As such, it's hard-coded for now. No reason for it not to be, really. del(gloves) var/obj/item/device/radio/R = new /obj/item/device/radio/headset(src) - equip_if_possible(R, slot_ears) + equip_to_slot_or_del(R, slot_ears) if(gender==FEMALE) - equip_if_possible(new /obj/item/clothing/under/color/blackf(src), slot_w_uniform) + equip_to_slot_or_del(new /obj/item/clothing/under/color/blackf(src), slot_w_uniform) else - equip_if_possible(new /obj/item/clothing/under/color/black(src), slot_w_uniform) - equip_if_possible(new /obj/item/clothing/shoes/space_ninja(src), slot_shoes) - equip_if_possible(new /obj/item/clothing/suit/space/space_ninja(src), slot_wear_suit) - equip_if_possible(new /obj/item/clothing/gloves/space_ninja(src), slot_gloves) - equip_if_possible(new /obj/item/clothing/head/helmet/space/space_ninja(src), slot_head) - equip_if_possible(new /obj/item/clothing/mask/gas/voice/space_ninja(src), slot_wear_mask) - equip_if_possible(new /obj/item/device/flashlight(src), slot_belt) - equip_if_possible(new /obj/item/weapon/plastique(src), slot_r_store) - equip_if_possible(new /obj/item/weapon/plastique(src), slot_l_store) - equip_if_possible(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store) + equip_to_slot_or_del(new /obj/item/clothing/under/color/black(src), slot_w_uniform) + equip_to_slot_or_del(new /obj/item/clothing/shoes/space_ninja(src), slot_shoes) + equip_to_slot_or_del(new /obj/item/clothing/suit/space/space_ninja(src), slot_wear_suit) + equip_to_slot_or_del(new /obj/item/clothing/gloves/space_ninja(src), slot_gloves) + equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/space_ninja(src), slot_head) + equip_to_slot_or_del(new /obj/item/clothing/mask/gas/voice/space_ninja(src), slot_wear_mask) + equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_belt) + equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_r_store) + equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_l_store) + equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store) resistances += "alien_embryo" return 1 diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index 8665075e3b..03a97d14aa 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -185,7 +185,7 @@ else var/mob/living/carbon/human/H = synd_mind.current P.loc = H.loc - H.equip_if_possible(P, H.slot_r_store, 0) + H.equip_to_slot_or_del(P, slot_r_store, 0) H.update_icons() else @@ -219,21 +219,21 @@ var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate(synd_mob) R.set_frequency(radio_freq) - synd_mob.equip_if_possible(R, synd_mob.slot_ears) + synd_mob.equip_to_slot_or_del(R, slot_ears) - synd_mob.equip_if_possible(new /obj/item/clothing/under/syndicate(synd_mob), synd_mob.slot_w_uniform) - synd_mob.equip_if_possible(new /obj/item/clothing/shoes/black(synd_mob), synd_mob.slot_shoes) - synd_mob.equip_if_possible(new /obj/item/clothing/suit/armor/vest(synd_mob), synd_mob.slot_wear_suit) - synd_mob.equip_if_possible(new /obj/item/clothing/gloves/swat(synd_mob), synd_mob.slot_gloves) - synd_mob.equip_if_possible(new /obj/item/clothing/head/helmet/swat(synd_mob), synd_mob.slot_head) - synd_mob.equip_if_possible(new /obj/item/weapon/card/id/syndicate(synd_mob), synd_mob.slot_wear_id) - if(synd_mob.backbag == 2) synd_mob.equip_if_possible(new /obj/item/weapon/storage/backpack(synd_mob), synd_mob.slot_back) - if(synd_mob.backbag == 3) synd_mob.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(synd_mob), synd_mob.slot_back) - synd_mob.equip_if_possible(new /obj/item/ammo_magazine/a50(synd_mob), synd_mob.slot_in_backpack) - synd_mob.equip_if_possible(new /obj/item/ammo_magazine/a50(synd_mob), synd_mob.slot_in_backpack) - synd_mob.equip_if_possible(new /obj/item/weapon/reagent_containers/pill/cyanide(synd_mob), synd_mob.slot_in_backpack) - synd_mob.equip_if_possible(new /obj/item/weapon/gun/projectile/deagle(synd_mob), synd_mob.slot_belt) - synd_mob.equip_if_possible(new /obj/item/weapon/storage/box/engineer(synd_mob.back), synd_mob.slot_in_backpack) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(synd_mob), slot_w_uniform) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(synd_mob), slot_shoes) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(synd_mob), slot_wear_suit) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(synd_mob), slot_gloves) + synd_mob.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/swat(synd_mob), slot_head) + synd_mob.equip_to_slot_or_del(new /obj/item/weapon/card/id/syndicate(synd_mob), slot_wear_id) + if(synd_mob.backbag == 2) synd_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(synd_mob), slot_back) + if(synd_mob.backbag == 3) synd_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(synd_mob), slot_back) + synd_mob.equip_to_slot_or_del(new /obj/item/ammo_magazine/a50(synd_mob), slot_in_backpack) + synd_mob.equip_to_slot_or_del(new /obj/item/ammo_magazine/a50(synd_mob), slot_in_backpack) + synd_mob.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/pill/cyanide(synd_mob), slot_in_backpack) + synd_mob.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/deagle(synd_mob), slot_belt) + synd_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(synd_mob.back), slot_in_backpack) var/obj/item/weapon/implant/explosive/E = new/obj/item/weapon/implant/explosive(synd_mob) E.imp_in = synd_mob E.implanted = 1 diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index e263917a5d..fe03323c86 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -137,11 +137,11 @@ var/obj/item/device/flash/T = new(mob) var/list/slots = list ( - "backpack" = mob.slot_in_backpack, - "left pocket" = mob.slot_l_store, - "right pocket" = mob.slot_r_store, - "left hand" = mob.slot_l_hand, - "right hand" = mob.slot_r_hand, + "backpack" = slot_in_backpack, + "left pocket" = slot_l_store, + "right pocket" = slot_r_store, + "left hand" = slot_l_hand, + "right hand" = slot_r_hand, ) var/where = mob.equip_in_one_of_slots(T, slots) if (!where) diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index 9acf0c72f5..b0429b94bb 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -95,88 +95,88 @@ var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc) M.real_name = "Corpse" M.death() - M.equip_if_possible(new /obj/item/device/radio/headset/headset_eng(M), M.slot_ears) - M.equip_if_possible(new /obj/item/device/pda/engineering(M), M.slot_belt) - M.equip_if_possible(new /obj/item/clothing/under/rank/engineer(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/orange(M), M.slot_shoes) - // M.equip_if_possible(new /obj/item/weapon/storage/toolbox/mechanical(M), M.slot_l_hand) - M.equip_if_possible(new /obj/item/clothing/gloves/yellow(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/device/t_scanner(M), M.slot_r_store) - //M.equip_if_possible(new /obj/item/device/radio/headset(M), M.slot_ears) - M.equip_if_possible(new /obj/item/weapon/storage/backpack(M), M.slot_back) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/device/pda/engineering(M), slot_belt) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/engineer(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(M), slot_shoes) + // M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/yellow(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/t_scanner(M), slot_r_store) + //M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/mask/gas(M), M.slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/hardhat(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/hardhat(M), slot_head) else if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/welding(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/welding(M), slot_head) del(A) continue if (A.name == "Corpse-Engineer-Space") var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc) M.real_name = "Corpse" M.death() - M.equip_if_possible(new /obj/item/device/radio/headset/headset_eng(M), M.slot_ears) - M.equip_if_possible(new /obj/item/weapon/tank/emergency_oxygen(M), M.slot_belt) - M.equip_if_possible(new /obj/item/clothing/under/rank/engineer(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/orange(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/suit/space(M), M.slot_wear_suit) - // M.equip_if_possible(new /obj/item/weapon/storage/toolbox/mechanical(M), M.slot_l_hand) - M.equip_if_possible(new /obj/item/clothing/gloves/yellow(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/device/t_scanner(M), M.slot_r_store) - M.equip_if_possible(new /obj/item/weapon/storage/backpack(M), M.slot_back) - M.equip_if_possible(new /obj/item/clothing/mask/gas(M), M.slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen(M), slot_belt) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/engineer(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/space(M), slot_wear_suit) + // M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/yellow(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/t_scanner(M), slot_r_store) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/hardhat(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/hardhat(M), slot_head) else if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/welding(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/welding(M), slot_head) else - M.equip_if_possible(new /obj/item/clothing/head/helmet/space(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space(M), slot_head) del(A) continue if (A.name == "Corpse-Engineer-Chief") var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc) M.real_name = "Corpse" M.death() - M.equip_if_possible(new /obj/item/device/radio/headset/headset_eng(M), M.slot_ears) - M.equip_if_possible(new /obj/item/weapon/storage/utilitybelt(M), M.slot_belt) - M.equip_if_possible(new /obj/item/clothing/under/rank/chief_engineer(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/orange(M), M.slot_shoes) - // M.equip_if_possible(new /obj/item/weapon/storage/toolbox/mechanical(M), M.slot_l_hand) - M.equip_if_possible(new /obj/item/clothing/gloves/yellow(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/device/t_scanner(M), M.slot_r_store) - M.equip_if_possible(new /obj/item/weapon/storage/backpack(M), M.slot_back) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/utilitybelt(M), slot_belt) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chief_engineer(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(M), slot_shoes) + // M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/yellow(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/t_scanner(M), slot_r_store) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/mask/gas(M), M.slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/hardhat(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/hardhat(M), slot_head) else if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/welding(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/welding(M), slot_head) del(A) continue if (A.name == "Corpse-Syndicate") var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc) M.real_name = "Corpse" M.death() - M.equip_if_possible(new /obj/item/device/radio/headset(M), M.slot_ears) - //M.equip_if_possible(new /obj/item/weapon/gun/revolver(M), M.slot_belt) - M.equip_if_possible(new /obj/item/clothing/under/syndicate(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/black(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/swat(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/weapon/tank/jetpack(M), M.slot_back) - M.equip_if_possible(new /obj/item/clothing/mask/gas(M), M.slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_ears) + //M.equip_to_slot_or_del(new /obj/item/weapon/gun/revolver(M), slot_belt) + M.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/weapon/tank/jetpack(M), slot_back) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/suit/space/syndicate(M), M.slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/syndicate(M), slot_wear_suit) if (prob(50)) - M.equip_if_possible(new /obj/item/clothing/head/helmet/swat(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/swat(M), slot_head) else - M.equip_if_possible(new /obj/item/clothing/head/helmet/space/syndicate(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/syndicate(M), slot_head) else - M.equip_if_possible(new /obj/item/clothing/suit/armor/vest(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/clothing/head/helmet/swat(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/swat(M), slot_head) del(A) continue */ diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index 0cd148e767..1fe84641bc 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -162,17 +162,17 @@ del(wizard_mob.r_store) del(wizard_mob.l_store) - wizard_mob.equip_if_possible(new /obj/item/device/radio/headset(wizard_mob), wizard_mob.slot_ears) - wizard_mob.equip_if_possible(new /obj/item/clothing/under/lightpurple(wizard_mob), wizard_mob.slot_w_uniform) - wizard_mob.equip_if_possible(new /obj/item/clothing/shoes/sandal(wizard_mob), wizard_mob.slot_shoes) - wizard_mob.equip_if_possible(new /obj/item/clothing/suit/wizrobe(wizard_mob), wizard_mob.slot_wear_suit) - wizard_mob.equip_if_possible(new /obj/item/clothing/head/wizard(wizard_mob), wizard_mob.slot_head) - if(wizard_mob.backbag == 2) wizard_mob.equip_if_possible(new /obj/item/weapon/storage/backpack(wizard_mob), wizard_mob.slot_back) - if(wizard_mob.backbag == 3) wizard_mob.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(wizard_mob), wizard_mob.slot_back) - wizard_mob.equip_if_possible(new /obj/item/weapon/storage/box(wizard_mob), wizard_mob.slot_in_backpack) -// wizard_mob.equip_if_possible(new /obj/item/weapon/scrying_gem(wizard_mob), wizard_mob.slot_l_store) For scrying gem. - wizard_mob.equip_if_possible(new /obj/item/weapon/teleportation_scroll(wizard_mob), wizard_mob.slot_r_store) - wizard_mob.equip_if_possible(new /obj/item/weapon/spellbook(wizard_mob), wizard_mob.slot_r_hand) + wizard_mob.equip_to_slot_or_del(new /obj/item/device/radio/headset(wizard_mob), slot_ears) + wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/under/lightpurple(wizard_mob), slot_w_uniform) + wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(wizard_mob), slot_shoes) + wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe(wizard_mob), slot_wear_suit) + wizard_mob.equip_to_slot_or_del(new /obj/item/clothing/head/wizard(wizard_mob), slot_head) + if(wizard_mob.backbag == 2) wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(wizard_mob), slot_back) + if(wizard_mob.backbag == 3) wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(wizard_mob), slot_back) + wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/storage/box(wizard_mob), slot_in_backpack) +// wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/scrying_gem(wizard_mob), slot_l_store) For scrying gem. + wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/teleportation_scroll(wizard_mob), slot_r_store) + wizard_mob.equip_to_slot_or_del(new /obj/item/weapon/spellbook(wizard_mob), slot_r_hand) wizard_mob << "You will find a list of available spells in your spell book. Choose your magic arsenal carefully." wizard_mob << "In your pockets you will find a teleport scroll. Use it as needed." diff --git a/code/game/jobs/job/assistant.dm b/code/game/jobs/job/assistant.dm index af9d8b193c..5a68cf9e18 100644 --- a/code/game/jobs/job/assistant.dm +++ b/code/game/jobs/job/assistant.dm @@ -10,6 +10,6 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/clothing/under/color/grey(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) return 1 diff --git a/code/game/jobs/job/captain.dm b/code/game/jobs/job/captain.dm index dbc9d978e7..ad2d35a89f 100644 --- a/code/game/jobs/job/captain.dm +++ b/code/game/jobs/job/captain.dm @@ -12,21 +12,21 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/heads/captain(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/captain(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_cap(H), H.slot_back) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/clothing/under/rank/captain(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/device/pda/captain(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/armor/captain(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/head/caphat(H), H.slot_head) - H.equip_if_possible(new /obj/item/clothing/mask/cigarette/cigar(H), H.slot_wear_mask) - H.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(H), H.slot_glasses) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/captain(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_cap(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/captain(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/pda/captain(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/captain(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/head/caphat(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar(H), slot_wear_mask) + H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(H), slot_glasses) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/id_kit(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/id_kit(H.back), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H.back), slot_in_backpack) var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) L.imp_in = H L.implanted = 1 @@ -49,17 +49,17 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/heads/hop(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(H), H.slot_back) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/clothing/under/rank/head_of_personnel(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/heads/hop(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/armor/vest(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/head/helmet(H), H.slot_head) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hop(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/head_of_personnel(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/heads/hop(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet(H), slot_head) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/id_kit(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/id_kit(H.back), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/id_kit(H.back), slot_in_backpack) return 1 diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm index 258a0768fe..9f1ac89d7f 100644 --- a/code/game/jobs/job/civilian.dm +++ b/code/game/jobs/job/civilian.dm @@ -12,26 +12,26 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/suit/armor/vest(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/under/rank/bartender(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/device/pda/bar(H), H.slot_belt) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/bartender(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/pda/bar(H), slot_belt) if(H.backbag == 1) var/obj/item/weapon/storage/box/survival/Barpack = new /obj/item/weapon/storage/box/survival(H) - H.equip_if_possible(Barpack, H.slot_r_hand) + H.equip_to_slot_or_del(Barpack, slot_r_hand) new /obj/item/ammo_casing/shotgun/beanbag(Barpack) new /obj/item/ammo_casing/shotgun/beanbag(Barpack) new /obj/item/ammo_casing/shotgun/beanbag(Barpack) new /obj/item/ammo_casing/shotgun/beanbag(Barpack) else - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/ammo_casing/shotgun/beanbag(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/ammo_casing/shotgun/beanbag(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/ammo_casing/shotgun/beanbag(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/ammo_casing/shotgun/beanbag(H), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/ammo_casing/shotgun/beanbag(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/ammo_casing/shotgun/beanbag(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/ammo_casing/shotgun/beanbag(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/ammo_casing/shotgun/beanbag(H), slot_in_backpack) return 1 @@ -50,11 +50,11 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/clothing/under/rank/chef(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/chef(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/head/chefhat(H), H.slot_head) - H.equip_if_possible(new /obj/item/device/pda/chef(H), H.slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chef(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/chef(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/head/chefhat(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/device/pda/chef(H), slot_belt) return 1 @@ -72,12 +72,12 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/clothing/under/rank/hydroponics(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/gloves/botanic_leather(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/clothing/suit/apron(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/device/analyzer/plant_analyzer(H), H.slot_s_store) - H.equip_if_possible(new /obj/item/device/pda/botanist(H), H.slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/hydroponics(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/botanic_leather(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/apron(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/device/analyzer/plant_analyzer(H), slot_s_store) + H.equip_to_slot_or_del(new /obj/item/device/pda/botanist(H), slot_belt) return 1 @@ -96,13 +96,13 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/heads/qm(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/under/rank/cargo(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/quartermaster(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/gloves/black(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(H), H.slot_glasses) - H.equip_if_possible(new /obj/item/weapon/clipboard(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/qm(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/cargo(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/quartermaster(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(H), slot_glasses) + H.equip_to_slot_or_del(new /obj/item/weapon/clipboard(H), slot_l_hand) return 1 @@ -120,11 +120,11 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_cargo(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/under/rank/cargotech(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/cargo(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/gloves/black(H), H.slot_gloves) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_cargo(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/cargotech(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/cargo(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) return 1 @@ -142,21 +142,21 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_mine (H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/industrial (H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_eng(H), H.slot_back) - H.equip_if_possible(new /obj/item/device/pda/shaftminer(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/under/rank/miner(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/gloves/black(H), H.slot_gloves) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_mine (H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/industrial (H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_eng(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/device/pda/shaftminer(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/miner(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/engineer(H), H.slot_r_hand) - H.equip_if_possible(new /obj/item/weapon/crowbar(H), H.slot_l_hand) - H.equip_if_possible(new /obj/item/weapon/satchel(H), H.slot_l_store) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H), slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/crowbar(H), slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/satchel(H), slot_l_store) else - H.equip_if_possible(new /obj/item/weapon/storage/box/engineer(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/crowbar(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/satchel(H), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/crowbar(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/satchel(H), slot_in_backpack) return 1 @@ -175,17 +175,17 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/weapon/storage/backpack/clown(H), H.slot_back) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/clothing/under/rank/clown(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/clown_shoes(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/clown(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/mask/gas/clown_hat(H), H.slot_wear_mask) - H.equip_if_possible(new /obj/item/weapon/reagent_containers/food/snacks/grown/banana(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/bikehorn(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/stamp/clown(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/toy/crayon/rainbow(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/storage/crayonbox(H), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/clown(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/clown(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/clown_shoes(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/clown(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/clown_hat(H), slot_wear_mask) + H.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/snacks/grown/banana(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/bikehorn(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/stamp/clown(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/toy/crayon/rainbow(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/crayonbox(H), slot_in_backpack) H.mutations.Add(CLUMSY) return 1 @@ -204,23 +204,23 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/mime(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/mime(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/gloves/white(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/clothing/mask/gas/mime(H), H.slot_wear_mask) - H.equip_if_possible(new /obj/item/clothing/head/beret(H), H.slot_head) - H.equip_if_possible(new /obj/item/clothing/suit/suspenders(H), H.slot_wear_suit) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/mime(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/mime(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/white(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/mime(H), slot_wear_mask) + H.equip_to_slot_or_del(new /obj/item/clothing/head/beret(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/suspenders(H), slot_wear_suit) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H), H.slot_r_hand) - H.equip_if_possible(new /obj/item/toy/crayon/mime(H), H.slot_l_store) - H.equip_if_possible(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/toy/crayon/mime(H), slot_l_store) + H.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), slot_l_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/toy/crayon/mime(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/toy/crayon/mime(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), slot_in_backpack) H.verbs += /client/proc/mimespeak H.verbs += /client/proc/mimewall H.mind.special_verbs += /client/proc/mimespeak @@ -243,9 +243,9 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/clothing/under/rank/janitor(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/janitor(H), H.slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/janitor(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/janitor(H), slot_belt) return 1 @@ -264,10 +264,10 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/clothing/under/suit_jacket/red(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/device/pda/librarian(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/weapon/barcodescanner(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket/red(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/pda/librarian(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/weapon/barcodescanner(H), slot_l_hand) return 1 @@ -286,22 +286,22 @@ var/global/lawyer = 0//Checks for another lawyer equip(var/mob/living/carbon/human/H) if(!H) return 0 - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(H), H.slot_back) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) if(!lawyer) lawyer = 1 - H.equip_if_possible(new /obj/item/clothing/under/lawyer/bluesuit(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/lawyer/bluejacket(H), H.slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/under/lawyer/bluesuit(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/lawyer/bluejacket(H), slot_wear_suit) else - H.equip_if_possible(new /obj/item/clothing/under/lawyer/purpsuit(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/suit/lawyer/purpjacket(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/lawyer(H), H.slot_belt) - H.equip_if_possible(new /obj/item/weapon/storage/briefcase(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/clothing/under/lawyer/purpsuit(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/lawyer/purpjacket(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/lawyer(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/briefcase(H), slot_l_hand) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) return 1 diff --git a/code/game/jobs/job/civilian_chaplain.dm b/code/game/jobs/job/civilian_chaplain.dm index 2f4a7d964b..95d4f82b95 100644 --- a/code/game/jobs/job/civilian_chaplain.dm +++ b/code/game/jobs/job/civilian_chaplain.dm @@ -14,10 +14,10 @@ if(!H) return 0 var/obj/item/weapon/storage/bible/B = new /obj/item/weapon/storage/bible/booze(H) - H.equip_if_possible(B, H.slot_l_hand) - H.equip_if_possible(new /obj/item/device/pda/chaplain(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/under/rank/chaplain(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) + H.equip_to_slot_or_del(B, slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/pda/chaplain(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chaplain(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) spawn(0) var/religion_name = "Christianity" var/new_religion = copytext(sanitize(input(H, "You are the Chaplain. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name)),1,MAX_NAME_LEN) diff --git a/code/game/jobs/job/engineering.dm b/code/game/jobs/job/engineering.dm index c0c3136c9e..605033f780 100644 --- a/code/game/jobs/job/engineering.dm +++ b/code/game/jobs/job/engineering.dm @@ -12,22 +12,22 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/heads/ce(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/industrial (H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_eng(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/chief_engineer(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/device/pda/heads/ce(H), H.slot_l_store) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/head/hardhat/white(H), H.slot_head) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/ce(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/industrial (H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_eng(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chief_engineer(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/pda/heads/ce(H), slot_l_store) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/head/hardhat/white(H), slot_head) var/obj/item/clothing/mask/cigarette/CIG = new /obj/item/clothing/mask/cigarette(H) CIG.light("") - H.equip_if_possible(CIG, H.slot_wear_mask) - H.equip_if_possible(new /obj/item/weapon/storage/belt/utility/full(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/gloves/black(H), H.slot_gloves) + H.equip_to_slot_or_del(CIG, slot_wear_mask) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/engineer(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/box/engineer(H.back), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H.back), slot_in_backpack) return 1 @@ -45,19 +45,19 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_eng(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/industrial(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_eng(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/engineer(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/orange(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/weapon/storage/belt/utility/full(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/head/hardhat(H), H.slot_head) - H.equip_if_possible(new /obj/item/device/t_scanner(H), H.slot_r_store) - H.equip_if_possible(new /obj/item/device/pda/engineering(H), H.slot_l_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/industrial(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_eng(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/engineer(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/head/hardhat(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/device/t_scanner(H), slot_r_store) + H.equip_to_slot_or_del(new /obj/item/device/pda/engineering(H), slot_l_store) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/engineer(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/box/engineer(H.back), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H.back), slot_in_backpack) return 1 @@ -75,17 +75,17 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_eng(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/atmospheric_technician(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/atmos(H), H.slot_l_store) - H.equip_if_possible(new /obj/item/weapon/storage/belt/utility/atmostech/(H), H.slot_belt) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/atmospheric_technician(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/atmos(H), slot_l_store) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/atmostech/(H), slot_belt) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/engineer(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/box/engineer(H.back), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(H.back), slot_in_backpack) return 1 @@ -102,17 +102,17 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_rob(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/roboticist(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/roboticist(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/labcoat(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/gloves/black(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/weapon/storage/toolbox/mechanical(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_rob(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/roboticist(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/roboticist(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(H), slot_l_hand) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) return 1 \ No newline at end of file diff --git a/code/game/jobs/job/medical.dm b/code/game/jobs/job/medical.dm index 7dfd020a74..d85527f7b9 100644 --- a/code/game/jobs/job/medical.dm +++ b/code/game/jobs/job/medical.dm @@ -12,19 +12,19 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/heads/cmo(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/medic (H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_med(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/chief_medical_officer(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/heads/cmo(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/labcoat/cmo(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/weapon/storage/firstaid/regular(H), H.slot_l_hand) - H.equip_if_possible(new /obj/item/device/flashlight/pen(H), H.slot_s_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/cmo(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/medic (H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chief_medical_officer(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/heads/cmo(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat/cmo(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/regular(H), slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) return 1 @@ -42,19 +42,19 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_med(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/medic (H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_med(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/medical(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/white(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/medical(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/labcoat(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/weapon/storage/firstaid/regular(H), H.slot_l_hand) - H.equip_if_possible(new /obj/item/device/flashlight/pen(H), H.slot_s_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_med(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/medic (H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/regular(H), slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) return 1 @@ -73,11 +73,11 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_med(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/under/rank/chemist(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/white(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/chemist(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/labcoat/chemist(H), H.slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_med(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chemist(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/chemist(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat/chemist(H), slot_wear_suit) return 1 @@ -95,12 +95,12 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_medsci(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/under/rank/geneticist(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/white(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/geneticist(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/labcoat/genetics(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/device/flashlight/pen(H), H.slot_s_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_medsci(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/geneticist(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/geneticist(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat/genetics(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store) return 1 @@ -118,19 +118,19 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_med(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/medic (H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_med(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/virologist(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/device/pda/medical(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/mask/surgical(H), H.slot_wear_mask) - H.equip_if_possible(new /obj/item/clothing/shoes/white(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/suit/labcoat/virologist(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/device/flashlight/pen(H), H.slot_s_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_med(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/medic (H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/virologist(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/mask/surgical(H), slot_wear_mask) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat/virologist(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/device/flashlight/pen(H), slot_s_store) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) return 1 diff --git a/code/game/jobs/job/science.dm b/code/game/jobs/job/science.dm index fc8ae02529..83bf8f9025 100644 --- a/code/game/jobs/job/science.dm +++ b/code/game/jobs/job/science.dm @@ -12,12 +12,12 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/heads/rd(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/clothing/under/rank/research_director(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/device/pda/heads/rd(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/labcoat(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/weapon/clipboard(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/rd(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/research_director(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/pda/heads/rd(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/weapon/clipboard(H), slot_l_hand) return 1 @@ -35,11 +35,11 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_sci(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/under/rank/scientist(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/white(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/toxins(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/labcoat/science(H), H.slot_wear_suit) -// H.equip_if_possible(new /obj/item/clothing/mask/gas(H), H.slot_wear_mask) -// H.equip_if_possible(new /obj/item/weapon/tank/oxygen(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sci(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/scientist(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/toxins(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/labcoat/science(H), slot_wear_suit) +// H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(H), slot_wear_mask) +// H.equip_to_slot_or_del(new /obj/item/weapon/tank/oxygen(H), slot_l_hand) return 1 \ No newline at end of file diff --git a/code/game/jobs/job/security.dm b/code/game/jobs/job/security.dm index 7ce8ce1778..e14f79ccbb 100644 --- a/code/game/jobs/job/security.dm +++ b/code/game/jobs/job/security.dm @@ -12,24 +12,24 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/security (H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_sec(H), H.slot_back) - H.equip_if_possible(new /obj/item/device/radio/headset/heads/hos(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/under/rank/head_of_security(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/jackboots(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/heads/hos(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/armor/hos(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/gloves/black(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/clothing/head/helmet/HoS(H), H.slot_head) -// H.equip_if_possible(new /obj/item/clothing/mask/gas(H), H.slot_wear_mask) //Grab one from the armory you donk - H.equip_if_possible(new /obj/item/clothing/glasses/sunglasses/sechud(H), H.slot_glasses) - H.equip_if_possible(new /obj/item/weapon/gun/energy/gun(H), H.slot_s_store) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security (H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hos(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/head_of_security(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/heads/hos(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/hos(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/HoS(H), slot_head) +// H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(H), slot_wear_mask) //Grab one from the armory you donk + H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses/sechud(H), slot_glasses) + H.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/gun(H), slot_s_store) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H), H.slot_r_hand) - H.equip_if_possible(new /obj/item/weapon/handcuffs(H), H.slot_l_store) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_l_store) else - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/handcuffs(H), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack) var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) L.imp_in = H L.implanted = 1 @@ -50,24 +50,24 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_sec(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/security(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_sec(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/warden(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/jackboots(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/warden(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/armor/vest/warden(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/head/helmet/warden(H), H.slot_head) - H.equip_if_possible(new /obj/item/clothing/gloves/black(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/clothing/glasses/sunglasses/sechud(H), H.slot_glasses) -// H.equip_if_possible(new /obj/item/clothing/mask/gas(H), H.slot_wear_mask) //Grab one from the armory you donk - H.equip_if_possible(new /obj/item/device/flash(H), H.slot_l_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/warden(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/warden(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest/warden(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/warden(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses/sechud(H), slot_glasses) +// H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(H), slot_wear_mask) //Grab one from the armory you donk + H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H), H.slot_r_hand) - H.equip_if_possible(new /obj/item/weapon/handcuffs(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_l_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/handcuffs(H), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack) var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) L.imp_in = H L.implanted = 1 @@ -88,31 +88,31 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_sec(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_norm(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/det(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/brown(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/detective(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/head/det_hat(H), H.slot_head) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/det(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/detective(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/head/det_hat(H), slot_head) var/obj/item/clothing/mask/cigarette/CIG = new /obj/item/clothing/mask/cigarette(H) CIG.light("") - H.equip_if_possible(CIG, H.slot_wear_mask) - H.equip_if_possible(new /obj/item/clothing/gloves/black(H), H.slot_gloves) - H.equip_if_possible(new /obj/item/clothing/suit/det_suit(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/weapon/lighter/zippo(H), H.slot_l_store) + H.equip_to_slot_or_del(CIG, slot_wear_mask) + H.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(H), slot_gloves) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/det_suit(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/weapon/lighter/zippo(H), slot_l_store) if(H.backbag == 1)//Why cant some of these things spawn in his office? var/obj/item/weapon/storage/box/survival/Evipack = new /obj/item/weapon/storage/box/survival(H) - H.equip_if_possible(Evipack, H.slot_r_hand) + H.equip_to_slot_or_del(Evipack, slot_r_hand) new /obj/item/weapon/fcardholder(Evipack) - H.equip_if_possible(new /obj/item/weapon/storage/box/evidence(H), H.slot_l_hand) - H.equip_if_possible(new /obj/item/device/detective_scanner(H), H.slot_r_store) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/evidence(H), slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/device/detective_scanner(H), slot_r_store) else - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/fcardholder(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/storage/box/evidence(H), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/device/detective_scanner(H), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/fcardholder(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/evidence(H), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/device/detective_scanner(H), slot_in_backpack) var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) L.imp_in = H @@ -134,22 +134,22 @@ equip(var/mob/living/carbon/human/H) if(!H) return 0 - H.equip_if_possible(new /obj/item/device/radio/headset/headset_sec(H), H.slot_ears) - if(H.backbag == 2) H.equip_if_possible(new /obj/item/weapon/storage/backpack/security(H), H.slot_back) - if(H.backbag == 3) H.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel_sec(H), H.slot_back) - H.equip_if_possible(new /obj/item/clothing/under/rank/security(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/jackboots(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/device/pda/security(H), H.slot_belt) - H.equip_if_possible(new /obj/item/clothing/suit/armor/vest(H), H.slot_wear_suit) - H.equip_if_possible(new /obj/item/clothing/head/helmet(H), H.slot_head) - H.equip_if_possible(new /obj/item/weapon/handcuffs(H), H.slot_s_store) - H.equip_if_possible(new /obj/item/device/flash(H), H.slot_l_store) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears) + if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(H), slot_back) + if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back) + H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/jackboots(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/device/pda/security(H), slot_belt) + H.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(H), slot_wear_suit) + H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_s_store) + H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store) if(H.backbag == 1) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H), H.slot_r_hand) - H.equip_if_possible(new /obj/item/weapon/handcuffs(H), H.slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_l_hand) else - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H.back), H.slot_in_backpack) - H.equip_if_possible(new /obj/item/weapon/handcuffs(H), H.slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) + H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack) var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H) L.imp_in = H L.implanted = 1 diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index ba3589aa9f..fdfb0468b1 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -322,21 +322,21 @@ var/global/datum/controller/occupations/job_master else switch(H.backbag) if(1) - H.equip_if_possible(new /obj/item/weapon/storage/box/survival(H), H.slot_r_hand) + H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand) if(2) var/obj/item/weapon/storage/backpack/BPK = new/obj/item/weapon/storage/backpack(H) new /obj/item/weapon/storage/box/survival(BPK) - H.equip_if_possible(BPK, H.slot_back,1) + H.equip_to_slot_or_del(BPK, slot_back,1) if(3) var/obj/item/weapon/storage/backpack/BPK = new/obj/item/weapon/storage/backpack/satchel_norm(H) new /obj/item/weapon/storage/box/survival(BPK) - H.equip_if_possible(BPK, H.slot_back,1) + H.equip_to_slot_or_del(BPK, slot_back,1) H << "You are the [rank]." H << "As the [rank] you answer directly to [job.supervisors]. Special circumstances may change this." spawnId(H,rank) - H.equip_if_possible(new /obj/item/device/radio/headset(H), H.slot_ears) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset(H), slot_ears) // H.update_icons() return 1 @@ -363,12 +363,12 @@ var/global/datum/controller/occupations/job_master C.assignment = rank C.name = "[C.registered_name]'s ID Card ([C.assignment])" C.access = get_access(C.assignment) - H.equip_if_possible(C, H.slot_wear_id) + H.equip_to_slot_or_del(C, slot_wear_id) if(prob(50)) - H.equip_if_possible(new /obj/item/weapon/pen(H), H.slot_r_store) + H.equip_to_slot_or_del(new /obj/item/weapon/pen(H), slot_r_store) else - H.equip_if_possible(new /obj/item/weapon/pen/blue(H), H.slot_r_store) - H.equip_if_possible(new /obj/item/device/pda(H), H.slot_belt) + H.equip_to_slot_or_del(new /obj/item/weapon/pen/blue(H), slot_r_store) + H.equip_to_slot_or_del(new /obj/item/device/pda(H), slot_belt) if(locate(/obj/item/device/pda,H))//I bet this could just use locate. It can --SkyMarshal var/obj/item/device/pda/pda = locate(/obj/item/device/pda,H) pda.owner = H.real_name diff --git a/code/game/magic/cultist/runes.dm b/code/game/magic/cultist/runes.dm index 4255eb3192..8ebce05c97 100644 --- a/code/game/magic/cultist/runes.dm +++ b/code/game/magic/cultist/runes.dm @@ -1023,10 +1023,10 @@ var/list/sacrificed = list() usr.visible_message("\red The rune disappears with a flash of red light, and a set of armor appears on [usr]...", \ "\red You are blinded by the flash of red light! After you're able to see again, you see that you are now wearing a set of armor.") - user.equip_if_possible(new /obj/item/clothing/head/culthood/alt(user), user.slot_head) - user.equip_if_possible(new /obj/item/clothing/suit/cultrobes/alt(user), user.slot_wear_suit) - user.equip_if_possible(new /obj/item/clothing/shoes/cult(user), user.slot_shoes) - user.equip_if_possible(new /obj/item/weapon/storage/backpack/cultpack(user), user.slot_back) + user.equip_to_slot_or_del(new /obj/item/clothing/head/culthood/alt(user), slot_head) + user.equip_to_slot_or_del(new /obj/item/clothing/suit/cultrobes/alt(user), slot_wear_suit) + user.equip_to_slot_or_del(new /obj/item/clothing/shoes/cult(user), slot_shoes) + user.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/cultpack(user), slot_back) //the above update their overlay icons cache but do not call update_icons() //the below calls update_icons() at the end, which will update overlay icons by using the (now updated) cache user.put_in_hands(new /obj/item/weapon/melee/cultblade(user)) //put in hands or on floor diff --git a/code/game/objects/items/item.dm b/code/game/objects/items/item.dm index 240f532934..5650c3e027 100644 --- a/code/game/objects/items/item.dm +++ b/code/game/objects/items/item.dm @@ -17,14 +17,11 @@ // called after an item is placed in an equipment slot // user is mob that equipped it -// slot is text of slot type e.g. "head" +// slot uses the slot_X defines found in setup.dm // for items that can be placed in multiple slots // note this isn't called during the initial dressing of a player /obj/item/proc/equipped(var/mob/user, var/slot) return -// -// ***TODO: implement unget_active_hand() -// /obj/item/proc/afterattack() diff --git a/code/game/objects/items/tk_grab.dm b/code/game/objects/items/tk_grab.dm index 20ecfc4855..654c6e7e06 100644 --- a/code/game/objects/items/tk_grab.dm +++ b/code/game/objects/items/tk_grab.dm @@ -22,7 +22,7 @@ //stops TK grabs being equipped anywhere but into hands equipped(var/mob/user, var/slot) - if( (slot=="l_hand") || (slot=="r_hand") ) return + if( (slot == slot_l_hand) || (slot== slot_r_hand) ) return del(src) return @@ -115,7 +115,7 @@ return 1 */ -//equip_if_possible(obj/item/W, slot, del_on_fail = 1) +//equip_to_slot_or_del(obj/item/W, slot, del_on_fail = 1) /* if(istype(user, /mob/living/carbon)) if(user:mutations & TK && get_dist(source, user) <= 7) diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 0c14166dd3..ea8ddc2812 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -23,6 +23,14 @@ name = "[initial(name)] (Wielded)" update_icon() +/obj/item/weapon/twohanded/mob_can_equip(M as mob, slot) + //Cannot equip wielded items. + if(wielded) + M << "Unwield the [initial(name)] first!" + return 0 + + return ..() + /obj/item/weapon/twohanded/dropped(mob/user as mob) //handles unwielding a twohanded weapon when dropped as well as clearing up the offhand if(user) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 8a78c04ca2..a87a6e45f0 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -833,8 +833,8 @@ var/global/BSACooldown = 0 M.loc = pick(prisonwarp) if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/prisoner = M - prisoner.equip_if_possible(new /obj/item/clothing/under/color/orange(prisoner), prisoner.slot_w_uniform) - prisoner.equip_if_possible(new /obj/item/clothing/shoes/orange(prisoner), prisoner.slot_shoes) + prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(prisoner), slot_w_uniform) + prisoner.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(prisoner), slot_shoes) spawn(50) M << "\red You have been sent to the prison station!" log_admin("[key_name(usr)] sent [key_name(M)] to the prison station.") @@ -984,8 +984,8 @@ var/global/BSACooldown = 0 W.layer = initial(W.layer) if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/observer = M - observer.equip_if_possible(new /obj/item/clothing/under/suit_jacket(observer), observer.slot_w_uniform) - observer.equip_if_possible(new /obj/item/clothing/shoes/black(observer), observer.slot_shoes) + observer.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket(observer), slot_w_uniform) + observer.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(observer), slot_shoes) M.Paralyse(5) sleep(5) M.loc = pick(tdomeobserve) @@ -1220,9 +1220,9 @@ var/global/BSACooldown = 0 var/mob/M = locate(href_list["adminspawncookie"]) if(M && ishuman(M)) var/mob/living/carbon/human/H = M - H.equip_if_possible( new /obj/item/weapon/reagent_containers/food/snacks/cookie(H), H.slot_l_hand ) + H.equip_to_slot_or_del( new /obj/item/weapon/reagent_containers/food/snacks/cookie(H), slot_l_hand ) if(!(istype(H.l_hand,/obj/item/weapon/reagent_containers/food/snacks/cookie))) - H.equip_if_possible( new /obj/item/weapon/reagent_containers/food/snacks/cookie(H), H.slot_r_hand ) + H.equip_to_slot_or_del( new /obj/item/weapon/reagent_containers/food/snacks/cookie(H), slot_r_hand ) if(!(istype(H.r_hand,/obj/item/weapon/reagent_containers/food/snacks/cookie))) log_admin("[key_name(H)] has their hands full, so they did not receive their cookie, spawned by [key_name(src.owner)].") message_admins("[key_name(H)] has their hands full, so they did not receive their cookie, spawned by [key_name(src.owner)].") @@ -1741,8 +1741,8 @@ var/global/BSACooldown = 0 W.layer = initial(W.layer) //teleport person to cell H.loc = pick(prisonwarp) - H.equip_if_possible(new /obj/item/clothing/under/color/orange(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/clothing/shoes/orange(H), H.slot_shoes) + H.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(H), slot_shoes) else //teleport security person H.loc = pick(prisonsecuritywarp) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index e16a3ec761..3242c3bb7e 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -379,7 +379,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that id.registered_name = H.real_name id.assignment = "Captain" id.name = "[id.registered_name]'s ID Card ([id.assignment])" - H.equip_if_possible(id, H.slot_wear_id) + H.equip_to_slot_or_del(id, slot_wear_id) H.update_inv_wear_id() else alert("Invalid mob") @@ -463,151 +463,151 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if ("strip") //do nothing if ("standard space gear") - M.equip_if_possible(new /obj/item/clothing/shoes/black(M), M.slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes) - M.equip_if_possible(new /obj/item/clothing/under/color/grey(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/suit/space(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/clothing/head/helmet/space(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/space(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space(M), slot_head) var /obj/item/weapon/tank/jetpack/J = new /obj/item/weapon/tank/jetpack/oxygen(M) - M.equip_if_possible(J, M.slot_back) + M.equip_to_slot_or_del(J, slot_back) J.toggle() - M.equip_if_possible(new /obj/item/clothing/mask/breath(M), M.slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/breath(M), slot_wear_mask) J.Topic(null, list("stat" = 1)) if ("tournament standard red","tournament standard green") //we think stunning weapon is too overpowered to use it on tournaments. --rastaf0 if (dresscode=="tournament standard red") - M.equip_if_possible(new /obj/item/clothing/under/color/red(M), M.slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/under/color/red(M), slot_w_uniform) else - M.equip_if_possible(new /obj/item/clothing/under/color/green(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/black(M), M.slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/under/color/green(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes) - M.equip_if_possible(new /obj/item/clothing/suit/armor/vest(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/clothing/head/helmet/thunderdome(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/thunderdome(M), slot_head) - M.equip_if_possible(new /obj/item/weapon/gun/energy/pulse_rifle/destroyer(M), M.slot_r_hand) - M.equip_if_possible(new /obj/item/weapon/kitchenknife(M), M.slot_l_hand) - M.equip_if_possible(new /obj/item/weapon/grenade/smokebomb(M), M.slot_r_store) + M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/destroyer(M), slot_r_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/kitchenknife(M), slot_l_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/grenade/smokebomb(M), slot_r_store) if ("tournament gangster") //gangster are supposed to fight each other. --rastaf0 - M.equip_if_possible(new /obj/item/clothing/under/det(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/black(M), M.slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/under/det(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes) - M.equip_if_possible(new /obj/item/clothing/suit/det_suit(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/clothing/glasses/thermal/monocle(M), M.slot_glasses) - M.equip_if_possible(new /obj/item/clothing/head/det_hat(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/det_suit(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(M), slot_glasses) + M.equip_to_slot_or_del(new /obj/item/clothing/head/det_hat(M), slot_head) - M.equip_if_possible(new /obj/item/weapon/cloaking_device(M), M.slot_r_store) + M.equip_to_slot_or_del(new /obj/item/weapon/cloaking_device(M), slot_r_store) - M.equip_if_possible(new /obj/item/weapon/gun/projectile(M), M.slot_r_hand) - M.equip_if_possible(new /obj/item/ammo_magazine/a357(M), M.slot_l_store) + M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile(M), slot_r_hand) + M.equip_to_slot_or_del(new /obj/item/ammo_magazine/a357(M), slot_l_store) if ("tournament chef") //Steven Seagal FTW - M.equip_if_possible(new /obj/item/clothing/under/rank/chef(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/suit/chef(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/clothing/shoes/black(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/head/chefhat(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chef(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/chef(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/head/chefhat(M), slot_head) - M.equip_if_possible(new /obj/item/weapon/kitchen/rollingpin(M), M.slot_r_hand) - M.equip_if_possible(new /obj/item/weapon/kitchenknife(M), M.slot_l_hand) - M.equip_if_possible(new /obj/item/weapon/kitchenknife(M), M.slot_r_store) - M.equip_if_possible(new /obj/item/weapon/kitchenknife(M), M.slot_s_store) + M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/rollingpin(M), slot_r_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/kitchenknife(M), slot_l_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/kitchenknife(M), slot_r_store) + M.equip_to_slot_or_del(new /obj/item/weapon/kitchenknife(M), slot_s_store) if ("tournament janitor") - M.equip_if_possible(new /obj/item/clothing/under/rank/janitor(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/black(M), M.slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/janitor(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes) var/obj/item/weapon/storage/backpack/backpack = new(M) for(var/obj/item/I in backpack) del(I) - M.equip_if_possible(backpack, M.slot_back) + M.equip_to_slot_or_del(backpack, slot_back) - M.equip_if_possible(new /obj/item/weapon/mop(M), M.slot_r_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/mop(M), slot_r_hand) var/obj/item/weapon/reagent_containers/glass/bucket/bucket = new(M) bucket.reagents.add_reagent("water", 70) - M.equip_if_possible(bucket, M.slot_l_hand) + M.equip_to_slot_or_del(bucket, slot_l_hand) - M.equip_if_possible(new /obj/item/weapon/grenade/chem_grenade/cleaner(M), M.slot_r_store) - M.equip_if_possible(new /obj/item/weapon/grenade/chem_grenade/cleaner(M), M.slot_l_store) - M.equip_if_possible(new /obj/item/stack/tile/plasteel(M), M.slot_in_backpack) - M.equip_if_possible(new /obj/item/stack/tile/plasteel(M), M.slot_in_backpack) - M.equip_if_possible(new /obj/item/stack/tile/plasteel(M), M.slot_in_backpack) - M.equip_if_possible(new /obj/item/stack/tile/plasteel(M), M.slot_in_backpack) - M.equip_if_possible(new /obj/item/stack/tile/plasteel(M), M.slot_in_backpack) - M.equip_if_possible(new /obj/item/stack/tile/plasteel(M), M.slot_in_backpack) - M.equip_if_possible(new /obj/item/stack/tile/plasteel(M), M.slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/weapon/grenade/chem_grenade/cleaner(M), slot_r_store) + M.equip_to_slot_or_del(new /obj/item/weapon/grenade/chem_grenade/cleaner(M), slot_l_store) + M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) if ("pirate") - M.equip_if_possible(new /obj/item/clothing/under/pirate(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/brown(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/head/bandana(M), M.slot_head) - M.equip_if_possible(new /obj/item/clothing/glasses/eyepatch(M), M.slot_glasses) - M.equip_if_possible(new /obj/item/weapon/melee/energy/sword/pirate(M), M.slot_r_hand) + M.equip_to_slot_or_del(new /obj/item/clothing/under/pirate(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/head/bandana(M), slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/eyepatch(M), slot_glasses) + M.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword/pirate(M), slot_r_hand) if ("space pirate") - M.equip_if_possible(new /obj/item/clothing/under/pirate(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/brown(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/suit/space/pirate(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/clothing/head/helmet/space/pirate(M), M.slot_head) - M.equip_if_possible(new /obj/item/clothing/glasses/eyepatch(M), M.slot_glasses) + M.equip_to_slot_or_del(new /obj/item/clothing/under/pirate(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/pirate(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/pirate(M), slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/eyepatch(M), slot_glasses) - M.equip_if_possible(new /obj/item/weapon/melee/energy/sword/pirate(M), M.slot_r_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword/pirate(M), slot_r_hand) /* if ("soviet soldier") - M.equip_if_possible(new /obj/item/clothing/under/soviet(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/black(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/head/ushanka(M), M.slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/under/soviet(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/head/ushanka(M), slot_head) */ if("tunnel clown")//Tunnel clowns rule! - M.equip_if_possible(new /obj/item/clothing/under/rank/clown(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/clown_shoes(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/black(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/clothing/mask/gas/clown_hat(M), M.slot_wear_mask) - M.equip_if_possible(new /obj/item/clothing/head/chaplain_hood(M), M.slot_head) - M.equip_if_possible(new /obj/item/device/radio/headset(M), M.slot_ears) - M.equip_if_possible(new /obj/item/clothing/glasses/thermal/monocle(M), M.slot_glasses) - M.equip_if_possible(new /obj/item/clothing/suit/chaplain_hoodie(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/weapon/reagent_containers/food/snacks/grown/banana(M), M.slot_l_store) - M.equip_if_possible(new /obj/item/weapon/bikehorn(M), M.slot_r_store) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/clown(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/clown_shoes(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/clown_hat(M), slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/clothing/head/chaplain_hood(M), slot_head) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(M), slot_glasses) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/chaplain_hoodie(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/snacks/grown/banana(M), slot_l_store) + M.equip_to_slot_or_del(new /obj/item/weapon/bikehorn(M), slot_r_store) var/obj/item/weapon/card/id/W = new(M) W.name = "[M.real_name]'s ID Card" W.access = get_all_accesses() W.assignment = "Tunnel Clown!" W.registered_name = M.real_name - M.equip_if_possible(W, M.slot_wear_id) + M.equip_to_slot_or_del(W, slot_wear_id) var/obj/item/weapon/twohanded/fireaxe/fire_axe = new(M) - M.equip_if_possible(fire_axe, M.slot_r_hand) + M.equip_to_slot_or_del(fire_axe, slot_r_hand) if("masked killer") - M.equip_if_possible(new /obj/item/clothing/under/overalls(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/white(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/latex(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/clothing/mask/surgical(M), M.slot_wear_mask) - M.equip_if_possible(new /obj/item/clothing/head/welding(M), M.slot_head) - M.equip_if_possible(new /obj/item/device/radio/headset(M), M.slot_ears) - M.equip_if_possible(new /obj/item/clothing/glasses/thermal/monocle(M), M.slot_glasses) - M.equip_if_possible(new /obj/item/clothing/suit/apron(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/weapon/kitchenknife(M), M.slot_l_store) - M.equip_if_possible(new /obj/item/weapon/scalpel(M), M.slot_r_store) + M.equip_to_slot_or_del(new /obj/item/clothing/under/overalls(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/latex(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/surgical(M), slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/clothing/head/welding(M), slot_head) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(M), slot_glasses) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/apron(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/weapon/kitchenknife(M), slot_l_store) + M.equip_to_slot_or_del(new /obj/item/weapon/scalpel(M), slot_r_store) var/obj/item/weapon/twohanded/fireaxe/fire_axe = new(M) - M.equip_if_possible(fire_axe, M.slot_r_hand) + M.equip_to_slot_or_del(fire_axe, slot_r_hand) for(var/obj/item/carried_item in M.contents) if(!istype(carried_item, /obj/item/weapon/implant))//If it's not an implant. carried_item.add_blood(M)//Oh yes, there will be blood... if("assassin") - M.equip_if_possible(new /obj/item/clothing/under/suit_jacket(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/black(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/black(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/device/radio/headset(M), M.slot_ears) - M.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(M), M.slot_glasses) - M.equip_if_possible(new /obj/item/clothing/suit/wcoat(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/weapon/melee/energy/sword(M), M.slot_l_store) - M.equip_if_possible(new /obj/item/weapon/cloaking_device(M), M.slot_r_store) + M.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_glasses) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/wcoat(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword(M), slot_l_store) + M.equip_to_slot_or_del(new /obj/item/weapon/cloaking_device(M), slot_r_store) var/obj/item/weapon/secstorage/sbriefcase/sec_briefcase = new(M) for(var/obj/item/briefcase_item in sec_briefcase) @@ -618,21 +618,21 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that sec_briefcase.contents += new /obj/item/weapon/gun/projectile/mateba sec_briefcase.contents += new /obj/item/ammo_magazine/a357 sec_briefcase.contents += new /obj/item/weapon/plastique - M.equip_if_possible(sec_briefcase, M.slot_l_hand) + M.equip_to_slot_or_del(sec_briefcase, slot_l_hand) var/obj/item/device/pda/heads/pda = new(M) pda.owner = M.real_name pda.ownjob = "Reaper" pda.name = "PDA-[M.real_name] ([pda.ownjob])" - M.equip_if_possible(pda, M.slot_belt) + M.equip_to_slot_or_del(pda, slot_belt) var/obj/item/weapon/card/id/syndicate/W = new(M) W.name = "[M.real_name]'s ID Card" W.access = get_all_accesses() W.assignment = "Reaper" W.registered_name = M.real_name - M.equip_if_possible(W, M.slot_wear_id) + M.equip_to_slot_or_del(W, slot_wear_id) if("death commando")//Was looking to add this for a while. M.equip_death_commando() @@ -641,22 +641,22 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that M.equip_syndicate_commando() if("centcom official") - M.equip_if_possible(new /obj/item/clothing/under/rank/centcom_officer(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/black(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/black(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/device/radio/headset/heads/hop(M), M.slot_ears) - M.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(M), M.slot_glasses) - M.equip_if_possible(new /obj/item/weapon/gun/energy(M), M.slot_belt) - M.equip_if_possible(new /obj/item/weapon/pen(M), M.slot_l_store) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/black(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hop(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_glasses) + M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy(M), slot_belt) + M.equip_to_slot_or_del(new /obj/item/weapon/pen(M), slot_l_store) var/obj/item/device/pda/heads/pda = new(M) pda.owner = M.real_name pda.ownjob = "CentCom Review Official" pda.name = "PDA-[M.real_name] ([pda.ownjob])" - M.equip_if_possible(pda, M.slot_r_store) + M.equip_to_slot_or_del(pda, slot_r_store) - M.equip_if_possible(new /obj/item/weapon/clipboard(M), M.slot_l_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/clipboard(M), slot_l_hand) var/obj/item/weapon/card/id/W = new(M) W.name = "[M.real_name]'s ID Card" @@ -665,20 +665,20 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that W.access += list("VIP Guest","Custodian","Thunderdome Overseer","Intel Officer","Medical Officer","Death Commando","Research Officer") W.assignment = "CentCom Review Official" W.registered_name = M.real_name - M.equip_if_possible(W, M.slot_wear_id) + M.equip_to_slot_or_del(W, slot_wear_id) if("centcom commander") - M.equip_if_possible(new /obj/item/clothing/under/rank/centcom_commander(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/suit/armor/bulletproof(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/clothing/shoes/swat(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/swat(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/device/radio/headset/heads/captain(M), M.slot_ears) - M.equip_if_possible(new /obj/item/clothing/glasses/eyepatch(M), M.slot_glasses) - M.equip_if_possible(new /obj/item/clothing/mask/cigarette/cigar/cohiba(M), M.slot_wear_mask) - M.equip_if_possible(new /obj/item/clothing/head/centhat(M), M.slot_head) - M.equip_if_possible(new /obj/item/weapon/gun/projectile/mateba(M), M.slot_belt) - M.equip_if_possible(new /obj/item/weapon/lighter/zippo(M), M.slot_r_store) - M.equip_if_possible(new /obj/item/ammo_magazine/a357(M), M.slot_l_store) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_commander(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/bulletproof(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/swat(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/eyepatch(M), slot_glasses) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar/cohiba(M), slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/clothing/head/centhat(M), slot_head) + M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/mateba(M), slot_belt) + M.equip_to_slot_or_del(new /obj/item/weapon/lighter/zippo(M), slot_r_store) + M.equip_to_slot_or_del(new /obj/item/ammo_magazine/a357(M), slot_l_store) var/obj/item/weapon/card/id/W = new(M) W.name = "[M.real_name]'s ID Card" @@ -687,20 +687,20 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that W.access += get_all_centcom_access() W.assignment = "CentCom Commanding Officer" W.registered_name = M.real_name - M.equip_if_possible(W, M.slot_wear_id) + M.equip_to_slot_or_del(W, slot_wear_id) if("special ops officer") - M.equip_if_possible(new /obj/item/clothing/under/syndicate/combat(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/suit/armor/swat/officer(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/clothing/shoes/combat(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/combat(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/device/radio/headset/heads/captain(M), M.slot_ears) - M.equip_if_possible(new /obj/item/clothing/glasses/thermal/eyepatch(M), M.slot_glasses) - M.equip_if_possible(new /obj/item/clothing/mask/cigarette/cigar/havana(M), M.slot_wear_mask) - M.equip_if_possible(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), M.slot_head) - M.equip_if_possible(new /obj/item/weapon/gun/energy/pulse_rifle/M1911(M), M.slot_belt) - M.equip_if_possible(new /obj/item/weapon/lighter/zippo(M), M.slot_r_store) - M.equip_if_possible(new /obj/item/weapon/storage/backpack/satchel(M), M.slot_back) + M.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate/combat(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/swat/officer(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/eyepatch(M), slot_glasses) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar/havana(M), slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), slot_head) + M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/M1911(M), slot_belt) + M.equip_to_slot_or_del(new /obj/item/weapon/lighter/zippo(M), slot_r_store) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back) var/obj/item/weapon/card/id/W = new(M) W.name = "[M.real_name]'s ID Card" @@ -709,53 +709,53 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that W.access += get_all_centcom_access() W.assignment = "Special Operations Officer" W.registered_name = M.real_name - M.equip_if_possible(W, M.slot_wear_id) + M.equip_to_slot_or_del(W, slot_wear_id) if("blue wizard") - M.equip_if_possible(new /obj/item/clothing/under/lightpurple(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/suit/wizrobe(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/clothing/shoes/sandal(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/device/radio/headset(M), M.slot_ears) - M.equip_if_possible(new /obj/item/clothing/head/wizard(M), M.slot_head) - M.equip_if_possible(new /obj/item/weapon/teleportation_scroll(M), M.slot_r_store) - M.equip_if_possible(new /obj/item/weapon/spellbook(M), M.slot_r_hand) - M.equip_if_possible(new /obj/item/weapon/staff(M), M.slot_l_hand) - M.equip_if_possible(new /obj/item/weapon/storage/backpack(M), M.slot_back) - M.equip_if_possible(new /obj/item/weapon/storage/box(M), M.slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/clothing/under/lightpurple(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/clothing/head/wizard(M), slot_head) + M.equip_to_slot_or_del(new /obj/item/weapon/teleportation_scroll(M), slot_r_store) + M.equip_to_slot_or_del(new /obj/item/weapon/spellbook(M), slot_r_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/staff(M), slot_l_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/box(M), slot_in_backpack) if("red wizard") - M.equip_if_possible(new /obj/item/clothing/under/lightpurple(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/suit/wizrobe/red(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/clothing/shoes/sandal(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/device/radio/headset(M), M.slot_ears) - M.equip_if_possible(new /obj/item/clothing/head/wizard/red(M), M.slot_head) - M.equip_if_possible(new /obj/item/weapon/teleportation_scroll(M), M.slot_r_store) - M.equip_if_possible(new /obj/item/weapon/spellbook(M), M.slot_r_hand) - M.equip_if_possible(new /obj/item/weapon/staff(M), M.slot_l_hand) - M.equip_if_possible(new /obj/item/weapon/storage/backpack(M), M.slot_back) - M.equip_if_possible(new /obj/item/weapon/storage/box(M), M.slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/clothing/under/lightpurple(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe/red(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/clothing/head/wizard/red(M), slot_head) + M.equip_to_slot_or_del(new /obj/item/weapon/teleportation_scroll(M), slot_r_store) + M.equip_to_slot_or_del(new /obj/item/weapon/spellbook(M), slot_r_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/staff(M), slot_l_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/box(M), slot_in_backpack) if("marisa wizard") - M.equip_if_possible(new /obj/item/clothing/under/lightpurple(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/suit/wizrobe/marisa(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/clothing/shoes/sandal/marisa(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/device/radio/headset(M), M.slot_ears) - M.equip_if_possible(new /obj/item/clothing/head/wizard/marisa(M), M.slot_head) - M.equip_if_possible(new /obj/item/weapon/teleportation_scroll(M), M.slot_r_store) - M.equip_if_possible(new /obj/item/weapon/spellbook(M), M.slot_r_hand) - M.equip_if_possible(new /obj/item/weapon/staff(M), M.slot_l_hand) - M.equip_if_possible(new /obj/item/weapon/storage/backpack(M), M.slot_back) - M.equip_if_possible(new /obj/item/weapon/storage/box(M), M.slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/clothing/under/lightpurple(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe/marisa(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal/marisa(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/clothing/head/wizard/marisa(M), slot_head) + M.equip_to_slot_or_del(new /obj/item/weapon/teleportation_scroll(M), slot_r_store) + M.equip_to_slot_or_del(new /obj/item/weapon/spellbook(M), slot_r_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/staff(M), slot_l_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/box(M), slot_in_backpack) if("soviet admiral") - M.equip_if_possible(new /obj/item/clothing/head/hgpiratecap(M), M.slot_head) - M.equip_if_possible(new /obj/item/clothing/shoes/combat(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/combat(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/device/radio/headset/heads/captain(M), M.slot_ears) - M.equip_if_possible(new /obj/item/clothing/glasses/thermal/eyepatch(M), M.slot_glasses) - M.equip_if_possible(new /obj/item/clothing/suit/hgpirate(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/weapon/storage/backpack/bandolier(M), M.slot_back) - M.equip_if_possible(new /obj/item/weapon/gun/projectile/mateba(M), M.slot_belt) - M.equip_if_possible(new /obj/item/clothing/under/soviet(M), M.slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/head/hgpiratecap(M), slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(M), slot_ears) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/eyepatch(M), slot_glasses) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/hgpirate(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/bandolier(M), slot_back) + M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/mateba(M), slot_belt) + M.equip_to_slot_or_del(new /obj/item/clothing/under/soviet(M), slot_w_uniform) var/obj/item/weapon/card/id/W = new(M) W.name = "[M.real_name]'s ID Card" W.icon_state = "centcom" @@ -763,7 +763,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that W.access += get_all_centcom_access() W.assignment = "Admiral" W.registered_name = M.real_name - M.equip_if_possible(W, M.slot_wear_id) + M.equip_to_slot_or_del(W, slot_wear_id) M.regenerate_icons() diff --git a/code/modules/admin/verbs/onlyone.dm b/code/modules/admin/verbs/onlyone.dm index f10e9736c1..75e0a5f287 100644 --- a/code/modules/admin/verbs/onlyone.dm +++ b/code/modules/admin/verbs/onlyone.dm @@ -36,12 +36,12 @@ continue del(I) - H.equip_if_possible(new /obj/item/clothing/under/kilt(H), H.slot_w_uniform) - H.equip_if_possible(new /obj/item/device/radio/headset/heads/captain(H), H.slot_ears) - H.equip_if_possible(new /obj/item/clothing/head/beret(H), H.slot_head) - H.equip_if_possible(new /obj/item/weapon/claymore(H), H.slot_l_hand) - H.equip_if_possible(new /obj/item/clothing/shoes/combat(H), H.slot_shoes) - H.equip_if_possible(new /obj/item/weapon/pinpointer(H.loc), H.slot_l_store) + H.equip_to_slot_or_del(new /obj/item/clothing/under/kilt(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(H), slot_ears) + H.equip_to_slot_or_del(new /obj/item/clothing/head/beret(H), slot_head) + H.equip_to_slot_or_del(new /obj/item/weapon/claymore(H), slot_l_hand) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(H), slot_shoes) + H.equip_to_slot_or_del(new /obj/item/weapon/pinpointer(H.loc), slot_l_store) var/obj/item/weapon/card/id/W = new(H) W.name = "[H.real_name]'s ID Card" @@ -50,7 +50,7 @@ W.access += get_all_centcom_access() W.assignment = "Highlander" W.registered_name = H.real_name - H.equip_if_possible(W, H.slot_wear_id) + H.equip_to_slot_or_del(W, slot_wear_id) message_admins("\blue [key_name_admin(usr)] used THERE CAN BE ONLY ONE!", 1) log_admin("[key_name(usr)] used there can be only one.") \ No newline at end of file diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 06239fa3e5..d2cdfbd9d6 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -35,8 +35,8 @@ M.loc = pick(prisonwarp) if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/prisoner = M - prisoner.equip_if_possible(new /obj/item/clothing/under/color/orange(prisoner), prisoner.slot_w_uniform) - prisoner.equip_if_possible(new /obj/item/clothing/shoes/orange(prisoner), prisoner.slot_shoes) + prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(prisoner), slot_w_uniform) + prisoner.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(prisoner), slot_shoes) spawn(50) M << "\red You have been sent to the prison station!" log_admin("[key_name(usr)] sent [key_name(M)] to the prison station.") diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm index 3625651a8a..ca089bfe66 100644 --- a/code/modules/admin/verbs/striketeam.dm +++ b/code/modules/admin/verbs/striketeam.dm @@ -133,37 +133,37 @@ var/global/sent_strike_team = 0 var/obj/item/device/radio/R = new /obj/item/device/radio/headset(src) R.set_frequency(1441) - equip_if_possible(R, slot_ears) + equip_to_slot_or_del(R, slot_ears) if (leader_selected == 0) - equip_if_possible(new /obj/item/clothing/under/color/green(src), slot_w_uniform) + equip_to_slot_or_del(new /obj/item/clothing/under/color/green(src), slot_w_uniform) else - equip_if_possible(new /obj/item/clothing/under/rank/centcom_officer(src), slot_w_uniform) - equip_if_possible(new /obj/item/clothing/shoes/swat(src), slot_shoes) - equip_if_possible(new /obj/item/clothing/suit/armor/swat(src), slot_wear_suit) - equip_if_possible(new /obj/item/clothing/gloves/swat(src), slot_gloves) - equip_if_possible(new /obj/item/clothing/head/helmet/space/deathsquad(src), slot_head) - equip_if_possible(new /obj/item/clothing/mask/gas/swat(src), slot_wear_mask) - equip_if_possible(new /obj/item/clothing/glasses/thermal(src), slot_glasses) + equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(src), slot_w_uniform) + equip_to_slot_or_del(new /obj/item/clothing/shoes/swat(src), slot_shoes) + equip_to_slot_or_del(new /obj/item/clothing/suit/armor/swat(src), slot_wear_suit) + equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(src), slot_gloves) + equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad(src), slot_head) + equip_to_slot_or_del(new /obj/item/clothing/mask/gas/swat(src), slot_wear_mask) + equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal(src), slot_glasses) - equip_if_possible(new /obj/item/weapon/storage/backpack/security(src), slot_back) - equip_if_possible(new /obj/item/weapon/storage/box(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(src), slot_back) + equip_to_slot_or_del(new /obj/item/weapon/storage/box(src), slot_in_backpack) - equip_if_possible(new /obj/item/ammo_magazine/a357(src), slot_in_backpack) - equip_if_possible(new /obj/item/weapon/storage/firstaid/regular(src), slot_in_backpack) - equip_if_possible(new /obj/item/weapon/storage/flashbang_kit(src), slot_in_backpack) - equip_if_possible(new /obj/item/device/flashlight(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/ammo_magazine/a357(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/regular(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/weapon/storage/flashbang_kit(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_in_backpack) if (!leader_selected) - equip_if_possible(new /obj/item/weapon/plastique(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_in_backpack) else - equip_if_possible(new /obj/item/weapon/pinpointer(src), slot_in_backpack) - equip_if_possible(new /obj/item/weapon/disk/nuclear(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/weapon/pinpointer(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/weapon/disk/nuclear(src), slot_in_backpack) - equip_if_possible(new /obj/item/weapon/melee/energy/sword(src), slot_l_store) - equip_if_possible(new /obj/item/weapon/grenade/flashbang(src), slot_r_store) - equip_if_possible(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store) - equip_if_possible(new /obj/item/weapon/gun/projectile/mateba(src), slot_belt) + equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword(src), slot_l_store) + equip_to_slot_or_del(new /obj/item/weapon/grenade/flashbang(src), slot_r_store) + equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store) + equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/mateba(src), slot_belt) - equip_if_possible(new /obj/item/weapon/gun/energy/pulse_rifle(src), slot_r_hand) + equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle(src), slot_r_hand) var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(src)//Here you go Deuryn @@ -179,7 +179,7 @@ var/global/sent_strike_team = 0 W.access += list(access_cent_general, access_cent_specops, access_cent_living, access_cent_storage)//Let's add their alloted CentCom access. W.assignment = "Death Commando" W.registered_name = real_name - equip_if_possible(W, slot_wear_id) + equip_to_slot_or_del(W, slot_wear_id) resistances += "alien_embryo" return 1 \ No newline at end of file diff --git a/code/modules/admin/verbs/striketeam_syndicate.dm b/code/modules/admin/verbs/striketeam_syndicate.dm index f825ed528e..bcc272875c 100644 --- a/code/modules/admin/verbs/striketeam_syndicate.dm +++ b/code/modules/admin/verbs/striketeam_syndicate.dm @@ -134,40 +134,40 @@ var/global/sent_syndicate_strike_team = 0 var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate(src) R.set_frequency(SYND_FREQ) //Same frequency as the syndicate team in Nuke mode. - equip_if_possible(R, slot_ears) - equip_if_possible(new /obj/item/clothing/under/syndicate(src), slot_w_uniform) - equip_if_possible(new /obj/item/clothing/shoes/swat(src), slot_shoes) + equip_to_slot_or_del(R, slot_ears) + equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(src), slot_w_uniform) + equip_to_slot_or_del(new /obj/item/clothing/shoes/swat(src), slot_shoes) if (!syndicate_leader_selected) - equip_if_possible(new /obj/item/clothing/suit/space/syndicate/black(src), slot_wear_suit) + equip_to_slot_or_del(new /obj/item/clothing/suit/space/syndicate/black(src), slot_wear_suit) else - equip_if_possible(new /obj/item/clothing/suit/space/syndicate/black/red(src), slot_wear_suit) - equip_if_possible(new /obj/item/clothing/gloves/swat(src), slot_gloves) + equip_to_slot_or_del(new /obj/item/clothing/suit/space/syndicate/black/red(src), slot_wear_suit) + equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(src), slot_gloves) if (!syndicate_leader_selected) - equip_if_possible(new /obj/item/clothing/head/helmet/space/syndicate/black(src), slot_head) + equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/syndicate/black(src), slot_head) else - equip_if_possible(new /obj/item/clothing/head/helmet/space/syndicate/black/red(src), slot_head) - equip_if_possible(new /obj/item/clothing/mask/gas/syndicate(src), slot_wear_mask) - equip_if_possible(new /obj/item/clothing/glasses/thermal(src), slot_glasses) + equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/syndicate/black/red(src), slot_head) + equip_to_slot_or_del(new /obj/item/clothing/mask/gas/syndicate(src), slot_wear_mask) + equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal(src), slot_glasses) - equip_if_possible(new /obj/item/weapon/storage/backpack/security(src), slot_back) - equip_if_possible(new /obj/item/weapon/storage/box(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(src), slot_back) + equip_to_slot_or_del(new /obj/item/weapon/storage/box(src), slot_in_backpack) - equip_if_possible(new /obj/item/ammo_magazine/c45(src), slot_in_backpack) - equip_if_possible(new /obj/item/weapon/storage/firstaid/regular(src), slot_in_backpack) - equip_if_possible(new /obj/item/weapon/plastique(src), slot_in_backpack) - equip_if_possible(new /obj/item/device/flashlight(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/ammo_magazine/c45(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/regular(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_in_backpack) if (!syndicate_leader_selected) - equip_if_possible(new /obj/item/weapon/plastique(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/weapon/plastique(src), slot_in_backpack) else - equip_if_possible(new /obj/item/weapon/pinpointer(src), slot_in_backpack) - equip_if_possible(new /obj/item/weapon/disk/nuclear(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/weapon/pinpointer(src), slot_in_backpack) + equip_to_slot_or_del(new /obj/item/weapon/disk/nuclear(src), slot_in_backpack) - equip_if_possible(new /obj/item/weapon/melee/energy/sword(src), slot_l_store) - equip_if_possible(new /obj/item/weapon/grenade/empgrenade(src), slot_r_store) - equip_if_possible(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store) - equip_if_possible(new /obj/item/weapon/gun/projectile/silenced(src), slot_belt) + equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword(src), slot_l_store) + equip_to_slot_or_del(new /obj/item/weapon/grenade/empgrenade(src), slot_r_store) + equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen(src), slot_s_store) + equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/silenced(src), slot_belt) - equip_if_possible(new /obj/item/weapon/gun/energy/pulse_rifle(src), slot_r_hand) //Will change to something different at a later time -- Superxpdude + equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle(src), slot_r_hand) //Will change to something different at a later time -- Superxpdude var/obj/item/weapon/card/id/syndicate/W = new(src) //Untrackable by AI W.name = "[real_name]'s ID Card" @@ -176,7 +176,7 @@ var/global/sent_syndicate_strike_team = 0 W.access += list(access_cent_general, access_cent_specops, access_cent_living, access_cent_storage, access_syndicate)//Let's add their forged CentCom access and syndicate access. W.assignment = "Syndicate Commando" W.registered_name = real_name - equip_if_possible(W, slot_wear_id) + equip_to_slot_or_del(W, slot_wear_id) resistances += "alien_embryo" return 1 \ No newline at end of file diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 5e1241c2e8..3f840608ca 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -90,6 +90,15 @@ BLIND // can't see anything permeability_coefficient = 0.50 slowdown = SHOES_SLOWDOWN +//Suit +/obj/item/clothing/suit + icon = 'icons/obj/clothing/suits.dmi' + name = "suit" + var/fire_resist = T0C+100 + flags = FPRINT | TABLEPASS | ONESIZEFITSALL + allowed = list(/obj/item/weapon/tank/emergency_oxygen) + armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) + slot_flags = SLOT_OCLOTHING //Spacesuit //Note: Everything in modules/clothing/spacesuits should have the entire suit grouped together. @@ -104,7 +113,6 @@ BLIND // can't see anything armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 50) flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE - /obj/item/clothing/suit/space name = "Space suit" desc = "A suit that protects against low pressure environments. Has a big 13 on the back." @@ -123,17 +131,6 @@ BLIND // can't see anything flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT -//Suit -/obj/item/clothing/suit - icon = 'icons/obj/clothing/suits.dmi' - name = "suit" - var/fire_resist = T0C+100 - flags = FPRINT | TABLEPASS | ONESIZEFITSALL - allowed = list(/obj/item/weapon/tank/emergency_oxygen) - armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) - slot_flags = SLOT_OCLOTHING - - //Under clothing /obj/item/clothing/under icon = 'icons/obj/clothing/uniforms.dmi' diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index bc61eca7f0..5bc421dee4 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -21,7 +21,7 @@ l_hand = W W.layer = 20 //TODO: move to equipped? // l_hand.screen_loc = ui_lhand - W.equipped(src,"l_hand") + W.equipped(src,slot_l_hand) if(client) client.screen |= W update_inv_l_hand() return 1 @@ -36,7 +36,7 @@ r_hand = W W.layer = 20 // r_hand.screen_loc = ui_rhand - W.equipped(src,"r_hand") + W.equipped(src,slot_r_hand) if(client) client.screen |= W update_inv_r_hand() return 1 diff --git a/code/modules/mob/living/carbon/alien/humanoid/hud.dm b/code/modules/mob/living/carbon/alien/humanoid/hud.dm index e120e449fd..dcb4a74cfa 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/hud.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/hud.dm @@ -116,6 +116,7 @@ using.icon = 'icons/mob/screen1_alien.dmi' using.icon_state = "equip" using.screen_loc = ui_alien_oclothing + using.slot_id = slot_wear_suit using.layer = 19 src.adding += using @@ -129,6 +130,7 @@ using.screen_loc = ui_rhand using.layer = 19 src.r_hand_hud_object = using + using.slot_id = slot_r_hand src.adding += using using = new src.h_type( src ) @@ -140,6 +142,7 @@ using.icon_state = "hand_active" using.screen_loc = ui_lhand using.layer = 19 + using.slot_id = slot_l_hand src.l_hand_hud_object = using src.adding += using @@ -149,6 +152,7 @@ using.icon = 'icons/mob/screen1_alien.dmi' using.icon_state = "pocket" using.screen_loc = ui_storage1 + using.slot_id = slot_l_store using.layer = 19 src.adding += using @@ -158,6 +162,7 @@ using.icon = 'icons/mob/screen1_alien.dmi' using.icon_state = "pocket" using.screen_loc = ui_storage2 + using.slot_id = slot_r_store using.layer = 19 src.adding += using @@ -167,6 +172,7 @@ using.icon = 'icons/mob/screen1_alien.dmi' using.icon_state = "hair" using.screen_loc = ui_alien_head + using.slot_id = slot_head using.layer = 19 src.adding += using //end of equippable shit diff --git a/code/modules/mob/living/carbon/alien/humanoid/inventory.dm b/code/modules/mob/living/carbon/alien/humanoid/inventory.dm index 12d6b04a87..1e9cf71bd7 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/inventory.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/inventory.dm @@ -19,7 +19,7 @@ l_hand = null update_inv_l_hand(0) -/mob/living/carbon/alien/humanoid/db_click(text, t1) +/mob/living/carbon/alien/humanoid/attack_ui(slot_id) var/obj/item/W = get_active_hand() if(W) if(!istype(W)) return diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index 3a62cccad4..c142c6e9d4 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -130,7 +130,7 @@ //can't equip anything -/mob/living/carbon/alien/larva/db_click(text, t1) +/mob/living/carbon/alien/larva/attack_ui(slot_id) return /mob/living/carbon/alien/larva/meteorhit(O as obj) diff --git a/code/modules/mob/living/carbon/human/hud.dm b/code/modules/mob/living/carbon/human/hud.dm index 4bf1c1373f..095c8db23b 100644 --- a/code/modules/mob/living/carbon/human/hud.dm +++ b/code/modules/mob/living/carbon/human/hud.dm @@ -113,6 +113,7 @@ using.name = "i_clothing" using.dir = SOUTH using.icon = ui_style + using.slot_id = slot_w_uniform using.icon_state = "center" using.screen_loc = ui_iclothing using.layer = 19 @@ -122,6 +123,7 @@ using.name = "o_clothing" using.dir = SOUTH using.icon = ui_style + using.slot_id = slot_wear_suit using.icon_state = "equip" using.screen_loc = ui_oclothing using.layer = 19 @@ -144,6 +146,7 @@ if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use using.icon_state = "hand_active" using.screen_loc = ui_rhand + using.slot_id = slot_r_hand using.layer = 19 src.r_hand_hud_object = using src.adding += using @@ -156,6 +159,7 @@ if(mymob && mymob.hand) //This being 1 means the left hand is in use using.icon_state = "hand_active" using.screen_loc = ui_lhand + using.slot_id = slot_l_hand using.layer = 19 src.l_hand_hud_object = using src.adding += using @@ -184,6 +188,7 @@ using.icon = ui_style using.icon_state = "id" using.screen_loc = ui_id + using.slot_id = slot_wear_id using.layer = 19 src.adding += using @@ -193,6 +198,7 @@ using.icon = ui_style using.icon_state = "equip" using.screen_loc = ui_mask + using.slot_id = slot_wear_mask using.layer = 19 src.other += using @@ -202,6 +208,7 @@ using.icon = ui_style using.icon_state = "back" using.screen_loc = ui_back + using.slot_id = slot_back using.layer = 19 src.adding += using @@ -210,6 +217,7 @@ using.icon = ui_style using.icon_state = "pocket" using.screen_loc = ui_storage1 + using.slot_id = slot_l_store using.layer = 19 src.adding += using @@ -218,6 +226,7 @@ using.icon = ui_style using.icon_state = "pocket" using.screen_loc = ui_storage2 + using.slot_id = slot_r_store using.layer = 19 src.adding += using @@ -227,6 +236,7 @@ using.dir = 8 //The sprite at dir=8 has the background whereas the others don't. using.icon_state = "belt" using.screen_loc = ui_sstore1 + using.slot_id = slot_s_store using.layer = 19 src.adding += using @@ -275,6 +285,7 @@ using.icon = ui_style using.icon_state = "gloves" using.screen_loc = ui_gloves + using.slot_id = slot_gloves using.layer = 19 src.other += using @@ -283,6 +294,7 @@ using.icon = ui_style using.icon_state = "glasses" using.screen_loc = ui_glasses + using.slot_id = slot_glasses using.layer = 19 src.other += using @@ -291,6 +303,7 @@ using.icon = ui_style using.icon_state = "ears" using.screen_loc = ui_ears + using.slot_id = slot_ears using.layer = 19 src.other += using @@ -299,6 +312,7 @@ using.icon = ui_style using.icon_state = "hair" using.screen_loc = ui_head + using.slot_id = slot_head using.layer = 19 src.other += using @@ -307,6 +321,7 @@ using.icon = ui_style using.icon_state = "shoes" using.screen_loc = ui_shoes + using.slot_id = slot_shoes using.layer = 19 src.other += using @@ -315,6 +330,7 @@ using.icon = ui_style using.icon_state = "belt" using.screen_loc = ui_belt + using.slot_id = slot_belt using.layer = 19 src.adding += using diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index c6b8740b74..078ffcee40 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -1,430 +1,277 @@ -//TODO: maybe these could be defines? -/mob/living/carbon/human - var/const/slot_back = 1 - var/const/slot_wear_mask = 2 - var/const/slot_handcuffed = 3 - var/const/slot_l_hand = 4 - var/const/slot_r_hand = 5 - var/const/slot_belt = 6 - var/const/slot_wear_id = 7 - var/const/slot_ears = 8 - var/const/slot_glasses = 9 - var/const/slot_gloves = 10 - var/const/slot_head = 11 - var/const/slot_shoes = 12 - var/const/slot_wear_suit = 13 - var/const/slot_w_uniform = 14 - var/const/slot_l_store = 15 - var/const/slot_r_store = 16 - var/const/slot_s_store = 17 - var/const/slot_in_backpack = 18 - var/const/slot_legcuffed = 19 - /mob/living/carbon/human/proc/equip_in_one_of_slots(obj/item/W, list/slots, del_on_fail = 1) for (var/slot in slots) - if (equip_if_possible(W, slots[slot], del_on_fail = 0)) + if (equip_to_slot_or_del(W, slots[slot], del_on_fail = 0)) return slot if (del_on_fail) del(W) return null -//puts the item "W" into an appropriate slot in a human's inventory -//returns 0 if it cannot, 1 if successful -/mob/living/carbon/human/proc/equip_to_appropriate_slot(obj/item/W) - if(!W) return 0 - if(!ishuman(src)) return 0 - - if(W.slot_flags & SLOT_BACK) - if(!back) - if( get_active_hand() == W ) - u_equip(W) - back = W - update_inv_back() - return 1 - - if(W.slot_flags & SLOT_ID) - if(!wear_id && w_uniform) - if( get_active_hand() == W ) - u_equip(W) - wear_id = W - update_inv_wear_id() - return 1 - - if(W.slot_flags & SLOT_ICLOTHING) - if(!w_uniform) - if( get_active_hand() == W ) - u_equip(W) - w_uniform = W - update_inv_w_uniform() - return 1 - - if(W.slot_flags & SLOT_OCLOTHING) - if(!wear_suit) - if( get_active_hand() == W ) - u_equip(W) - wear_suit = W - update_inv_wear_suit() - return 1 - - if(W.slot_flags & SLOT_MASK) - if(!wear_mask) - if( get_active_hand() == W ) - u_equip(W) - wear_mask = W - update_inv_wear_mask() - return 1 - - if(W.slot_flags & SLOT_HEAD) - if(!head) - if( get_active_hand() == W ) - u_equip(W) - head = W - update_inv_head() - return 1 - - if(W.slot_flags & SLOT_FEET) - if(!shoes) - if( get_active_hand() == W ) - u_equip(W) - shoes = W - update_inv_shoes() - return 1 - - if(W.slot_flags & SLOT_GLOVES) - if(!gloves) - if( get_active_hand() == W ) - u_equip(W) - gloves = W - update_inv_gloves() - return 1 - - if(W.slot_flags & SLOT_EARS) - if(!ears) - if( get_active_hand() == W ) - u_equip(W) - ears = W - update_inv_ears() - return 1 - - if(W.slot_flags & SLOT_EYES) - if(!glasses) - if( get_active_hand() == W ) - u_equip(W) - glasses = W - update_inv_glasses() - return 1 - - if(W.slot_flags & SLOT_BELT) - if(!belt && w_uniform) - if( get_active_hand() == W ) - u_equip(W) - belt = W - update_inv_belt() - return 1 - - //Suit storage - var/confirm - if (!s_store && wear_suit) - if(wear_suit.allowed) - if (istype(W, /obj/item/device/pda) || istype(W, /obj/item/weapon/pen)) - confirm = 1 - if (is_type_in_list(W, wear_suit.allowed)) - confirm = 1 - if(confirm) - u_equip(W) - s_store = W - update_inv_s_store() - return 1 - - //Pockets - if ( !( W.slot_flags & SLOT_DENYPOCKET ) ) - if(!l_store) - if ( W.w_class <= 2 || ( W.slot_flags & SLOT_POCKET ) ) - u_equip(W) - l_store = W - update_inv_pockets() - return 1 - if(!r_store) - if ( W.w_class <= 2 || ( W.slot_flags & SLOT_POCKET ) ) - u_equip(W) - r_store = W - update_inv_pockets() - return 1 - return 0 - - -/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 - if((slot == l_store || slot == r_store || slot == belt || slot == wear_id) && !src.w_uniform) - if(del_on_fail) - del(W) - return - if(slot == s_store && !src.wear_suit) - if(del_on_fail) - del(W) - return - switch(slot) - if(slot_back) - if(!src.back) - src.back = W - update_inv_back(0) - equipped = 1 - if(slot_wear_mask) - if(!src.wear_mask) - src.wear_mask = W - update_inv_wear_mask(0) - equipped = 1 - if(slot_handcuffed) - if(!src.handcuffed) - src.handcuffed = W - update_inv_handcuffed(0) - equipped = 1 - if(slot_legcuffed) - if(!src.legcuffed) - src.legcuffed = W - update_inv_legcuffed(0) - equipped = 1 - if(slot_l_hand) - if(!src.l_hand) - src.l_hand = W - update_inv_l_hand(0) - equipped = 1 - if(slot_r_hand) - if(!src.r_hand) - src.r_hand = W - update_inv_r_hand(0) - equipped = 1 - if(slot_belt) - if(!src.belt) - src.belt = W - update_inv_belt(0) - equipped = 1 - if(slot_wear_id) - if(!src.wear_id) - src.wear_id = W - update_inv_wear_id(0) - equipped = 1 - if(slot_ears) - if(!src.ears) - src.ears = W - update_inv_ears(0) - equipped = 1 - if(slot_glasses) - if(!src.glasses) - src.glasses = W - update_inv_glasses(0) - equipped = 1 - if(slot_gloves) - if(!src.gloves) - src.gloves = W - update_inv_gloves(0) - equipped = 1 - if(slot_head) - if(!src.head) - src.head = W - update_inv_head(0) - equipped = 1 - if(slot_shoes) - if(!src.shoes) - src.shoes = W - update_inv_shoes(0) - equipped = 1 - if(slot_wear_suit) - if(!src.wear_suit) - src.wear_suit = W - update_inv_wear_suit(0) - equipped = 1 - if(slot_w_uniform) - if(!src.w_uniform) - src.w_uniform = W - update_inv_w_uniform(0) - equipped = 1 - if(slot_l_store) - if(!src.l_store) - src.l_store = W - update_inv_pockets(0) - equipped = 1 - if(slot_r_store) - if(!src.r_store) - src.r_store = W - update_inv_pockets(0) - equipped = 1 - if(slot_s_store) - if(!src.s_store) - src.s_store = W - update_inv_s_store(0) - 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.loc = B - equipped = 1 - - if(equipped) - W.layer = 20 - else - if (del_on_fail) - del(W) - return equipped - - /mob/living/carbon/human/u_equip(obj/item/W as obj) if(!W) return 0 + + var/success + if (W == wear_suit) - W = s_store - if (W) - u_equip(W) - if (client) - client.screen -= W - if (W) - W.loc = loc - W.dropped(src) - W.layer = initial(W.layer) + if(s_store) + u_equip(s_store) + if(W) + success = 1 wear_suit = null - update_inv_wear_suit(0) + update_inv_wear_suit() else if (W == w_uniform) - W = r_store - if (W) - u_equip(W) - if (client) - client.screen -= W - if (W) - W.loc = loc - W.dropped(src) - W.layer = initial(W.layer) - W = l_store - if (W) - u_equip(W) - if (client) - client.screen -= W - if (W) - W.loc = loc - W.dropped(src) - W.layer = initial(W.layer) - W = wear_id - if (W) - u_equip(W) - if (client) - client.screen -= W - if (W) - W.loc = loc - W.dropped(src) - W.layer = initial(W.layer) - W = belt - if (W) - u_equip(W) - if (client) - client.screen -= W - if (W) - W.loc = loc - W.dropped(src) - W.layer = initial(W.layer) + if (r_store) + u_equip(r_store) + if (l_store) + u_equip(l_store) + if (wear_id) + u_equip(wear_id) + if (belt) + u_equip(belt) w_uniform = null - update_inv_w_uniform(0) + success = 1 + update_inv_w_uniform() else if (W == gloves) gloves = null - update_inv_gloves(0) + success = 1 + update_inv_gloves() else if (W == glasses) glasses = null - update_inv_glasses(0) + success = 1 + update_inv_glasses() else if (W == head) head = null if(W.flags & BLOCKHAIR) - update_hair(0) //rebuild hair - update_inv_head(0) + update_hair() //rebuild hair + success = 1 + update_inv_head() else if (W == ears) ears = null - update_inv_ears(0) + success = 1 + update_inv_ears() else if (W == shoes) shoes = null - update_inv_shoes(0) + success = 1 + update_inv_shoes() else if (W == belt) belt = null - update_inv_belt(0) + success = 1 + update_inv_belt() else if (W == wear_mask) wear_mask = null + success = 1 if(W.flags & BLOCKHAIR) update_hair(0) //rebuild hair if(internal) if(internals) internals.icon_state = "internal0" internal = null - update_inv_wear_mask(0) + update_inv_wear_mask() else if (W == wear_id) wear_id = null - update_inv_wear_id(0) + success = 1 + update_inv_wear_id() else if (W == r_store) r_store = null + success = 1 update_inv_pockets() else if (W == l_store) l_store = null + success = 1 update_inv_pockets() else if (W == s_store) s_store = null - update_inv_s_store(0) + success = 1 + update_inv_s_store() else if (W == back) back = null - update_inv_back(0) + success = 1 + update_inv_back() else if (W == handcuffed) handcuffed = null - update_inv_handcuffed(0) + success = 1 + update_inv_handcuffed() else if (W == legcuffed) legcuffed = null - update_inv_legcuffed(0) + success = 1 + update_inv_legcuffed() else if (W == r_hand) r_hand = null - update_inv_r_hand(0) + success = 1 + update_inv_r_hand() else if (W == l_hand) l_hand = null - update_inv_l_hand(0) + success = 1 + update_inv_l_hand() else return 0 + + if(success) + if (W) + if (client) + client.screen -= W + W.loc = loc + W.dropped(src) + W.layer = initial(W.layer) + update_action_buttons() return 1 -/obj/effect/equip_e/human/process() //TODO: Rewrite this steaming pile... ~Carn + +//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible() +//set redraw_mob to 0 if you don't wish the hud to be updated - if you're doing it manually in your own proc. +/mob/living/carbon/human/equip_to_slot(obj/item/W as obj, slot, redraw_mob = 1) + if(!slot) return + if(!istype(W)) return + + if(W == get_active_hand()) + u_equip(W) + + W.loc = src + switch(slot) + if(slot_back) + src.back = W + W.equipped(src, slot) + update_inv_back(redraw_mob) + if(slot_wear_mask) + src.wear_mask = W + if(wear_mask.flags & BLOCKHAIR) + update_hair(redraw_mob) //rebuild hair + W.equipped(src, slot) + update_inv_wear_mask(redraw_mob) + if(slot_handcuffed) + src.handcuffed = W + update_inv_handcuffed(redraw_mob) + if(slot_legcuffed) + src.legcuffed = W + W.equipped(src, slot) + update_inv_legcuffed(redraw_mob) + if(slot_l_hand) + src.l_hand = W + W.equipped(src, slot) + update_inv_l_hand(redraw_mob) + if(slot_r_hand) + src.r_hand = W + W.equipped(src, slot) + update_inv_r_hand(redraw_mob) + if(slot_belt) + src.belt = W + W.equipped(src, slot) + update_inv_belt(redraw_mob) + if(slot_wear_id) + src.wear_id = W + W.equipped(src, slot) + update_inv_wear_id(redraw_mob) + if(slot_ears) + src.ears = W + W.equipped(src, slot) + update_inv_ears(redraw_mob) + if(slot_glasses) + src.glasses = W + W.equipped(src, slot) + update_inv_glasses(redraw_mob) + if(slot_gloves) + src.gloves = W + W.equipped(src, slot) + update_inv_gloves(redraw_mob) + if(slot_head) + src.head = W + if(head.flags & BLOCKHAIR) + 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) + update_inv_shoes(redraw_mob) + if(slot_wear_suit) + src.wear_suit = W + W.equipped(src, slot) + update_inv_wear_suit(redraw_mob) + if(slot_w_uniform) + src.w_uniform = W + W.equipped(src, slot) + update_inv_w_uniform(redraw_mob) + if(slot_l_store) + src.l_store = W + W.equipped(src, slot) + update_inv_pockets(redraw_mob) + if(slot_r_store) + src.r_store = W + W.equipped(src, slot) + update_inv_pockets(redraw_mob) + if(slot_s_store) + src.s_store = W + W.equipped(src, slot) + update_inv_s_store(redraw_mob) + if(slot_in_backpack) + W.loc = src.back + else + src << "\red You are trying to eqip this item to an unsupported inventory slot. How the heck did you manage that? Stop it..." + return + + W.layer = 20 + + return + + + + +/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 + +/obj/effect/equip_e/human + name = "human" + var/mob/living/carbon/human/target = null + +/obj/effect/equip_e/monkey + name = "monkey" + var/mob/living/carbon/monkey/target = null + +/obj/effect/equip_e/process() + return + +/obj/effect/equip_e/proc/done() + return + +/obj/effect/equip_e/New() + if (!ticker) + del(src) + spawn(100) + del(src) + ..() + return + +/obj/effect/equip_e/human/process() if (item) item.add_fingerprint(source) if (!item) switch(place) if("mask") if (!( target.wear_mask )) - //SN src = null del(src) - return -/* if("headset") - if (!( target.w_radio )) - //SN src = null - del(src) - return */ if("l_hand") if (!( target.l_hand )) - //SN src = null del(src) - return if("r_hand") if (!( target.r_hand )) - //SN src = null del(src) - return if("suit") if (!( target.wear_suit )) - //SN src = null del(src) - return if("uniform") if (!( target.w_uniform )) - //SN src = null del(src) - return if("back") if (!( target.back )) - //SN src = null del(src) - return if("syringe") return if("pill") @@ -437,102 +284,93 @@ return if("handcuff") if (!( target.handcuffed )) - //SN src = null del(src) - return if("id") if ((!( target.wear_id ) || !( target.w_uniform ))) - //SN src = null del(src) - return if("internal") if ((!( (istype(target.wear_mask, /obj/item/clothing/mask) && istype(target.back, /obj/item/weapon/tank) && !( target.internal )) ) && !( target.internal ))) - //SN src = null del(src) - return var/list/L = list( "syringe", "pill", "drink", "dnainjector", "fuel") if ((item && !( L.Find(place) ))) if(isrobot(source) && place != "handcuff") del(src) - return for(var/mob/O in viewers(target, null)) - O.show_message(text("\red [] is trying to put \a [] on []", source, item, target), 1) + O.show_message("\red [source] is trying to put \a [item] on [target]", 1) else var/message=null switch(place) if("syringe") - message = text("\red [] is trying to inject []!", source, target) + message = "\red [source] is trying to inject [target]!" if("pill") - message = text("\red [] is trying to force [] to swallow []!", source, target, item) + message = "\red [source] is trying to force [target] to swallow [item]!" if("drink") - message = text("\red [] is trying to force [] to swallow a gulp of []!", source, target, item) + message = "\red [source] is trying to force [target] to swallow a gulp of [item]!" if("dnainjector") - message = text("\red [] is trying to inject [] with the []!", source, target, item) + message = "\red [source] is trying to inject [target] with the [item]!" if("mask") - if(istype(target.wear_mask, /obj/item/clothing)&&!target.wear_mask:canremove) - message = text("\red [] fails to take off \a [] from []'s body!", source, target.wear_mask, target) + if(target.wear_mask && !target.wear_mask.canremove) + message = "\red [source] fails to take off \a [target.wear_mask] from [target]'s head!" else - message = text("\red [] is trying to take off \a [] from []'s head!", source, target.wear_mask, target) -/* if("headset") - message = text("\red [] is trying to take off \a [] from []'s face!", source, target.w_radio, target) */ + message = "\red [source] is trying to take off \a [source.wear_mask] from [target]'s head!" if("l_hand") - message = text("\red [] is trying to take off \a [] from []'s left hand!", source, target.l_hand, target) + message = "\red [source] is trying to take off \a [target.l_hand] from [target]'s left hand!" if("r_hand") - message = text("\red [] is trying to take off \a [] from []'s right hand!", source, target.r_hand, target) + message = "\red [source] is trying to take off \a [target.r_hand] from [target]'s right hand!" if("gloves") - if(istype(target.gloves, /obj/item/clothing)&&!target.gloves:canremove) - message = text("\red [] fails to take off \a [] from []'s body!", source, target.gloves, target) + if(target.gloves && !target.gloves.canremove) + message = "\red [source] fails to take off \a [target.gloves] from [target]'s hands!" else - message = text("\red [] is trying to take off the [] from []'s hands!", source, target.gloves, target) + message = "\red [source] is trying to take off the [target.gloves] from [target]'s hands!" if("eyes") - if(istype(target.glasses, /obj/item/clothing)&&!target.glasses:canremove) - message = text("\red [] fails to take off \a [] from []'s body!", source, target.glasses, target) + if(target.glasses && !target.glasses.canremove) + message = "\red [source] fails to take off \a [target.glasses] from [target]'s eyes!" else - message = text("\red [] is trying to take off the [] from []'s eyes!", source, target.glasses, target) + message = "\red [source] is trying to take off the [target.glasses] from [target]'s eyes!" if("ears") - if(istype(target.ears, /obj/item/clothing)&&!target.ears:canremove) - message = text("\red [] fails to take off \a [] from []'s body!", source, target.ears, target) + if(target.ears && !target.ears.canremove) + message = "\red [source] fails to take off \a [target.ears] from [target]'s ears!" else - message = text("\red [] is trying to take off the [] from []'s ears!", source, target.ears, target) + message = "\red [source] is trying to take off the [target.ears] from [target]'s ears!" if("head") - if(istype(target.head, /obj/item/clothing)&&!target.head:canremove) - message = text("\red [] fails to take off \a [] from []'s body!", source, target.head, target) + if(target.head && !target.head.canremove) + message = "\red [source] fails to take off \a [target.head] from [target]'s head!" else - message = text("\red [] is trying to take off the [] from []'s head!", source, target.head, target) + message = "\red [source] is trying to take off the [target.head] from [target]'s head!" if("shoes") - if(istype(target.shoes, /obj/item/clothing)&&!target.shoes:canremove) - message = text("\red [] fails to take off \a [] from []'s body!", source, target.shoes, target) + if(target.shoes && !target.shoes.canremove) + message = "\red [source] fails to take off \a [target.shoes] from [target]'s feet!" else - message = text("\red [] is trying to take off the [] from []'s feet!", source, target.shoes, target) + message = "\red [source] is trying to take off the [target.shoes] from [target]'s feet!" if("belt") - message = text("\red [] is trying to take off the [] from []'s belt!", source, target.belt, target) + message = "\red [source] is trying to take off the [target.belt] from [target]'s belt!" if("suit") - if(istype(target.wear_suit, /obj/item/clothing)&&!target.wear_suit:canremove) - message = text("\red [] fails to take off \a [] from []'s body!", source, target.wear_suit, target) + if(target.wear_suit && !target.wear_suit.canremove) + message = "\red [source] fails to take off \a [target.wear_suit] from [target]'s body!" else - message = text("\red [] is trying to take off \a [] from []'s body!", source, target.wear_suit, target) + message = "\red [source] is trying to take off \a [target.wear_suit] from [target]'s body!" if("back") - message = text("\red [] is trying to take off \a [] from []'s back!", source, target.back, target) + message = "\red [source] is trying to take off \a [target.back] from [target]'s back!" if("handcuff") - message = text("\red [] is trying to unhandcuff []!", source, target) + message = "\red [source] is trying to unhandcuff [target]!" if("legcuff") - message = text("\red [] is trying to unlegcuff []!", source, target) + message = "\red [source] is trying to unlegcuff [target]!" if("uniform") - if(istype(target.w_uniform, /obj/item/clothing)&&!target.w_uniform:canremove) - message = text("\red [] fails to take off \a [] from []'s body!", source, target.w_uniform, target) + if(target.w_uniform && !target.w_uniform.canremove) + message = "\red [source] fails to take off \a [target.w_uniform] from [target]'s body!" else - message = text("\red [] is trying to take off \a [] from []'s body!", source, target.w_uniform, target) + message = "\red [source] is trying to take off \a [target.w_uniform] from [target]'s body!" if("s_store") - message = text("\red [] is trying to take off \a [] from []'s suit!", source, target.s_store, target) + message = "\red [source] is trying to take off \a [target.s_store] from [target]'s suit!" if("pockets") for(var/obj/item/weapon/mousetrap/MT in list(target.l_store, target.r_store)) if(MT.armed) for(var/mob/O in viewers(target, null)) if(O == source) - O.show_message(text("\red You reach into the [target]'s pockets, but there was a live mousetrap in there!"), 1) + O.show_message("\red You reach into the [target]'s pockets, but there was a live mousetrap in there!", 1) else - O.show_message(text("\red [source] reaches into [target]'s pockets and sets off a hidden mousetrap!"), 1) + O.show_message("\red [source] reaches into [target]'s pockets and sets off a hidden mousetrap!", 1) target.u_equip(MT) if (target.client) target.client.screen -= MT @@ -540,23 +378,21 @@ MT.triggered(source, source.hand ? "l_hand" : "r_hand") MT.layer = OBJ_LAYER return - message = text("\red [] is trying to empty []'s pockets!!", source, target) + message = "\red [source] is trying to empty [target]'s pockets." if("CPR") if (target.cpr_time >= world.time + 3) - //SN src = null del(src) - return - message = text("\red [] is trying perform CPR on []!", source, target) + message = "\red [source] is trying perform CPR on [target]!" if("id") - message = text("\red [] is trying to take off [] from []'s uniform!", source, target.wear_id, target) + message = "\red [source] is trying to take off [target.wear_id] from [target]'s uniform!" if("internal") if (target.internal) - message = text("\red [] is trying to remove []'s internals", source, target) + message = "\red [source] is trying to remove [target]'s internals" else - message = text("\red [] is trying to set on []'s internals.", source, target) + message = "\red [source] is trying to set on [target]'s internals." for(var/mob/M in viewers(target, null)) M.show_message(message, 1) - spawn( 40 ) + spawn( HUMAN_STRIP_DELAY ) done() return return @@ -571,448 +407,115 @@ The else statement is for equipping stuff to empty slots. It can still be worn/put on as normal. */ /obj/effect/equip_e/human/done() //TODO: And rewrite this :< ~Carn - if(!source || !target) return - if(source.loc != s_loc) return - if(target.loc != t_loc) return - if(LinkBlocked(s_loc,t_loc)) return - if(item && source.get_active_hand() != item) return - if ((source.restrained() || source.stat)) return - switch(place) + 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(LinkBlocked(s_loc,t_loc)) return //Use a proxi! + 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 + + 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) - if(istype(target.wear_mask, /obj/item/clothing)&& !target.wear_mask:canremove) - return - var/obj/item/clothing/W = target.wear_mask - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - if (W) - W.layer = initial(W.layer) - W.add_fingerprint(source) - else - if (istype(item, /obj/item/clothing/mask)) - source.drop_item() - loc = target - item.layer = 20 - target.wear_mask = item - item.loc = target - target.update_inv_wear_mask(0) -/* if("headset") - if (target.w_radio) - var/obj/item/W = target.w_radio - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - else - if (istype(item, /obj/item/device/radio/headset)) - source.drop_item() - loc = target - item.layer = 20 - target.w_radio = item - item.loc = target*/ + strip_item = target.wear_mask if("gloves") + slot_to_process = slot_gloves if (target.gloves) - if(istype(target.gloves, /obj/item/clothing)&& !target.gloves:canremove) - return - var/obj/item/clothing/W = target.gloves - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - else - if (istype(item, /obj/item/clothing/gloves)) - source.drop_item() - loc = target - item.layer = 20 - target.gloves = item - item.loc = target - target.update_inv_gloves(0) + strip_item = target.gloves if("eyes") + slot_to_process = slot_glasses if (target.glasses) - if(istype(target.glasses, /obj/item/clothing)&& !target.glasses:canremove) - return - var/obj/item/W = target.glasses - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - else - if (istype(item, /obj/item/clothing/glasses)) - source.drop_item() - loc = target - item.layer = 20 - target.glasses = item - item.loc = target - target.update_inv_glasses(0) + strip_item = target.glasses if("belt") + slot_to_process = slot_belt if (target.belt) - var/obj/item/W = target.belt - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - else - if ((istype(item, /obj) && (item.slot_flags & SLOT_BELT) && target.w_uniform)) - source.drop_item() - loc = target - item.layer = 20 - target.belt = item - item.loc = target - target.update_inv_belt(0) + strip_item = target.belt if("s_store") + slot_to_process = slot_s_store if (target.s_store) - var/obj/item/W = target.s_store - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - else - if (istype(item, /obj) && target.wear_suit) - var/confirm - for(var/i=1, i<=target.wear_suit.allowed.len, i++) - // world << "[target.wear_suit.allowed[i]] and [W.type]" - if (findtext("[item.type]","[target.wear_suit.allowed[i]]") || istype(item, /obj/item/device/pda) || istype(item, /obj/item/weapon/pen)) - confirm = 1 - break - if (!confirm) return - else - source.drop_item() - loc = target - item.layer = 20 - target.s_store = item - item.loc = target - target.update_inv_s_store(0) + strip_item = target.s_store if("head") + slot_to_process = slot_head if (target.head) - if(istype(target.head, /obj/item/clothing)&& !target.head:canremove) - return - var/obj/item/W = target.head - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - else - if (istype(item, /obj/item/clothing/head)) - source.drop_item() - loc = target - item.layer = 20 - target.head = item - item.loc = target - target.update_inv_head(0) + strip_item = target.head if("ears") + slot_to_process = slot_ears if (target.ears) - if(istype(target.ears, /obj/item/clothing)&& !target.ears:canremove) - return - var/obj/item/W = target.ears - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - else - if( istype(item, /obj/item/clothing/ears) || istype(item, /obj/item/device/radio/headset) ) - source.drop_item() - loc = target - item.layer = 20 - target.ears = item - item.loc = target - target.update_inv_ears(0) + strip_item = target.ears if("shoes") + slot_to_process = slot_shoes if (target.shoes) - if(istype(target.shoes, /obj/item/clothing)&& !target.shoes:canremove) - return - var/obj/item/W = target.shoes - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - else - if (istype(item, /obj/item/clothing/shoes)) - source.drop_item() - loc = target - item.layer = 20 - target.shoes = item - item.loc = target - target.update_inv_shoes(0) + strip_item = target.shoes if("l_hand") if (istype(target, /obj/item/clothing/suit/straight_jacket)) - //SN src = null del(src) - return + slot_to_process = slot_l_hand if (target.l_hand) - var/obj/item/W = target.l_hand - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.layer = initial(W.layer) - W.add_fingerprint(source) - W.dropped(target) //dropped sometimes deletes src so put it last - else - if(istype(item, /obj/item)) - source.drop_item() - if(item) - loc = target - item.layer = 20 - target.l_hand = item - item.loc = target - item.add_fingerprint(target) - target.update_inv_l_hand(0) + strip_item = target.l_hand if("r_hand") if (istype(target, /obj/item/clothing/suit/straight_jacket)) - //SN src = null del(src) - return + slot_to_process = slot_r_hand if (target.r_hand) - var/obj/item/W = target.r_hand - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.layer = initial(W.layer) - W.add_fingerprint(source) - W.dropped(target) //dropped sometimes deletes src so put it last - else - if (istype(item, /obj/item)) - source.drop_item() - loc = target - if (item) - item.layer = 20 - target.r_hand = item - item.loc = target - item.add_fingerprint(target) - target.update_inv_r_hand(0) + strip_item = target.r_hand if("uniform") + slot_to_process = slot_w_uniform if (target.w_uniform) - if(istype(target.w_uniform, /obj/item/clothing)&& !target.w_uniform:canremove) - return - var/obj/item/W = target.w_uniform - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - W = target.l_store - if (W) - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W = target.r_store - if (W) - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W = target.wear_id - if (W) - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - else - if (istype(item, /obj/item/clothing/under)) - source.drop_item() - loc = target - item.layer = 20 - target.w_uniform = item - item.loc = target - target.update_inv_w_uniform(0) + strip_item = target.w_uniform if("suit") - if(target.wear_suit) - var/obj/item/W = target.wear_suit - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - else - if (istype(item, /obj/item/clothing/suit)) - source.drop_item() - loc = target - item.layer = 20 - target.wear_suit = item - item.loc = target - target.update_inv_wear_suit(0) + slot_to_process = slot_wear_suit + if (target.wear_suit) + strip_item = target.wear_suit if("id") + slot_to_process = slot_wear_id if (target.wear_id) - var/obj/item/W = target.wear_id - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - else - if (((istype(item, /obj/item/weapon/card/id)||istype(item, /obj/item/device/pda)) && target.w_uniform)) - source.drop_item() - loc = target - item.layer = 20 - target.wear_id = item - item.loc = target - target.update_inv_wear_id(0) + strip_item = target.wear_id if("back") + slot_to_process = slot_back if (target.back) - var/obj/item/W = target.back - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - else - if ((istype(item, /obj/item) && (item.slot_flags & SLOT_BACK) )) - source.drop_item() - loc = target - item.layer = 20 - target.back = item - item.loc = target - target.update_inv_back(0) + strip_item = target.back if("handcuff") + slot_to_process = slot_handcuffed if (target.handcuffed) - var/obj/item/W = target.handcuffed - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - else - if (istype(item, /obj/item/weapon/handcuffs)) - target.drop_from_inventory(target.r_hand) - target.drop_from_inventory(target.l_hand) - source.drop_item() - target.handcuffed = item - item.loc = target - target.update_inv_handcuffed(0) + strip_item = target.handcuffed if("legcuff") + slot_to_process = slot_legcuffed if (target.legcuffed) - var/obj/item/W = target.legcuffed - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - else - if (istype(item, /obj/item/weapon/legcuffs)) - source.drop_item() - target.legcuffed = item - item.loc = target - target.update_inv_legcuffed(0) + strip_item = target.legcuffed if("CPR") if (target.cpr_time >= world.time + 30) - //SN src = null del(src) - return - if ((target.health >= -99.0 && target.health < 0)) + if ((target.health >= -99.0 && target.health <= 0)) target.cpr_time = world.time var/suff = min(target.getOxyLoss(), 7) target.adjustOxyLoss(-suff) target.updatehealth() for(var/mob/O in viewers(source, null)) - O.show_message(text("\red [] performs CPR on []!", source, target), 1) + 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 every 7 seconds AT LEAST." + 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) )) - //SN src = null S.inuse = 0 del(src) - return S.inject(target, source) if (S.s_time >= world.time + 30) - //SN src = null S.inuse = 0 del(src) - return S.s_time = world.time for(var/mob/O in viewers(source, null)) - O.show_message(text("\red [] injects [] with the DNA Injector!", source, target), 1) + O.show_message("\red [source] injects [target] with the DNA Injector!", 1) S.inuse = 0 if("pockets") - if (target.l_store) - var/obj/item/W = target.l_store - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) - if (target.r_store) - var/obj/item/W = target.r_store - target.u_equip(W) - if (target.client) - target.client.screen -= W - if (W) - W.loc = target.loc - W.dropped(target) - W.layer = initial(W.layer) - W.add_fingerprint(source) + slot_to_process = slot_l_store + strip_item = target.l_store //We'll do both if("internal") if (target.internal) target.internal.add_fingerprint(source) @@ -1031,208 +534,25 @@ It can still be worn/put on as normal. target.internal = target.belt if (target.internal) for(var/mob/M in viewers(target, 1)) - M.show_message(text("[] is now running on internals.", target), 1) + M.show_message("[source] is now running on internals.", 1) target.internal.add_fingerprint(source) if (target.internals) target.internals.icon_state = "internal1" - //update overlays -// source.update_icons() - if(target) - target.update_icons() - - spawn(0) // <-- not sure why this spawn is here - if(source) - if(source.machine == target) - target.show_inv(source) - del(src) - return - -/mob/living/carbon/human/db_click(text, t1) - var/obj/item/W = get_active_hand() - if(W) - if(!istype(W)) return - switch(text) - if("mask") - if(wear_mask) - return - if( !(W.slot_flags & SLOT_MASK) ) - return - u_equip(W) - wear_mask = W - if(wear_mask.flags & BLOCKHAIR) - update_hair(0) //rebuild hair - W.equipped(src, text) - update_inv_wear_mask() - if("back") - if(back) - return - if( !(W.slot_flags & SLOT_BACK) ) - return - if(istype(W,/obj/item/weapon/twohanded) && W:wielded) //TODO - usr << "Unwield the [initial(W.name)] first!" - return - u_equip(W) - back = W - W.equipped(src, text) - update_inv_back() - if("o_clothing") - if(wear_suit) - return - if( !(W.slot_flags & SLOT_OCLOTHING) ) - return - if( !(W.flags & ONESIZEFITSALL) && (FAT in mutations) ) - src << "\red You're too fat to wear the [W.name]!" - return - u_equip(W) - wear_suit = W - W.equipped(src, text) - update_inv_wear_suit() - if("gloves") - if(gloves) - return - if( !(W.slot_flags & SLOT_GLOVES) ) - return - u_equip(W) - gloves = W - W.equipped(src, text) - update_inv_gloves() - if("shoes") - if(shoes) - return - if( !( W.slot_flags & SLOT_FEET) ) - return - u_equip(W) - shoes = W - W.equipped(src, text) - update_inv_shoes() - if("belt") - if(belt) - return - if(!w_uniform) - return - if( !(W.slot_flags & SLOT_BELT) ) - return - u_equip(W) - belt = W - W.equipped(src, text) - update_inv_belt() - if("eyes") - if(glasses) - return - if( !(W.slot_flags & SLOT_EYES) ) - return - u_equip(W) - glasses = W - W.equipped(src, text) - update_inv_glasses() - if("head") - if(head) - return - if( !(W.slot_flags & SLOT_HEAD) ) - return - u_equip(W) - head = W - if(head.flags & BLOCKHAIR) - update_hair(0) //rebuild hair - if(istype(W,/obj/item/clothing/head/kitty)) - W.update_icon(src) - W.equipped(src, text) - update_inv_head() - if("ears") - if(ears) - return - if( !(W.slot_flags & SLOT_EARS) ) - return - u_equip(W) - ears = W - W.equipped(src, text) - update_inv_ears() - if("i_clothing") - if(w_uniform) - return - if( !(W.slot_flags & SLOT_ICLOTHING) ) - return - if( !(W.flags & ONESIZEFITSALL) && (FAT in src.mutations) ) - src << "\red You're too fat to wear the [W.name]!" - return - u_equip(W) - w_uniform = W - W.equipped(src, text) - update_inv_w_uniform() - if("id") - if(wear_id) - return - if(!w_uniform) - return - if( !(W.slot_flags & SLOT_ID) ) - return - u_equip(W) - wear_id = W - W.equipped(src, text) - update_inv_wear_id() - if("storage1") - if(l_store) - return - if(!w_uniform) - return - if(W.slot_flags & SLOT_DENYPOCKET) - return - if( W.w_class <= 2 || (W.slot_flags & SLOT_POCKET) ) - u_equip(W) - l_store = W - update_inv_pockets() - if("storage2") - if(r_store) - return - if(!w_uniform) - return - if(W.slot_flags & SLOT_DENYPOCKET) - return - if( W.w_class <= 2 || (W.slot_flags & SLOT_POCKET) ) - u_equip(W) - r_store = W - update_inv_pockets() - if("suit storage") - if(s_store) - return - if(!wear_suit) - return - if(!wear_suit.allowed) - usr << "You somehow have a suit with no defined allowed items for suit storage, stop that." - return - if( istype(W, /obj/item/device/pda) || istype(W, /obj/item/weapon/pen) || is_type_in_list(W, wear_suit.allowed) ) - u_equip(W) - s_store = W - update_inv_s_store() - else - switch(text) - if("mask") - if(wear_mask) wear_mask.attack_hand(src) - if("back") - if(back) back.attack_hand(src) - if("o_clothing") - if(wear_suit) wear_suit.attack_hand(src) - if("gloves") - if(gloves) gloves.attack_hand(src) - if("shoes") - if(shoes) shoes.attack_hand(src) - if("belt") - if(belt) belt.attack_hand(src) - if("eyes") - if(glasses) glasses.attack_hand(src) - if("head") - if(head) head.attack_hand(src) - if("ears") - if(ears) ears.attack_hand(src) - if("i_clothing") - if(w_uniform) w_uniform.attack_hand(src) - if("id") - if(wear_id) wear_id.attack_hand(src) - if("storage1") - if(l_store) l_store.attack_hand(src) - if("storage2") - if(r_store) r_store.attack_hand(src) - if("suit storage") - if(s_store) s_store.attack_hand(src) - return + if(slot_to_process) + if(strip_item) //Stripping an item from the mob + target.u_equip(strip_item) + 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.u_equip(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) //Placing an item on the mob + if(item.mob_can_equip(target, slot_to_process, 0)) + source.u_equip(item) + target.equip_to_slot_if_possible(item, slot_to_process, 0, 1, 1) + source.update_icons() + target.update_icons() + if(source) + if(source.machine == target) + target.show_inv(source) + del(src) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index 2999dbb6b7..1fb4f1e084 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -202,7 +202,7 @@ return -/mob/living/carbon/metroid/db_click(text, t1) +/mob/living/carbon/metroid/attack_ui(slot) return /mob/living/carbon/metroid/meteorhit(O as obj) diff --git a/code/modules/mob/living/carbon/monkey/hud.dm b/code/modules/mob/living/carbon/monkey/hud.dm index ea42bc3456..5048f8f313 100644 --- a/code/modules/mob/living/carbon/monkey/hud.dm +++ b/code/modules/mob/living/carbon/monkey/hud.dm @@ -171,6 +171,7 @@ using.icon_state = "hand1" using.screen_loc = ui_swaphand1 using.layer = 19 + using.slot_id = slot_l_hand src.adding += using using = new src.h_type( src ) @@ -179,6 +180,7 @@ using.icon = ui_style using.icon_state = "hand2" using.screen_loc = ui_swaphand2 + using.slot_id = slot_r_hand using.layer = 19 src.adding += using /* @@ -199,6 +201,7 @@ using.icon = ui_style using.icon_state = "equip" using.screen_loc = ui_monkey_mask + using.slot_id = slot_wear_mask using.layer = 19 src.adding += using @@ -208,6 +211,7 @@ using.icon = ui_style using.icon_state = "equip" using.screen_loc = ui_back + using.slot_id = slot_back using.layer = 19 src.adding += using /* diff --git a/code/modules/mob/living/carbon/monkey/inventory.dm b/code/modules/mob/living/carbon/monkey/inventory.dm index 9be679cc22..b1060ad9a9 100644 --- a/code/modules/mob/living/carbon/monkey/inventory.dm +++ b/code/modules/mob/living/carbon/monkey/inventory.dm @@ -184,4 +184,49 @@ source.regenerate_icons() target.regenerate_icons() del(src) + return + + + +//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible() +//set redraw_mob to 0 if you don't wish the hud to be updated - if you're doing it manually in your own proc. +/mob/living/carbon/monkey/equip_to_slot(obj/item/W as obj, slot, redraw_mob = 1) + if(!slot) return + if(!istype(W)) return + + if(W == get_active_hand()) + u_equip(W) + + switch(slot) + if(slot_back) + src.back = W + W.equipped(src, slot) + update_inv_back(redraw_mob) + if(slot_wear_mask) + src.wear_mask = W + W.equipped(src, slot) + update_inv_wear_mask(redraw_mob) + if(slot_handcuffed) + src.handcuffed = W + update_inv_handcuffed(redraw_mob) + if(slot_legcuffed) + src.legcuffed = W + W.equipped(src, slot) + update_inv_legcuffed(redraw_mob) + if(slot_l_hand) + src.l_hand = W + W.equipped(src, slot) + update_inv_l_hand(redraw_mob) + if(slot_r_hand) + src.r_hand = W + W.equipped(src, slot) + update_inv_r_hand(redraw_mob) + if(slot_in_backpack) + W.loc = src.back + else + usr << "\red You are trying to eqip this item to an unsupported inventory slot. How the heck did you manage that? Stop it..." + return + + W.layer = 20 + return \ No newline at end of file diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 5a12b9e19d..d58ea1f482 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -29,22 +29,6 @@ /atom/proc/relaymove() return -/obj/effect/equip_e/process() - return - -/obj/effect/equip_e/proc/done() - return - -/obj/effect/equip_e/New() - if (!ticker) - del(src) - return - spawn(100) - del(src) - return - ..() - return - /mob/proc/show_message(msg, type, alt, alt_type)//Message, type of message (1 or 2), alternative message, alt message type (1 or 2) if(!client) return if (type) @@ -111,35 +95,69 @@ return 1 return -//Used by monkeys, *chimpers* //TODO: eliminate this convoluted proc it's incredibly shitty. ~Carn -/mob/proc/db_click(text, t1) +//This proc is called whenever someone clicks an inventory ui slot. +/mob/proc/attack_ui(slot) var/obj/item/W = get_active_hand() - if(W) - if(!istype(W)) return - switch(text) - if("mask") - if(wear_mask) - return - if( !(W.slot_flags & SLOT_MASK) ) - return - u_equip(W) - wear_mask = W - W.equipped(src, text) - update_inv_wear_mask() - if("back") - if(back) - return - if( !(W.slot_flags & SLOT_BACK) ) - return - if( istype(W,/obj/item/weapon/twohanded) && W:wielded ) //TODO: Carn - usr << "Unwield the [initial(W.name)] first!" - return - u_equip(W) - back = W - W.equipped(src, text) - update_inv_back() + + if(istype(W)) + equip_to_slot_if_possible(W, slot) + +//This is a SAFE proc. Use this instead of equip_to_splot()! +//set del_on_fail to have it delete W if it fails to equip +//set disable_warning to disable the 'you are unable to equip that' warning. +//unset redraw_mob to prevent the mob from being redrawn at the end. +/mob/proc/equip_to_slot_if_possible(obj/item/W as obj, slot, del_on_fail = 0, disable_warning = 0, redraw_mob = 1) + if(!istype(W)) return 0 + + if(!W.mob_can_equip(src, slot, disable_warning)) + if(del_on_fail) + del(W) + else + if(!disable_warning) + src << "\red You are unable to equip that." //Only print if del_on_fail is false + return 0 + + equip_to_slot(W, slot, redraw_mob) //This proc should not ever fail. + return 1 + +//This is an UNSAFE proc. It merely handles the actual job of equipping. All the checks on whether you can or can't eqip need to be done before! Use mob_can_equip() for that task. +//In most cases you will want to use equip_to_slot_if_possible() +/mob/proc/equip_to_slot(obj/item/W as obj, slot) return +//This is just a commonly used configuration for the equip_to_slot_if_possible() proc, used to equip people when the rounds tarts and when events happen and such. +/mob/proc/equip_to_slot_or_del(obj/item/W as obj, slot) + equip_to_slot_if_possible(W, slot, 1, 1, 0) + +//The list of slots by priority. equip_to_appropriate_slot() uses this list. Doesn't matter if a mob type doesn't have a slot. +var/list/slot_equipment_priority = list( \ + slot_back,\ + slot_wear_id,\ + slot_w_uniform,\ + slot_wear_suit,\ + slot_wear_mask,\ + slot_head,\ + slot_shoes,\ + slot_gloves,\ + slot_ears,\ + slot_glasses,\ + slot_belt,\ + slot_s_store,\ + slot_l_store,\ + slot_r_store\ + ) + +//puts the item "W" into an appropriate slot in a human's inventory +//returns 0 if it cannot, 1 if successful +/mob/proc/equip_to_appropriate_slot(obj/item/W) + if(!istype(W)) return 0 + + for(var/slot in slot_equipment_priority) + if(equip_to_slot_if_possible(W, slot, 0, 1, 1)) //del_on_fail = 0; disable_warning = 0; redraw_mob = 1 + return 1 + + return 0 + /mob/proc/reset_view(atom/A) if (client) if (istype(A, /atom/movable)) diff --git a/code/modules/mob/mob_cleanup.dm b/code/modules/mob/mob_cleanup.dm index 60b4e36a0f..28abdb852f 100644 --- a/code/modules/mob/mob_cleanup.dm +++ b/code/modules/mob/mob_cleanup.dm @@ -108,8 +108,8 @@ Put (mob/proc)s here that are in dire need of a code cleanup. Cl = H.wear_suit passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) // world << "Suit pass [passed]" - if(passed && isobj(H.slot_w_uniform)) - Cl = H.slot_w_uniform + if(passed && isobj(slot_w_uniform)) + Cl = slot_w_uniform passed = prob(Cl.permeability_coefficient*100*virus.permeability_mod) // world << "Uniform pass [passed]" if(3) diff --git a/code/modules/mob/screen.dm b/code/modules/mob/screen.dm index 14d2cac3a1..6d3fcccfb6 100644 --- a/code/modules/mob/screen.dm +++ b/code/modules/mob/screen.dm @@ -5,6 +5,7 @@ unacidable = 1 var/id = 0.0 var/obj/master + var/slot_id /obj/screen/close name = "close" @@ -537,12 +538,12 @@ DblClick() return -/obj/screen/attack_hand(mob/user as mob, using) - user.db_click(name, using) +/obj/screen/attack_hand(mob/user as mob) + user.attack_ui(slot_id) return -/obj/screen/attack_paw(mob/user as mob, using) - user.db_click(name, using) +/obj/screen/attack_paw(mob/user as mob) + user.attack_ui(slot_id) return diff --git a/code/setup.dm b/code/setup.dm index 138de75623..0cac0cf069 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -97,6 +97,7 @@ var/MAX_EXPLOSION_RANGE = 14 //#define MAX_EXPLOSION_RANGE 14 // Defaults to 12 (was 8) -- TLE +#define HUMAN_STRIP_DELAY 40 //takes 40ds = 4s to strip someone. #define NORMPIPERATE 30 //pipe-insulation rate divisor #define HEATPIPERATE 8 //heat-exch pipe insulation @@ -172,10 +173,31 @@ var/MAX_EXPLOSION_RANGE = 14 #define HIDEJUMPSUIT 4 //APPLIES ONLY TO THE EXTERIOR SUIT!! #define HIDESHOES 8 //APPLIES ONLY TO THE EXTERIOR SUIT!! #define HIDEMASK 1 //APPLIES ONLY TO HELMETS/MASKS!! -#define HIDEEARS 2 //APPLIES ONLY TO HELMETS/MASKS!! -#define HIDEEYES 4 //APPLIES ONLY TO HELMETS/MASKS!! +#define HIDEEARS 2 //APPLIES ONLY TO HELMETS/MASKS!! (ears means headsets and such) +#define HIDEEYES 4 //APPLIES ONLY TO HELMETS/MASKS!! (eyes means glasses) #define HIDEFACE 8 //APPLIES ONLY TO HELMETS/MASKS!! Dictates whether we appear as unknown. +//slots +#define slot_back 1 +#define slot_wear_mask 2 +#define slot_handcuffed 3 +#define slot_l_hand 4 +#define slot_r_hand 5 +#define slot_belt 6 +#define slot_wear_id 7 +#define slot_ears 8 +#define slot_glasses 9 +#define slot_gloves 10 +#define slot_head 11 +#define slot_shoes 12 +#define slot_wear_suit 13 +#define slot_w_uniform 14 +#define slot_l_store 15 +#define slot_r_store 16 +#define slot_s_store 17 +#define slot_in_backpack 18 +#define slot_legcuffed 19 + //Cant seem to find a mob bitflags area other than the powers one // bitflags for clothing parts diff --git a/code/unused/gamemodes/deathmatch.dm b/code/unused/gamemodes/deathmatch.dm index 6e7736ac68..e748eb4f20 100644 --- a/code/unused/gamemodes/deathmatch.dm +++ b/code/unused/gamemodes/deathmatch.dm @@ -40,18 +40,18 @@ M.real_name = newname M.name = newname // there are WAY more things than this to change, I'm almost certain - M.equip_if_possible(new /obj/item/clothing/under/color/black(M), M.slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/black(M), M.slot_shoes) - M.equip_if_possible(new /obj/item/clothing/suit/swat_suit/death_commando(M), M.slot_wear_suit) - M.equip_if_possible(new /obj/item/clothing/mask/gas/death_commando(M), M.slot_wear_mask) - M.equip_if_possible(new /obj/item/clothing/gloves/swat(M), M.slot_gloves) - M.equip_if_possible(new /obj/item/clothing/glasses/thermal(M), M.slot_glasses) - M.equip_if_possible(new /obj/item/weapon/gun/energy/pulse_rifle(M), M.slot_l_hand) - M.equip_if_possible(new /obj/item/weapon/m_pill/cyanide(M), M.slot_l_store) - M.equip_if_possible(new /obj/item/weapon/flashbang(M), M.slot_r_store) + M.equip_to_slot_or_del(new /obj/item/clothing/under/color/black(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/suit/swat_suit/death_commando(M), slot_wear_suit) + M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/death_commando(M), slot_wear_mask) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal(M), slot_glasses) + M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle(M), slot_l_hand) + M.equip_to_slot_or_del(new /obj/item/weapon/m_pill/cyanide(M), slot_l_store) + M.equip_to_slot_or_del(new /obj/item/weapon/flashbang(M), slot_r_store) var/obj/item/weapon/tank/air/O = new(M) - M.equip_if_possible(O, M.slot_back) + M.equip_to_slot_or_del(O, slot_back) M.internal = O var/obj/item/weapon/card/id/W = new(M) @@ -59,7 +59,7 @@ W.name = "[newname]'s ID card (Death Commando)" W.assignment = "Death Commando" W.registered_name = newname - M.equip_if_possible(W, M.slot_wear_id) + M.equip_to_slot_or_del(W, slot_wear_id) ..() check_win() diff --git a/code/unused/jobs.dm b/code/unused/jobs.dm index 157982a274..849e28e2f8 100644 --- a/code/unused/jobs.dm +++ b/code/unused/jobs.dm @@ -193,22 +193,22 @@ proc/dress_for_job_default(var/mob/living/carbon/human/employee as mob, var/job_ var/datum/job/JOB = jobs.get_job(job_alias) if(JOB) var/item = JOB.equipment_ears[1] - employee.equip_if_possible(new item(employee), employee.slot_ears) + employee.equip_to_slot_or_del(new item(employee), employee.slot_ears) item = JOB.equipment_under[1] - employee.equip_if_possible(new item(employee), employee.slot_w_uniform) + employee.equip_to_slot_or_del(new item(employee), employee.slot_w_uniform) /* - src.equip_if_possible(new /obj/item/weapon/storage/backpack/industrial (src), slot_back) - src.equip_if_possible(new /obj/item/weapon/storage/box/engineer(src), slot_in_backpack) - src.equip_if_possible(new /obj/item/device/radio/headset/headset_eng (src), slot_ears) // -- TLE - src.equip_if_possible(new /obj/item/device/pda/engineering(src), slot_belt) - src.equip_if_possible(new /obj/item/clothing/under/rank/engineer(src), slot_w_uniform) - src.equip_if_possible(new /obj/item/clothing/shoes/orange(src), slot_shoes) - src.equip_if_possible(new /obj/item/clothing/head/helmet/hardhat(src), slot_head) - src.equip_if_possible(new /obj/item/weapon/storage/utilitybelt/full(src), slot_l_hand) //currently spawns in hand due to traitor assignment requiring a PDA to be on the belt. --Errorage - //src.equip_if_possible(new /obj/item/clothing/gloves/yellow(src), slot_gloves) removed as part of Dangercon 2011, approved by Urist_McDorf --Errorage - src.equip_if_possible(new /obj/item/device/t_scanner(src), slot_r_store) + src.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/industrial (src), slot_back) + src.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(src), slot_in_backpack) + src.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng (src), slot_ears) // -- TLE + src.equip_to_slot_or_del(new /obj/item/device/pda/engineering(src), slot_belt) + src.equip_to_slot_or_del(new /obj/item/clothing/under/rank/engineer(src), slot_w_uniform) + src.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(src), slot_shoes) + src.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/hardhat(src), slot_head) + src.equip_to_slot_or_del(new /obj/item/weapon/storage/utilitybelt/full(src), slot_l_hand) //currently spawns in hand due to traitor assignment requiring a PDA to be on the belt. --Errorage + //src.equip_to_slot_or_del(new /obj/item/clothing/gloves/yellow(src), slot_gloves) removed as part of Dangercon 2011, approved by Urist_McDorf --Errorage + src.equip_to_slot_or_del(new /obj/item/device/t_scanner(src), slot_r_store) */