Merge pull request #2292 from tigercat2000/fancy

-tg- style inventory update, stripping update
This commit is contained in:
Fox McCloud
2015-10-06 18:49:08 -04:00
28 changed files with 822 additions and 1486 deletions

View File

@@ -101,3 +101,8 @@
// AI wire/radio settings
#define AI_CHECK_WIRELESS 1
#define AI_CHECK_RADIO 2
#define POCKET_STRIP_DELAY 40 //time taken (in deciseconds) to search somebody's pockets
#define DEFAULT_ITEM_STRIP_DELAY 40 //time taken (in deciseconds) to strip somebody
#define DEFAULT_ITEM_PUTON_DELAY 20 //time taken (in deciseconsd) to reverse-strip somebody

View File

@@ -438,7 +438,7 @@
if("Allow Item Use")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
if(!istype(usr.get_active_hand(), /obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetClick()
@@ -448,7 +448,7 @@
if("Disallow Item Use")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
if(!istype(usr.get_active_hand(), /obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetClick()

View File

@@ -158,9 +158,9 @@
// spawn (100)
// if (rev_mob.r_store)
// rev_mob.equip_if_possible(new /obj/item/weapon/paper/communist_manifesto(rev_mob), rev_mob.slot_l_store)
// rev_mob.equip_or_collect(new /obj/item/weapon/paper/communist_manifesto(rev_mob), rev_mob.slot_l_store)
// if (rev_mob.l_store)
// rev_mob.equip_if_possible(new /obj/item/weapon/paper/communist_manifesto(rev_mob), rev_mob.slot_r_store)
// rev_mob.equip_or_collect(new /obj/item/weapon/paper/communist_manifesto(rev_mob), rev_mob.slot_r_store)
/datum/game_mode/rp_revolution/check_win()

View File

@@ -129,9 +129,9 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/melee/baton/loaded/ntcane(H.back), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/lighter/zippo/nt_rep(H.back), slot_in_backpack)
H.equip_if_possible(new /obj/item/clothing/under/rank/ntrep(H), slot_w_uniform)
H.equip_if_possible(new /obj/item/clothing/suit/storage/ntrep(H), slot_wear_suit)
H.equip_if_possible(new /obj/item/clothing/shoes/centcom(H), slot_shoes)
H.equip_or_collect(new /obj/item/clothing/under/rank/ntrep(H), slot_w_uniform)
H.equip_or_collect(new /obj/item/clothing/suit/storage/ntrep(H), slot_wear_suit)
H.equip_or_collect(new /obj/item/clothing/shoes/centcom(H), slot_shoes)
H.equip_or_collect(new /obj/item/device/pda/heads/ntrep(H), slot_wear_pda)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
@@ -172,8 +172,8 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
H.equip_or_collect(new /obj/item/clothing/gloves/combat(H), slot_gloves)
H.equip_or_collect(new /obj/item/clothing/shoes/jackboots(H), slot_shoes)
H.equip_or_collect(new /obj/item/clothing/glasses/hud/health_advanced, slot_glasses)
H.equip_if_possible(new /obj/item/clothing/under/rank/blueshield(H), slot_w_uniform)
H.equip_if_possible(new /obj/item/clothing/suit/armor/vest/blueshield(H), slot_wear_suit)
H.equip_or_collect(new /obj/item/clothing/under/rank/blueshield(H), slot_w_uniform)
H.equip_or_collect(new /obj/item/clothing/suit/armor/vest/blueshield(H), slot_wear_suit)
H.equip_or_collect(new /obj/item/weapon/gun/energy/advtaser(H), slot_s_store)
H.equip_or_collect(new /obj/item/device/pda/heads/blueshield(H), slot_wear_pda)
if(H.backbag == 1)
@@ -215,9 +215,9 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
if(4) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_if_possible(new /obj/item/clothing/under/suit_jacket/really_black(H), slot_w_uniform)
H.equip_if_possible(new /obj/item/clothing/suit/judgerobe(H), slot_wear_suit)
H.equip_if_possible(new /obj/item/clothing/shoes/centcom(H), slot_shoes)
H.equip_or_collect(new /obj/item/clothing/under/suit_jacket/really_black(H), slot_w_uniform)
H.equip_or_collect(new /obj/item/clothing/suit/judgerobe(H), slot_wear_suit)
H.equip_or_collect(new /obj/item/clothing/shoes/centcom(H), slot_shoes)
H.equip_or_collect(new /obj/item/clothing/head/powdered_wig(H), slot_head)
H.equip_or_collect(new /obj/item/clothing/glasses/sunglasses/sechud(H), slot_glasses)
H.equip_or_collect(new /obj/item/device/pda/heads/magistrate(H), slot_wear_pda)

View File

@@ -1,163 +0,0 @@
/obj/machinery/metaldetector
name = "metal detector"
desc = "a metal detector. staff can toggle this between ignore security and detect all with their id."
anchored = 1.0
density = 0
icon = 'icons/obj/machines/metal_detector.dmi'
icon_state = "metaldetector0"
use_power = 1
idle_power_usage = 20
active_power_usage = 250
var/guncount = 0
var/knifecount = 0
var/bombcount = 0
var/meleecount = 0
var/detectall = 0
/obj/machinery/metaldetector/check_access(obj/item/weapon/card/id/I, list/access_list)
if(!istype(access_list))
return 1
if(!access_list.len) //no requirements
return 1
if(istype(I, /obj/item/device/pda))
var/obj/item/device/pda/pda = I
I = pda.id
if(!istype(I) || !I.access) //not ID or no access
return 0
return 1
/obj/machinery/metaldetector/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/weapon/card))
for(var/ID in list(user.equipped(), user:wear_id, user:belt))
if(src.check_access(ID,list("20")))
if(!src.detectall)
src.detectall = 1
user << "\blue You set the [src] to detect all personnel."
return
else
src.detectall = 0
user << "\blue You set the [src] to ignore all staff and security."
return
else
user << "\red You lack access to the control panel!"
return
/obj/machinery/metaldetector/emag_act(user as mob)
if(!emagged)
emagged = 1
user << "\blue You short out the circuitry."
return
/obj/machinery/metaldetector/Crossed(AM as mob|obj)
if(emagged)
return
if (istype(AM, /mob/living))
var/mob/M = AM
if(!src.detectall)
if(M:wear_id || M:belt)
for(var/ID in list(M:equipped(), M:wear_id, M:belt))
if(src.check_access(ID,list("1", "2", "3", "20", "57", "58")))
return
if (istype(M, /mob/living))
for(var/obj/item/weapon/gun/G in M)
guncount++
for(var/obj/item/device/transfer_valve/B in M)
bombcount++
for(var/obj/item/weapon/kitchen/utensil/knife/K in M)
knifecount++
for(var/obj/item/weapon/kitchenknife/KK in M)
knifecount++
for(var/obj/item/weapon/c4/KK in M)
bombcount++
for(var/obj/item/weapon/melee/ML in M)
meleecount++
if(guncount)
flick("metaldetector2",src)
playsound(src.loc, 'sound/effects/alert.ogg', 60, 0)
for (var/mob/O in viewers(O, null))
O << "\red <b>[src.name]</b> beeps, \"Alert! Firearm found on [M.name]!\""
if(seen_by_camera(M))
// determine the name of the perp (goes by ID if wearing one)
var/perpname = M.name
if(M:wear_id && M:wear_id.registered_name)
perpname = M:wear_id.registered_name
// find the matching security record
for(var/datum/data/record/R in data_core.general)
if(R.fields["name"] == perpname)
for (var/datum/data/record/S in data_core.security)
if (S.fields["id"] == R.fields["id"])
// now add to rap sheet
S.fields["criminal"] = "*Arrest*"
S.fields["mi_crim"] = "Carrying a firearm."
break
guncount = 0
else if(knifecount)
flick("metaldetector2",src)
playsound(src.loc, 'sound/effects/alert.ogg', 60, 0)
for (var/mob/O in viewers(O, null))
O << "\red <b>[src.name]</b> beeps, \"Alert! Knife found on [M.name]!\""
if(seen_by_camera(M))
// determine the name of the perp (goes by ID if wearing one)
var/perpname = M.name
if(M:wear_id && M:wear_id.registered_name)
perpname = M:wear_id.registered_name
// find the matching security record
for(var/datum/data/record/R in data_core.general)
if(R.fields["name"] == perpname)
for (var/datum/data/record/S in data_core.security)
if (S.fields["id"] == R.fields["id"])
// now add to rap sheet
S.fields["criminal"] = "*Arrest*"
S.fields["mi_crim"] = "Carrying a knife."
break
knifecount = 0
else if(bombcount)
flick("metaldetector2",src)
playsound(src.loc, 'sound/effects/alert.ogg', 60, 0)
for (var/mob/O in viewers(O, null))
O << "\red <b>[src.name]</b> beeps, \"Alert! Bomb found on [M.name]!\""
if(seen_by_camera(M))
// determine the name of the perp (goes by ID if wearing one)
var/perpname = M.name
if(M:wear_id && M:wear_id.registered_name)
perpname = M:wear_id.registered_name
// find the matching security record
for(var/datum/data/record/R in data_core.general)
if(R.fields["name"] == perpname)
for (var/datum/data/record/S in data_core.security)
if (S.fields["id"] == R.fields["id"])
// now add to rap sheet
S.fields["criminal"] = "*Arrest*"
S.fields["mi_crim"] = "Carrying a bomb."
break
bombcount = 0
else if(meleecount)
flick("metaldetector2",src)
playsound(src.loc, 'sound/effects/alert.ogg', 60, 0)
for (var/mob/O in viewers(O, null))
O << "\red <b>[src.name]</b> beeps, \"Alert! Melee weapon found on [M.name]!\""
if(seen_by_camera(M))
// determine the name of the perp (goes by ID if wearing one)
var/perpname = M.name
if(M:wear_id && M:wear_id.registered_name)
perpname = M:wear_id.registered_name
// find the matching security record
for(var/datum/data/record/R in data_core.general)
if(R.fields["name"] == perpname)
for (var/datum/data/record/S in data_core.security)
if (S.fields["id"] == R.fields["id"])
// now add to rap sheet
S.fields["criminal"] = "*Arrest*"
S.fields["mi_crim"] = "Carrying a weapon."
break
meleecount = 0
else
flick("metaldetector1",src)

View File

@@ -49,6 +49,9 @@
var/list/allowed = null //suit storage stuff.
var/obj/item/device/uplink/hidden/hidden_uplink = null // All items can have an uplink hidden inside, just remember to add the triggers.
var/strip_delay = DEFAULT_ITEM_STRIP_DELAY
var/put_on_delay = DEFAULT_ITEM_PUTON_DELAY
/* Species-specific sprites, concept stolen from Paradise//vg/.
ex:
sprite_sheets = list(
@@ -298,245 +301,11 @@
//the mob M is attempting to equip this item into the slot passed through as 'slot'. Return 1 if it can do this and 0 if it can't.
//If you are making custom procs but would like to retain partial or complete functionality of this one, include a 'return ..()' to where you want this to happen.
//Set disable_warning to 1 if you wish it to not give you outputs.
/obj/item/proc/mob_can_equip(M as mob, slot, disable_warning = 0)
if(!slot) return 0
if(!M) return 0
if(issmall(M))
//START MONKEY
var/mob/living/carbon/human/H = M
switch(slot)
if(slot_l_hand)
if(H.l_hand)
return 0
return 1
if(slot_r_hand)
if(H.r_hand)
return 0
return 1
if(slot_wear_mask)
if(H.wear_mask)
return 0
if( !(slot_flags & SLOT_MASK) )
return 0
return 1
if(slot_back)
if(H.back)
return 0
if( !(slot_flags & SLOT_BACK) )
return 0
return 1
if(slot_handcuffed)
if(H.handcuffed)
return 0
if(!istype(src, /obj/item/weapon/restraints/handcuffs))
return 0
return 1
if(slot_in_backpack)
if (H.back && istype(H.back, /obj/item/weapon/storage/backpack))
var/obj/item/weapon/storage/backpack/B = H.back
if(B.contents.len < B.storage_slots && w_class <= B.max_w_class)
return 1
return 0
return 0 //Unsupported slot
//END MONKEY
if(ishuman(M))
//START HUMAN
var/mob/living/carbon/human/H = M
if(istype(src, /obj/item/clothing/under) || istype(src, /obj/item/clothing/suit))
if(FAT in H.mutations)
//testing("[M] TOO FAT TO WEAR [src]!")
if(!(flags & ONESIZEFITSALL))
if(!disable_warning)
H << "\red You're too fat to wear the [name]."
/obj/item/proc/mob_can_equip(mob/M, slot, disable_warning = 0)
if(!M)
return 0
switch(slot)
if(slot_l_hand)
if(H.l_hand)
return 0
return 1
if(slot_r_hand)
if(H.r_hand)
return 0
return 1
if(slot_wear_mask)
if(H.wear_mask)
return 0
if( !(slot_flags & SLOT_MASK) )
return 0
return 1
if(slot_back)
if(H.back)
return 0
if( !(slot_flags & SLOT_BACK) )
return 0
return 1
if(slot_wear_suit)
if(H.wear_suit)
return 0
if( !(slot_flags & SLOT_OCLOTHING) )
return 0
return 1
if(slot_gloves)
if(H.gloves)
return 0
if( !(slot_flags & SLOT_GLOVES) )
return 0
return 1
if(slot_shoes)
if(H.shoes)
return 0
if( !(slot_flags & SLOT_FEET) )
return 0
return 1
if(slot_belt)
if(H.belt)
return 0
if(!H.w_uniform)
if(!disable_warning)
H << "\red You need a jumpsuit before you can attach this [name]."
return 0
if( !(slot_flags & SLOT_BELT) )
return
return 1
if(slot_glasses)
if(H.glasses)
return 0
if( !(slot_flags & SLOT_EYES) )
return 0
return 1
if(slot_head)
if(H.head)
return 0
if( !(slot_flags & SLOT_HEAD) )
return 0
return 1
if(slot_l_ear)
if(H.l_ear)
return 0
if( !(slot_flags & SLOT_EARS) )
return 0
if( (slot_flags & SLOT_TWOEARS) && H.r_ear )
return 0
return 1
if(slot_r_ear)
if(H.r_ear)
return 0
if( !(slot_flags & SLOT_EARS) )
return 0
if( (slot_flags & SLOT_TWOEARS) && H.l_ear )
return 0
return 1
if(slot_w_uniform)
if(H.w_uniform)
return 0
if( !(slot_flags & SLOT_ICLOTHING) )
return 0
return 1
if(slot_wear_id)
if(H.wear_id)
return 0
if(!H.w_uniform)
if(!disable_warning)
H << "\red You need a jumpsuit before you can attach this [name]."
return 0
if( !(slot_flags & SLOT_ID) )
return 0
return 1
if(slot_wear_pda)
if(H.wear_pda)
return 0
if(!H.w_uniform)
if(!disable_warning)
H << "\red You need a jumpsuit before you can attach this [name]."
return 0
if( !(slot_flags & SLOT_PDA) )
return 0
return 1
if(slot_l_store)
if(flags & NODROP) //Pockets aren't visible, so you can't move NODROP items into them.
return 0
if(H.l_store)
return 0
if(!H.w_uniform)
if(!disable_warning)
H << "\red You need a jumpsuit before you can attach this [name]."
return 0
if(slot_flags & SLOT_DENYPOCKET)
return
if( w_class <= 2 || (slot_flags & SLOT_POCKET) )
return 1
if(slot_r_store)
if(flags & NODROP)
return 0
if(H.r_store)
return 0
if(!H.w_uniform)
if(!disable_warning)
H << "\red You need a jumpsuit before you can attach this [name]."
return 0
if(slot_flags & SLOT_DENYPOCKET)
return 0
if( w_class <= 2 || (slot_flags & SLOT_POCKET) )
return 1
return 0
if(slot_s_store)
if(flags & NODROP) //Suit storage NODROP items drop if you take a suit off, this is to prevent people exploiting this.
return 0
if(H.s_store)
return 0
if(!H.wear_suit)
if(!disable_warning)
H << "\red You need a suit before you can attach this [name]."
return 0
if(!H.wear_suit.allowed)
if(!disable_warning)
usr << "You somehow have a suit with no defined allowed items for suit storage, stop that."
return 0
if(src.w_class > 4)
if(!disable_warning)
usr << "The [name] is too big to attach."
return 0
if( istype(src, /obj/item/device/pda) || istype(src, /obj/item/weapon/pen) || is_type_in_list(src, H.wear_suit.allowed) )
return 1
return 0
if(slot_handcuffed)
if(H.handcuffed)
return 0
if(!istype(src, /obj/item/weapon/restraints/handcuffs))
return 0
return 1
if(slot_legcuffed)
if(H.legcuffed)
return 0
if(!istype(src, /obj/item/weapon/restraints/legcuffs))
return 0
return 1
if(slot_in_backpack)
if (H.back && istype(H.back, /obj/item/weapon/storage/backpack))
var/obj/item/weapon/storage/backpack/B = H.back
if(B.contents.len < B.storage_slots && w_class <= B.max_w_class)
return 1
return 0
if(slot_tie)
if(!H.w_uniform)
if(!disable_warning)
H << "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>"
return 0
var/obj/item/clothing/under/uniform = H.w_uniform
if(uniform.accessories.len && !uniform.can_attach_accessory(src))
if (!disable_warning)
H << "<span class='warning'>You already have an accessory of this type attached to your [uniform].</span>"
return 0
if( !(slot_flags & SLOT_TIE) )
return 0
return 1
return 0 //Unsupported slot
//END HUMAN
return M.can_equip(src, slot, disable_warning)
/obj/item/verb/verb_pickup()
set src in oview(1)

View File

@@ -238,6 +238,9 @@
return
if(affecting.status & ORGAN_SPLINTED)
user << "\red [M]'s [limb] is already splinted!"
if(alert(user, "Would you like to remove the splint from [M]'s [limb]?", "Removing.", "Yes", "No") == "Yes")
affecting.status &= ~ORGAN_SPLINTED
user << "<span class='notice'>You remove the splint from [M]'s [limb]."
return
if (M != user)
user.visible_message("\red [user] starts to apply \the [src] to [M]'s [limb].", "\red You start to apply \the [src] to [M]'s [limb].", "\red You hear something being wrapped.")

View File

@@ -96,10 +96,13 @@
if(ishuman(M)) // Would've done this via species instead of type, but the basic mob doesn't have a species, go figure.
var/mob/living/carbon/human/H = M
if(H.species.flags & NO_DNA_RAD)
return
return 0
if (!usr.IsAdvancedToolUser())
return
if (!user.IsAdvancedToolUser())
return 0
if(inuse)
return 0
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been injected with [name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [name] to inject [M.name] ([M.ckey])</font>")
@@ -110,91 +113,37 @@
else
M.LAssailant = user
if (user)
if (istype(M, /mob/living/carbon/human))
if(!inuse)
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( )
O.source = user
O.target = M
O.item = src
O.s_loc = user.loc
O.t_loc = M.loc
O.place = "dnainjector"
src.inuse = 1
spawn(50) // Not the best fix. There should be an failure proc, for /effect/equip_e/, which is called when the first initital checks fail
inuse = 0
M.requests += O
if(buf.types & DNA2_BUF_SE)
if(block)// Isolated injector
//testing("Isolated block [block] injector with contents: [GetValue()]")
if (GetState() && block == MONKEYBLOCK && istype(M, /mob/living/carbon/human) )
if(block)
if(GetState() && block == MONKEYBLOCK && ishuman(M))
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)")
log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name] (MONKEY)")
log_game("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)")
else
log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name]")
else
// testing("DNA injector with contents: [english_list(buf.dna.SE)]")
if (GetState(MONKEYBLOCK) && istype(M, /mob/living/carbon/human) )
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)")
log_attack("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)")
log_game("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)")
else
// message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_attack("[key_name(user)] injected [key_name(M)] with the [name]")
else
// message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_attack("[key_name(user)] injected [key_name(M)] with the [name]")
spawn( 0 )
O.process()
return
else
if(!inuse)
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [] has been injected with [] by [].", M, src, user), 1)
//Foreach goto(192)
if (!(istype(M, /mob/living/carbon/human)))
user << "\red Apparently it didn't work."
return
if (buf.types & DNA2_BUF_SE)
if(block)// Isolated injector
// testing("Isolated block [block] injector with contents: [english_list(GetValue())]")
if (GetState() && block == MONKEYBLOCK && istype(M, /mob/living/carbon/human) )
if(GetState(MONKEYBLOCK) && ishuman(M))
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)")
log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name] (MONKEY)")
log_game("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)")
else
log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name]")
else
// testing("DNA injector with contents: [english_list(buf.dna.SE)]")
if (GetState(MONKEYBLOCK) && istype(M, /mob/living/carbon/human))
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)")
log_game("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)")
else
// message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_game("[key_name(user)] injected [key_name(M)] with the [name]")
else
// message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_game("[key_name(user)] injected [key_name(M)] with the [name]")
inuse = 1
inject(M, user)//Now we actually do the heavy lifting.
spawn(50)
inuse = 0
/*
A user injecting themselves could mean their own transformation and deletion of mob.
I don't have the time to figure out how this code works so this will do for now.
I did rearrange things a bit.
*/
log_attack("[key_name(user)] injected [key_name(M)] with the [name]")
user.visible_message("<span class='danger'>\The [user] starts injecting \the [M] with \the [src]!</span>", "<span class='notice'>You start injecting \the [M] with \the [src].</span>")
if(do_after(user, 50, target = M))
inject(M, user)//Now we actually do the heavy lifting
user.visible_message("<span class='danger'>\The [user] injects \the [M] with \the [src]!</span>", "<span class='danger'>You inject \the [M] with \the [src].</span>")
if(user)//If the user still exists. Their mob may not.
if(M)//Runtime fix: If the mob doesn't exist, mob.name doesnt work. - Nodrak
user.show_message(text("\red You inject [M.name]"))
user.show_message("<span class='alert'>You inject [M.name]</span>")
else
user.show_message(text("\red You finish the injection."))
return
user.show_message("<span class='alert'>You finish the injection.</span>")
/obj/item/weapon/dnainjector/hulkmut

View File

@@ -826,43 +826,43 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_syndicate_commando()
if("nanotrasen officer")
M.equip_if_possible(new /obj/item/clothing/under/rank/centcom/officer(M), slot_w_uniform)
M.equip_if_possible(new /obj/item/clothing/shoes/centcom(M), slot_shoes)
M.equip_if_possible(new /obj/item/clothing/gloves/color/white(M), slot_gloves)
M.equip_if_possible(new /obj/item/device/radio/headset/heads/captain/alt(M), slot_l_ear)
M.equip_if_possible(new /obj/item/clothing/head/beret/centcom/officer(M), slot_head)
M.equip_or_collect(new /obj/item/clothing/shoes/centcom(M), slot_shoes)
M.equip_or_collect(new /obj/item/clothing/gloves/color/white(M), slot_gloves)
M.equip_or_collect(new /obj/item/device/radio/headset/heads/captain/alt(M), slot_l_ear)
M.equip_or_collect(new /obj/item/clothing/head/beret/centcom/officer(M), slot_head)
var/obj/item/device/pda/centcom/pda = new(M)
pda.owner = M.real_name
pda.ownjob = "Nanotrasen Navy Officer"
pda.name = "PDA-[M.real_name] ([pda.ownjob])"
M.equip_if_possible(pda, slot_r_store)
M.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store)
M.equip_if_possible(new /obj/item/weapon/gun/energy/pulse_rifle/pistol(M), slot_belt)
M.equip_or_collect(pda, slot_r_store)
M.equip_or_collect(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store)
M.equip_or_collect(new /obj/item/weapon/gun/energy/pulse_rifle/pistol(M), slot_belt)
var/obj/item/weapon/card/id/centcom/W = new(M)
W.name = "[M.real_name]'s ID Card (Nanotrasen Navy Officer)"
W.assignment = "Nanotrasen Navy Officer"
W.access = get_centcom_access(W.assignment)
W.registered_name = M.real_name
M.equip_if_possible(W, slot_wear_id)
M.equip_or_collect(W, slot_wear_id)
if("nanotrasen captain")
M.equip_if_possible(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform)
M.equip_if_possible(new /obj/item/clothing/shoes/centcom(M), slot_shoes)
M.equip_if_possible(new /obj/item/clothing/gloves/color/white(M), slot_gloves)
M.equip_if_possible(new /obj/item/device/radio/headset/heads/captain/alt(M), slot_l_ear)
M.equip_if_possible(new /obj/item/clothing/head/beret/centcom/captain(M), slot_head)
M.equip_or_collect(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform)
M.equip_or_collect(new /obj/item/clothing/shoes/centcom(M), slot_shoes)
M.equip_or_collect(new /obj/item/clothing/gloves/color/white(M), slot_gloves)
M.equip_or_collect(new /obj/item/device/radio/headset/heads/captain/alt(M), slot_l_ear)
M.equip_or_collect(new /obj/item/clothing/head/beret/centcom/captain(M), slot_head)
var/obj/item/device/pda/centcom/pda = new(M)
pda.owner = M.real_name
pda.ownjob = "Nanotrasen Navy Captain"
pda.name = "PDA-[M.real_name] ([pda.ownjob])"
M.equip_if_possible(pda, slot_r_store)
M.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store)
M.equip_if_possible(new /obj/item/weapon/gun/energy/pulse_rifle/pistol(M), slot_belt)
M.equip_or_collect(pda, slot_r_store)
M.equip_or_collect(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store)
M.equip_or_collect(new /obj/item/weapon/gun/energy/pulse_rifle/pistol(M), slot_belt)
var/obj/item/weapon/card/id/centcom/W = new(M)
W.name = "[M.real_name]'s ID Card (Nanotrasen Navy Captain)"
@@ -870,7 +870,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
W.assignment = "Nanotrasen Navy Captain"
W.access = get_centcom_access(W.assignment)
W.registered_name = M.real_name
M.equip_if_possible(W, slot_wear_id)
M.equip_or_collect(W, slot_wear_id)
if("emergency response team member")
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform)
@@ -947,7 +947,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(W, slot_wear_id)
if("special ops formal")
M.equip_if_possible(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform)
M.equip_or_collect(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/device/radio/headset/ert/alt(src), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
@@ -957,7 +957,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle/pistol/m1911(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/matches(M), slot_r_store)
M.equip_if_possible(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_l_store)
M.equip_or_collect(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_l_store)
var/obj/item/device/pda/centcom/pda = new(M)
pda.owner = M.real_name
@@ -966,10 +966,10 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
pda.name = "PDA-[M.real_name] ([pda.ownjob])"
pda.desc = "A portable microcomputer by Thinktronic Systems, LTD. This is model is a special edition designed for military field work."
M.equip_if_possible(pda, slot_wear_pda)
M.equip_or_collect(pda, slot_wear_pda)
M.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store)
M.equip_if_possible(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_r_store)
M.equip_or_collect(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store)
M.equip_or_collect(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_r_store)
var/obj/item/weapon/card/id/W = new(M)
W.name = "[M.real_name]'s ID Card (Special Operations Officer)"

View File

@@ -190,48 +190,48 @@ BLIND // can't see anything
/obj/item/clothing/gloves/proc/Touch()
return
/obj/item/clothing/under/proc/set_sensors(mob/usr as mob)
var/mob/M = usr
/obj/item/clothing/under/proc/set_sensors(mob/user as mob)
var/mob/M = user
if (istype(M, /mob/dead/)) return
if (usr.stat || usr.restrained()) return
if (user.stat || user.restrained()) return
if(has_sensor >= 2)
usr << "The controls are locked."
user << "The controls are locked."
return 0
if(has_sensor <= 0)
usr << "This suit does not have any sensors."
user << "This suit does not have any sensors."
return 0
var/list/modes = list("Off", "Binary sensors", "Vitals tracker", "Tracking beacon")
var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes
if(get_dist(usr, src) > 1)
usr << "You have moved too far away."
if(get_dist(user, src) > 1)
user << "You have moved too far away."
return
sensor_mode = modes.Find(switchMode) - 1
if (src.loc == usr)
if (src.loc == user)
switch(sensor_mode)
if(0)
usr << "You disable your suit's remote sensing equipment."
user << "You disable your suit's remote sensing equipment."
if(1)
usr << "Your suit will now report whether you are live or dead."
user << "Your suit will now report whether you are live or dead."
if(2)
usr << "Your suit will now report your vital lifesigns."
user << "Your suit will now report your vital lifesigns."
if(3)
usr << "Your suit will now report your vital lifesigns as well as your coordinate position."
user << "Your suit will now report your vital lifesigns as well as your coordinate position."
else if (istype(src.loc, /mob))
switch(sensor_mode)
if(0)
for(var/mob/V in viewers(usr, 1))
V.show_message("\red [usr] disables [src.loc]'s remote sensing equipment.", 1)
for(var/mob/V in viewers(user, 1))
V.show_message("\red [user] disables [src.loc]'s remote sensing equipment.", 1)
if(1)
for(var/mob/V in viewers(usr, 1))
V.show_message("[usr] turns [src.loc]'s remote sensors to binary.", 1)
for(var/mob/V in viewers(user, 1))
V.show_message("[user] turns [src.loc]'s remote sensors to binary.", 1)
if(2)
for(var/mob/V in viewers(usr, 1))
V.show_message("[usr] sets [src.loc]'s sensors to track vitals.", 1)
for(var/mob/V in viewers(user, 1))
V.show_message("[user] sets [src.loc]'s sensors to track vitals.", 1)
if(3)
for(var/mob/V in viewers(usr, 1))
V.show_message("[usr] sets [src.loc]'s sensors to maximum.", 1)
for(var/mob/V in viewers(user, 1))
V.show_message("[user] sets [src.loc]'s sensors to maximum.", 1)
/obj/item/clothing/under/verb/toggle()
set name = "Toggle Suit Sensors"

View File

@@ -179,7 +179,7 @@
siemens_coefficient = 1.5
loose = 33
update_icon(var/mob/living/carbon/human/user)
/obj/item/clothing/head/kitty/update_icon(var/mob/living/carbon/human/user)
if(!istype(user)) return
mob = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kitty")
// mob2 = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kitty2") - Commented out because it seemingly does nothing.
@@ -191,6 +191,12 @@
mob.Blend(earbit, ICON_OVERLAY)
// mob2.Blend(earbit2, ICON_OVERLAY) - Commented out because it seemingly does nothing.
icon_override = mob
/obj/item/clothing/head/kitty/equipped(var/mob/M, slot)
. = ..()
if(ishuman(M) && slot == slot_head)
update_icon(M)
/obj/item/clothing/head/kitty/mouse
@@ -198,10 +204,12 @@
desc = "A pair of mouse ears. Squeak!"
icon_state = "mousey"
update_icon(var/mob/living/carbon/human/user)
/obj/item/clothing/head/kitty/mouse/update_icon(var/mob/living/carbon/human/user)
if(!istype(user)) return
mob = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "mousey")
mob.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD)
var/icon/earbit = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "mouseyinner")
mob.Blend(earbit, ICON_OVERLAY)
icon_override = mob

View File

@@ -8,7 +8,7 @@
armor = list(melee = 0, bullet = 0, laser = 0 ,energy = 0, bomb = 0, bio = 100, rad = 20)
heat_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT
flags_inv = HIDEGLOVES|HIDESHOES
max_heat_protection_temperature = SPACE_SUIT_MAX_TEMP_PROTECT
species_restricted = list("Plasmaman")
flags = STOPSPRESSUREDMAGE | PLASMAGUARD

View File

@@ -38,7 +38,7 @@
I.dna_hash = C.dna_hash
I.fingerprint_hash = C.fingerprint_hash
qdel(C)
ok = M.equip_if_possible(I, slot_wear_id, 0) //if 1, last argument deletes on fail
ok = M.equip_or_collect(I, slot_wear_id, 0) //if 1, last argument deletes on fail
break
else if(istype(M.back, /obj/item/weapon/storage)) // Try to place it in something on the mob's back
var/obj/item/weapon/storage/S = M.back

View File

@@ -3,11 +3,6 @@
//Returns the thing in our active hand
/mob/proc/get_active_hand()
if(issilicon(src))
if(isrobot(src))
if(src:module_active)
return src:module_active
else
if(hand) return l_hand
else return r_hand
@@ -16,15 +11,18 @@
if(hand) return r_hand
else return l_hand
//Returns if a certain item can be equipped to a certain slot.
// Currently invalid for two-handed items - call obj/item/mob_can_equip() instead.
/mob/proc/can_equip(obj/item/I, slot, disable_warning = 0)
return 0
// Because there's several different places it's stored.
/mob/proc/get_multitool(var/if_active=0)
return null
//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_l_hand(var/obj/item/W)
if(lying && !(W.flags & ABSTRACT))
return 0
if(!istype(W))
if(!put_in_hand_check(W))
return 0
if(!l_hand)
W.forceMove(src) //TODO: move to equipped?
@@ -40,9 +38,7 @@
//Puts the item into your r_hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_r_hand(var/obj/item/W)
if(lying && !(W.flags & ABSTRACT))
return 0
if(!istype(W))
if(!put_in_hand_check(W))
return 0
if(!r_hand)
W.forceMove(src)
@@ -56,6 +52,11 @@
return 1
return 0
/mob/proc/put_in_hand_check(var/obj/item/W)
if(lying && !(W.flags & ABSTRACT)) return 0
if(!istype(W)) return 0
return 1
//Puts the item into our active hand if possible. returns 1 on success.
/mob/proc/put_in_active_hand(var/obj/item/W)
if(hand) return put_in_l_hand(W)
@@ -97,6 +98,13 @@
//Here lie unEquip and before_item_take, already forgotten and not missed.
/mob/proc/canUnEquip(obj/item/I, force)
if(!I)
return 1
if((I.flags & NODROP) && !force)
return 0
return 1
/mob/proc/unEquip(obj/item/I, force) //Force overrides NODROP for things like wizarditis and admin undress.
if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for NODROP.
return 1
@@ -152,115 +160,6 @@
return items
/** BS12's proc to get the item in the active hand. Couldn't find the /tg/ equivalent. **/
/mob/proc/equipped()
if(issilicon(src))
if(isrobot(src))
if(src:module_active)
return src:module_active
else
if (hand)
return l_hand
else
return r_hand
return
/mob/living/carbon/human/proc/equip_if_possible(obj/item/W, slot, del_on_fail = 1) // since byond doesn't seem to have pointers, this seems like the best way to do this :/
//warning: icky code
var/equipped = 0
switch(slot)
if(slot_back)
if(!src.back)
src.back = W
equipped = 1
if(slot_wear_mask)
if(!src.wear_mask)
src.wear_mask = W
equipped = 1
if(slot_handcuffed)
if(!src.handcuffed)
src.handcuffed = W
equipped = 1
if(slot_l_hand)
if(!src.l_hand)
src.l_hand = W
equipped = 1
if(slot_r_hand)
if(!src.r_hand)
src.r_hand = W
equipped = 1
if(slot_belt)
if(!src.belt && src.w_uniform)
src.belt = W
equipped = 1
if(slot_wear_id)
if(!src.wear_id && src.w_uniform)
src.wear_id = W
equipped = 1
if(slot_wear_pda)
if(!src.wear_pda && src.w_uniform)
src.wear_pda = W
equipped = 1
if(slot_l_ear)
if(!src.l_ear)
src.l_ear = W
equipped = 1
if(slot_r_ear)
if(!src.r_ear)
src.r_ear = W
equipped = 1
if(slot_glasses)
if(!src.glasses)
src.glasses = W
equipped = 1
if(slot_gloves)
if(!src.gloves)
src.gloves = W
equipped = 1
if(slot_head)
if(!src.head)
src.head = W
equipped = 1
if(slot_shoes)
if(!src.shoes)
src.shoes = W
equipped = 1
if(slot_wear_suit)
if(!src.wear_suit)
src.wear_suit = W
equipped = 1
if(slot_w_uniform)
if(!src.w_uniform)
src.w_uniform = W
equipped = 1
if(slot_l_store)
if(!src.l_store && src.w_uniform)
src.l_store = W
equipped = 1
if(slot_r_store)
if(!src.r_store && src.w_uniform)
src.r_store = W
equipped = 1
if(slot_s_store)
if(!src.s_store && src.wear_suit)
src.s_store = W
equipped = 1
if(slot_in_backpack)
if (src.back && istype(src.back, /obj/item/weapon/storage/backpack))
var/obj/item/weapon/storage/backpack/B = src.back
if(B.contents.len < B.storage_slots && W.w_class <= B.max_w_class)
W.forceMove(B)
equipped = 1
if(equipped)
W.layer = 20
if(src.back && W.loc != src.back)
W.forceMove(src)
else
if (del_on_fail)
qdel(W)
return equipped
/mob/proc/get_all_slots()
return list(wear_mask, back, l_hand, r_hand)
@@ -269,3 +168,11 @@
. = I.GetID()
if(.)
break
/mob/proc/get_item_by_slot(slot_id)
switch(slot_id)
if(slot_l_hand)
return l_hand
if(slot_r_hand)
return r_hand
return null

View File

@@ -2,8 +2,6 @@
name = "alien"
icon_state = "alien_s"
var/obj/item/clothing/suit/wear_suit = null //TODO: necessary? Are they even used? ~Carn
var/obj/item/clothing/head/head = null //
var/obj/item/weapon/r_store = null
var/obj/item/weapon/l_store = null
var/caste = ""

View File

@@ -513,7 +513,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
if(I == back)
back = null
update_inv_back(0)
update_inv_back()
else if(I == wear_mask)
if(istype(src, /mob/living/carbon/human)) //If we don't do this hair won't be properly rebuilt.
return
@@ -523,10 +523,10 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
handcuffed = null
if(buckled && buckled.buckle_requires_restraints)
buckled.unbuckle_mob()
update_inv_handcuffed(1)
update_inv_handcuffed()
else if(I == legcuffed)
legcuffed = null
update_inv_legcuffed(1)
update_inv_legcuffed()
/mob/living/carbon/proc/get_temperature(var/datum/gas_mixture/environment)
var/loc_temp = T0C
@@ -558,24 +558,73 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
return loc_temp
/mob/living/carbon/show_inv(mob/living/carbon/user as mob)
/mob/living/carbon/show_inv(mob/user)
user.set_machine(src)
var/dat = {"
<B><HR><FONT size=3>[name]</FONT></B>
<BR><HR>
<BR><B>Head(Mask):</B> <A href='?src=\ref[src];item=mask'>[(wear_mask && !(wear_mask.flags & ABSTRACT)) ? wear_mask : "Nothing"]</A>
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=l_hand'>[(l_hand && !(l_hand.flags & ABSTRACT)) ? l_hand : "Nothing"]</A>
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=r_hand'>[(r_hand && !(r_hand.flags & ABSTRACT)) ? r_hand : "Nothing"]</A>
<BR><B>Back:</B> <A href='?src=\ref[src];item=back'>[(back ? back : "Nothing")]</A> [((istype(wear_mask, /obj/item/clothing/mask) && istype(back, /obj/item/weapon/tank) && !( internal )) ? text(" <A href='?src=\ref[];item=internal'>Set Internal</A>", src) : "")]
<BR>[(handcuffed ? text("<A href='?src=\ref[src];item=handcuff'>Handcuffed</A>") : text("<A href='?src=\ref[src];item=handcuff'>Not Handcuffed</A>"))]
<BR>[(internal ? text("<A href='?src=\ref[src];item=internal'>Remove Internal</A>") : "")]
<BR><A href='?src=\ref[src];item=pockets'>Empty Pockets</A>
<BR><A href='?src=\ref[user];refresh=1'>Refresh</A>
<HR>
<B><FONT size=3>[name]</FONT></B>
<HR>
<BR><B>Head:</B> <A href='?src=\ref[src];item=[slot_head]'> [(head && !(head.flags&ABSTRACT)) ? head : "Nothing"]</A>
<BR><B>Mask:</B> <A href='?src=\ref[src];item=[slot_wear_mask]'> [(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "Nothing"]</A>
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=[slot_l_hand]'> [(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "Nothing"]</A>
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=[slot_r_hand]'> [(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"]</A>"}
dat += "<BR><B>Back:</B> <A href='?src=\ref[src];item=[slot_back]'>[back ? back : "Nothing"]</A>"
if(istype(wear_mask, /obj/item/clothing/mask) && istype(back, /obj/item/weapon/tank))
dat += "<BR><A href='?src=\ref[src];internal=1'>[internal ? "Disable Internals" : "Set Internals"]</A>"
if(handcuffed)
dat += "<BR><A href='?src=\ref[src];item=[slot_handcuffed]'>Handcuffed</A>"
if(legcuffed)
dat += "<BR><A href='?src=\ref[src];item=[slot_legcuffed]'>Legcuffed</A>"
dat += {"
<BR>
<BR><A href='?src=\ref[user];mach_close=mob\ref[src]'>Close</A>
<BR>"}
user << browse(dat, text("window=mob\ref[src];size=325x500"))
"}
user << browse(dat, "window=mob\ref[src];size=325x500")
onclose(user, "mob\ref[src]")
return
/mob/living/carbon/Topic(href, href_list)
..()
//strip panel
if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr))
if(href_list["internal"])
var/slot = text2num(href_list["internal"])
var/obj/item/ITEM = get_item_by_slot(slot)
if(ITEM && istype(ITEM, /obj/item/weapon/tank) && wear_mask && (wear_mask.flags & MASKINTERNALS))
visible_message("<span class='danger'>[usr] tries to [internal ? "close" : "open"] the valve on [src]'s [ITEM].</span>", \
"<span class='userdanger'>[usr] tries to [internal ? "close" : "open"] the valve on [src]'s [ITEM].</span>")
if(do_mob(usr, src, POCKET_STRIP_DELAY))
if(internal)
internal = null
if(internals)
internals.icon_state = "internal0"
else if(ITEM && istype(ITEM, /obj/item/weapon/tank) && wear_mask && (wear_mask.flags & MASKINTERNALS))
internal = ITEM
if(internals)
internals.icon_state = "internal1"
visible_message("<span class='danger'>[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].</span>", \
"<span class='userdanger'>[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].</span>")
/mob/living/carbon/get_item_by_slot(slot_id)
switch(slot_id)
if(slot_back)
return back
if(slot_wear_mask)
return wear_mask
if(slot_handcuffed)
return handcuffed
if(slot_legcuffed)
return legcuffed
if(slot_l_hand)
return l_hand
if(slot_r_hand)
return r_hand
return null
//generates realistic-ish pulse output based on preset levels
/mob/living/carbon/proc/get_pulse(var/method) //method 0 is for hands, 1 is for machines, more accurate

View File

@@ -13,6 +13,10 @@
var/number_wounds = 0
var/obj/item/handcuffed = null //Whether or not the mob is handcuffed
var/obj/item/legcuffed = null //Same as handcuffs but for legs. Bear traps use this.
var/obj/item/head = null
var/obj/item/clothing/suit/wear_suit = null //TODO: necessary? Are they even used? ~Carn
//Surgery info
var/datum/surgery_status/op_stage = new/datum/surgery_status
//Active emote/pose

View File

@@ -1,4 +1,3 @@
#define STRIP_DELAY 40 //time taken (in deciseconds) to strip somebody
/mob/living/carbon/human
name = "unknown"
real_name = "unknown"
@@ -523,54 +522,108 @@
/mob/living/carbon/human/var/temperature_resistance = T0C+75
/mob/living/carbon/human/show_inv(mob/user as mob)
var/obj/item/clothing/under/suit = null
if (istype(w_uniform, /obj/item/clothing/under))
suit = w_uniform
var/obj/item/clothing/gloves/G
var/pickpocket = 0
if(ishuman(user))
if(user:gloves)
G = user:gloves
pickpocket = G.pickpocket
/mob/living/carbon/human/show_inv(mob/user)
user.set_machine(src)
var/dat = {"
<B><HR><FONT size=3>[name]</FONT></B>
<BR><HR>
<BR><B>Back:</B> <A href='?src=\ref[src];item=back'>[(back && !(back.flags & ABSTRACT)) ? back : "Nothing"]</A> [((istype(wear_mask, /obj/item/clothing/mask) && istype(back, /obj/item/weapon/tank) && !( internal )) ? text(" <A href='?src=\ref[];item=internal'>Set Internal</A>", src) : "")]
<BR><B>Head(Mask):</B> <A href='?src=\ref[src];item=mask'>[(wear_mask && !(wear_mask.flags & ABSTRACT)) ? wear_mask : "Nothing"]</A>
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=l_hand'>[(l_hand && !(l_hand.flags & ABSTRACT)) ? l_hand : "Nothing"]</A>
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=r_hand'>[(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"]</A>"}
var/has_breathable_mask = istype(wear_mask, /obj/item/clothing/mask)
var/list/obscured = check_obscured_slots()
var/dat = {"<table>
<tr><td><B>Left Hand:</B></td><td><A href='?src=\ref[src];item=[slot_l_hand]'>[(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "<font color=grey>Empty</font>"]</A></td></tr>
<tr><td><B>Right Hand:</B></td><td><A href='?src=\ref[src];item=[slot_r_hand]'>[(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "<font color=grey>Empty</font>"]</A></td></tr>
<tr><td>&nbsp;</td></tr>"}
dat += "<tr><td><B>Back:</B></td><td><A href='?src=\ref[src];item=[slot_back]'>[(back && !(back.flags&ABSTRACT)) ? back : "<font color=grey>Empty</font>"]</A>"
if(has_breathable_mask && istype(back, /obj/item/weapon/tank))
dat += "&nbsp;<A href='?src=\ref[src];internal=[slot_back]'>[internal ? "Disable Internals" : "Set Internals"]</A>"
dat += "</td></tr><tr><td>&nbsp;</td></tr>"
dat += "<tr><td><B>Head:</B></td><td><A href='?src=\ref[src];item=[slot_head]'>[(head && !(head.flags&ABSTRACT)) ? head : "<font color=grey>Empty</font>"]</A></td></tr>"
if(slot_wear_mask in obscured)
dat += "<tr><td><font color=grey><B>Mask:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Mask:</B></td><td><A href='?src=\ref[src];item=[slot_wear_mask]'>[(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "<font color=grey>Empty</font>"]</A></td></tr>"
if(!issmall(src))
dat += {"
<BR><B>Gloves:</B> <A href='?src=\ref[src];item=gloves'>[(gloves && !(gloves.flags & ABSTRACT)) ? gloves : "Nothing"]</A>
<BR><B>Eyes:</B> <A href='?src=\ref[src];item=eyes'>[(glasses && !(glasses.flags & ABSTRACT)) ? glasses : "Nothing"]</A>
<BR><B>Left Ear:</B> <A href='?src=\ref[src];item=l_ear'>[(l_ear && !(l_ear.flags & ABSTRACT)) ? l_ear : "Nothing"]</A>
<BR><B>Right Ear:</B> <A href='?src=\ref[src];item=r_ear'>[(r_ear && !(r_ear.flags & ABSTRACT)) ? r_ear : "Nothing"]</A>
<BR><B>Head:</B> <A href='?src=\ref[src];item=head'>[(head && !(head.flags & ABSTRACT)) ? head : "Nothing"]</A>
<BR><B>Shoes:</B> <A href='?src=\ref[src];item=shoes'>[(shoes && !(shoes.flags & ABSTRACT)) ? shoes : "Nothing"]</A>
<BR><B>Belt:</B> <A href='?src=\ref[src];item=belt'>[(belt && !(belt.flags & ABSTRACT)) ? belt : "Nothing"]</A> [((istype(wear_mask, /obj/item/clothing/mask) && istype(belt, /obj/item/weapon/tank) && !( internal )) ? text(" <A href='?src=\ref[];item=internal'>Set Internal</A>", src) : "")]
<BR><B>Uniform:</B> <A href='?src=\ref[src];item=uniform'>[(w_uniform && !(w_uniform.flags & ABSTRACT)) ? w_uniform : "Nothing"]</A> [(suit) ? ((suit.has_sensor == 1) ? text(" <A href='?src=\ref[];item=sensor'>Sensors</A>", src) : "") :]
<BR><B>(Exo)Suit:</B> <A href='?src=\ref[src];item=suit'>[(wear_suit && !(wear_suit.flags & ABSTRACT)) ? wear_suit : "Nothing"]</A>
<BR><B>ID:</B> <A href='?src=\ref[src];item=id'>[(wear_id && !(wear_id.flags & ABSTRACT)) ? wear_id : "Nothing"]</A>
<BR><B>PDA:</B> <A href='?src=\ref[src];item=pda'>[(wear_pda && !(wear_pda.flags & ABSTRACT)) ? wear_pda : "Nothing"]</A>
<BR><B>Suit Storage:</B> <A href='?src=\ref[src];item=s_store'>[(s_store && !(s_store.flags & ABSTRACT)) ? s_store : "Nothing"]</A>
<BR><BR><A href='?src=\ref[src];pockets=left'>Left Pocket ([(l_store && !(l_store.flags & ABSTRACT)) ? (pickpocket ? l_store.name : "Full") : "Empty"])</A>
<BR><A href='?src=\ref[src];pockets=right'>Right Pocket ([(r_store && !(r_store.flags & ABSTRACT)) ? (pickpocket ? r_store.name : "Full") : "Empty"])</A>
<BR><A href='?src=\ref[src];item=pockets'>Empty Both Pockets</A>"}
dat += {"
<BR><BR>[(handcuffed ? text("<A href='?src=\ref[src];item=handcuff'>Handcuffed</A>") : text("<A href='?src=\ref[src];item=handcuff'>Not Handcuffed</A>"))]
<BR>[(legcuffed ? text("<A href='?src=\ref[src];item=legcuff'>Legcuffed</A>") : text(""))]
[(suit) ? ((suit.accessories.len) ? text("<BR><A href='?src=\ref[];item=tie'>Remove Accessory</A>", src) : "") :]
[(internal ? text("<BR><A href='?src=\ref[src];item=internal'>Remove Internal</A>") : "")]
<BR><A href='?src=\ref[src];item=splints'>Remove Splints</A>
<BR><A href='?src=\ref[user];refresh=1'>Refresh</A>
<BR><A href='?src=\ref[user];mach_close=mob\ref[src]'>Close</A>
<BR>"}
user << browse(dat, text("window=mob\ref[src];size=340x480"))
onclose(user, "mob\ref[src]")
return
if(slot_glasses in obscured)
dat += "<tr><td><font color=grey><B>Eyes:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Eyes:</B></td><td><A href='?src=\ref[src];item=[slot_glasses]'>[(glasses && !(glasses.flags&ABSTRACT)) ? glasses : "<font color=grey>Empty</font>"]</A></td></tr>"
if(slot_l_ear in obscured)
dat += "<tr><td><font color=grey><B>Left Ear:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Left Ear:</B></td><td><A href='?src=\ref[src];item=[slot_l_ear]'>[(l_ear && !(l_ear.flags&ABSTRACT)) ? l_ear : "<font color=grey>Empty</font>"]</A></td></tr>"
if(slot_r_ear in obscured)
dat += "<tr><td><font color=grey><B>Right Ear:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Right Ear:</B></td><td><A href='?src=\ref[src];item=[slot_r_ear]'>[(r_ear && !(r_ear.flags&ABSTRACT)) ? r_ear : "<font color=grey>Empty</font>"]</A></td></tr>"
dat += "<tr><td>&nbsp;</td></tr>"
dat += "<tr><td><B>Exosuit:</B></td><td><A href='?src=\ref[src];item=[slot_wear_suit]'>[(wear_suit && !(wear_suit.flags&ABSTRACT)) ? wear_suit : "<font color=grey>Empty</font>"]</A></td></tr>"
if(wear_suit)
dat += "<tr><td>&nbsp;&#8627;<B>Suit Storage:</B></td><td><A href='?src=\ref[src];item=[slot_s_store]'>[(s_store && !(s_store.flags&ABSTRACT)) ? s_store : "<font color=grey>Empty</font>"]</A>"
if(has_breathable_mask && istype(s_store, /obj/item/weapon/tank))
dat += "&nbsp;<A href='?src=\ref[src];internal=[slot_s_store]'>[internal ? "Disable Internals" : "Set Internals"]</A>"
dat += "</td></tr>"
else
dat += "<tr><td><font color=grey>&nbsp;&#8627;<B>Suit Storage:</B></font></td></tr>"
if(slot_shoes in obscured)
dat += "<tr><td><font color=grey><B>Shoes:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Shoes:</B></td><td><A href='?src=\ref[src];item=[slot_shoes]'>[(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "<font color=grey>Empty</font>"]</A></td></tr>"
if(slot_gloves in obscured)
dat += "<tr><td><font color=grey><B>Gloves:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Gloves:</B></td><td><A href='?src=\ref[src];item=[slot_gloves]'>[(gloves && !(gloves.flags&ABSTRACT)) ? gloves : "<font color=grey>Empty</font>"]</A></td></tr>"
if(slot_w_uniform in obscured)
dat += "<tr><td><font color=grey><B>Uniform:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Uniform:</B></td><td><A href='?src=\ref[src];item=[slot_w_uniform]'>[(w_uniform && !(w_uniform.flags&ABSTRACT)) ? w_uniform : "<font color=grey>Empty</font>"]</A></td></tr>"
if(w_uniform == null || (slot_w_uniform in obscured))
dat += "<tr><td><font color=grey>&nbsp;&#8627;<B>Pockets:</B></font></td></tr>"
dat += "<tr><td><font color=grey>&nbsp;&#8627;<B>ID:</B></font></td></tr>"
dat += "<tr><td><font color=grey>&nbsp;&#8627;<B>Belt:</B></font></td></tr>"
dat += "<tr><td><font color=grey>&nbsp;&#8627;<B>Suit Sensors:</B></font></td></tr>"
dat += "<tr><td><font color=grey>&nbsp;&#8627;<B>PDA:</B></font></td></tr>"
else
dat += "<tr><td>&nbsp;&#8627;<B>Belt:</B></td><td><A href='?src=\ref[src];item=[slot_belt]'>[(belt && !(belt.flags&ABSTRACT)) ? belt : "<font color=grey>Empty</font>"]</A>"
if(has_breathable_mask && istype(belt, /obj/item/weapon/tank))
dat += "&nbsp;<A href='?src=\ref[src];internal=[slot_belt]'>[internal ? "Disable Internals" : "Set Internals"]</A>"
dat += "</td></tr>"
dat += "<tr><td>&nbsp;&#8627;<B>Pockets:</B></td><td><A href='?src=\ref[src];pockets=left'>[(l_store && !(l_store.flags&ABSTRACT)) ? "Left (Full)" : "<font color=grey>Left (Empty)</font>"]</A>"
dat += "&nbsp;<A href='?src=\ref[src];pockets=right'>[(r_store && !(r_store.flags&ABSTRACT)) ? "Right (Full)" : "<font color=grey>Right (Empty)</font>"]</A></td></tr>"
dat += "<tr><td>&nbsp;&#8627;<B>ID:</B></td><td><A href='?src=\ref[src];item=[slot_wear_id]'>[(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "<font color=grey>Empty</font>"]</A></td></tr>"
dat += "<tr><td>&nbsp;&#8627;<B>PDA:</B></td><td><A href='?src=\ref[src];item=[slot_wear_pda]'>[(wear_pda && !(wear_pda.flags&ABSTRACT)) ? wear_pda : "<font color=grey>Empty</font>"]</A></td></tr>"
if(istype(w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/U = w_uniform
dat += "<tr><td>&nbsp;&#8627;<B>Suit Sensors:</b></td><td><A href='?src=\ref[src];set_sensor=1'>[U.has_sensor >= 2 ? "</a><font color=grey>--SENSORS LOCKED--</font>" : "Set Sensors</a>"]</td></tr>"
if(U.accessories.len)
dat += "<tr><td>&nbsp;&#8627;<A href='?src=\ref[src];strip_accessory=1'>Remove Accessory</a></td></tr>"
if(handcuffed)
dat += "<tr><td><B>Handcuffed:</B> <A href='?src=\ref[src];item=[slot_handcuffed]'>Remove</A></td></tr>"
if(legcuffed)
dat += "<tr><td><A href='?src=\ref[src];item=[slot_legcuffed]'>Legcuffed</A></td></tr>"
dat += {"</table>
<A href='?src=\ref[user];mach_close=mob\ref[src]'>Close</A>
"}
var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 440, 540)
popup.set_content(dat)
popup.open()
// called when something steps onto a human
// this handles mulebots and vehicles
@@ -688,94 +741,66 @@
/mob/living/carbon/human/Topic(href, href_list)
var/pickpocket = 0
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
var/obj/item/clothing/gloves/G = H.gloves
if(G)
pickpocket = G.pickpocket
if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr))
// if looting pockets with gloves, do it quietly
if(href_list["pockets"])
if(isanimal(usr))
return //animals cannot strip people
if(frozen)
usr << "\red Do not attempt to strip frozen people."
if(href_list["item"])
var/slot = text2num(href_list["item"])
if(slot in check_obscured_slots())
usr << "<span class='warning'>You can't reach that! Something is covering it.</span>"
return
if(href_list["pockets"])
var/pocket_side = href_list["pockets"]
var/pocket_id = (pocket_side == "right" ? slot_r_store : slot_l_store)
var/obj/item/pocket_item = (pocket_id == slot_r_store ? src.r_store : src.l_store)
var/obj/item/pocket_item = (pocket_id == slot_r_store ? r_store : l_store)
var/obj/item/place_item = usr.get_active_hand() // Item to place in the pocket, if it's empty
var/delay_denominator = 1
if(pocket_item && !(pocket_item.flags&ABSTRACT))
if(pocket_item.flags & NODROP)
usr << "<span class='notice'>You try to empty [src]'s [pocket_side] pocket, it seems to be stuck!</span>"
usr << "<span class='warning'>You try to empty [src]'s [pocket_side] pocket, it seems to be stuck!</span>"
usr << "<span class='notice'>You try to empty [src]'s [pocket_side] pocket.</span>"
else if(place_item && place_item.mob_can_equip(src, pocket_id, 1) && !(place_item.flags&ABSTRACT))
usr << "<span class='notice'>You try to place [place_item] into [src]'s [pocket_side] pocket.</span>"
delay_denominator = 4
else
return
if(do_mob(usr, src, STRIP_DELAY))
if(do_mob(usr, src, POCKET_STRIP_DELAY/delay_denominator)) //placing an item into the pocket is 4 times faster
if(pocket_item)
if(pocket_item == (pocket_id == slot_r_store ? r_store : l_store)) //item still in the pocket we search
unEquip(pocket_item)
usr.put_in_hands(pocket_item)
else
if(place_item && !(place_item.flags & NODROP))
if(place_item)
usr.unEquip(place_item)
equip_to_slot_if_possible(place_item, pocket_id, 0, 1)
// Update strip window
if(usr.machine == src && in_range(src, usr))
show_inv(usr)
else if(!pickpocket)
else
// Display a warning if the user mocks up
src << "<span class='warning'>You feel your [pocket_side] pocket being fumbled with!</span>"
// if looting id with gloves, do it quietly - this allows pickpocket gloves to take/place id stealthily - Bone White
if(href_list["item"])
if(isanimal(usr))
return //animals cannot strip people
if(href_list["set_sensor"])
if(istype(w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/U = w_uniform
U.set_sensors(usr)
if(frozen)
usr << "\red Do not attempt to strip frozen people."
return
var/itemTarget = href_list["item"]
if(itemTarget == "id")
if(pickpocket)
var/obj/item/worn_id = src.wear_id
var/obj/item/place_item = usr.get_active_hand() // Item to place in the pocket, if it's empty
if(href_list["strip_accessory"])
if(istype(w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/U = w_uniform
if(U.accessories.len)
var/obj/item/clothing/accessory/A = U.accessories[1]
usr.visible_message("<span class='danger'>\The [usr] starts to take off \the [A] from \the [src]'s [U]!</span>", \
"<span class='danger'>You start to take off \the [A] from \the [src]'s [U]!</span>")
if(worn_id)
usr << "<span class='notice'>You try to remove [src]'s ID.</span>"
else if(place_item && place_item.mob_can_equip(src, slot_wear_id, 1))
usr << "<span class='notice'>You try to place [place_item] onto [src].</span>"
else
return
if(do_mob(usr, src, STRIP_DELAY))
if(worn_id)
unEquip(worn_id)
usr.put_in_hands(worn_id)
else
if(place_item)
usr.unEquip(place_item)
equip_to_slot_if_possible(place_item, slot_wear_id, 0, 1)
// Update strip window
if(usr.machine == src && in_range(src, usr))
show_inv(usr)
else if(!pickpocket)
// Display a warning if the user mocks up
src << "<span class='warning'>You feel your ID slot being fumbled with!</span>"
if(do_mob(usr, src, 40) && A && U.accessories.len)
usr.visible_message("<span class='danger'>\The [usr] takes \the [A] off of \the [src]'s [U]!</span>", \
"<span class='danger'>You take \the [A] off of \the [src]'s [U]!</span>")
A.on_removed(usr)
U.accessories -= A
update_inv_w_uniform()
if (href_list["refresh"])
if((machine)&&(in_range(src, usr)))
@@ -786,21 +811,6 @@
unset_machine()
src << browse(null, t1)
if ((href_list["item"] && !( usr.stat ) && usr.canmove && !( usr.restrained() ) && in_range(src, usr) && ticker)) //if game hasn't started, can't make an equip_e
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( )
if(!pickpocket || href_list["item"] != "id") // Stop the non-stealthy verbose strip if pickpocketing id.
O.source = usr
O.target = src
O.item = usr.get_active_hand()
O.s_loc = usr.loc
O.t_loc = loc
O.place = href_list["item"]
O.pickpocket = pickpocket //Stealthy
requests += O
spawn( 0 )
O.process()
return
if (href_list["criminal"])
if(hasHUD(usr,"security"))
@@ -950,7 +960,6 @@
if (E.fields["name"] == perpname)
for (var/datum/data/record/R in data_core.general)
if (R.fields["id"] == E.fields["id"])
var/setmedical = input(usr, "Specify a new medical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("*SSD*", "*Deceased*", "Physically Unfit", "Active", "Disabled", "Cancel")
if(hasHUD(usr,"medical"))
@@ -1068,8 +1077,7 @@
if (href_list["lookmob"])
var/mob/M = locate(href_list["lookmob"])
src.examinate(M)
..()
return
. = ..()
///eyecheck()
@@ -1165,6 +1173,31 @@
fail_msg = "There is no exposed flesh or thin material [target_zone == "head" ? "on their head" : "on their body"] to inject into."
user << "<span class='alert'>[fail_msg]</span>"
/mob/living/carbon/human/proc/check_obscured_slots()
var/list/obscured = list()
if(wear_suit)
if(wear_suit.flags_inv & HIDEGLOVES)
obscured |= slot_gloves
if(wear_suit.flags_inv & HIDEJUMPSUIT)
obscured |= slot_w_uniform
if(wear_suit.flags_inv & HIDESHOES)
obscured |= slot_shoes
if(head)
if(head.flags_inv & HIDEMASK)
obscured |= slot_wear_mask
if(head.flags_inv & HIDEEYES)
obscured |= slot_glasses
if(head.flags_inv & HIDEEARS)
obscured |= slot_r_ear
obscured |= slot_l_ear
if(obscured.len > 0)
return obscured
else
return null
/mob/living/carbon/human/proc/check_has_mouth()
// Todo, check stomach organ when implemented.
var/obj/item/organ/external/head/H = get_organ("head")

View File

@@ -76,17 +76,22 @@
M << "<span class='warning'>Remove his mask!</span>"
return 0
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human()
O.source = M
O.target = src
O.s_loc = M.loc
O.t_loc = loc
O.place = "CPR"
requests += O
spawn(0)
O.process()
M.visible_message("<span class='danger'>\The [M] is trying to perform CPR on \the [src]!</span>", \
"<span class='danger'>You try to perform CPR on \the [src]!</span>")
if(do_mob(M, src, 40))
if(health > config.health_threshold_dead && health <= config.health_threshold_crit)
var/suff = min(getOxyLoss(), 7)
adjustOxyLoss(-suff)
updatehealth()
M.visible_message("<span class='danger'>\The [M] performs CPR on \the [src]!</span>", \
"<span class='notice'>You perform CPR on \the [src].</span>")
src << "<span class='notice'>You feel a breath of fresh air enter your lungs. It feels good.</span>"
M << "<span class='alert'>Repeat at least every 7 seconds."
add_logs(src, M, "CPRed")
return 1
else
M << "<span class='danger'>You need to stay still while performing CPR!</span>"
if(I_GRAB)
if(attacker_style && attacker_style.grab_act(H, src))

View File

@@ -35,13 +35,11 @@
var/backbag = 2 //Which backpack type the player has chosen. Nothing, Satchel or Backpack.
//Equipment slots
var/obj/item/wear_suit = null
var/obj/item/w_uniform = null
var/obj/item/shoes = null
var/obj/item/belt = null
var/obj/item/gloves = null
var/obj/item/glasses = null
var/obj/item/head = null
var/obj/item/l_ear = null
var/obj/item/r_ear = null
var/obj/item/wear_id = null

View File

@@ -183,12 +183,6 @@
else if(I == back)
back = null
update_inv_back()
else if(I == handcuffed)
handcuffed = null
update_inv_handcuffed()
else if(I == legcuffed)
legcuffed = null
update_inv_legcuffed()
else if(I == r_hand)
r_hand = null
update_inv_r_hand()
@@ -213,107 +207,90 @@
src.r_hand = null
update_inv_r_hand()
W.screen_loc = null
W.loc = src
W.equipped(src, slot)
W.layer = 20
switch(slot)
if(slot_back)
src.back = W
W.equipped(src, slot)
back = W
update_inv_back(redraw_mob)
if(slot_wear_mask)
src.wear_mask = W
wear_mask = W
if((wear_mask.flags & BLOCKHAIR) || (wear_mask.flags & BLOCKHEADHAIR))
update_hair(redraw_mob) //rebuild hair
W.equipped(src, slot)
update_inv_wear_mask(redraw_mob)
if(slot_handcuffed)
src.handcuffed = W
handcuffed = W
update_inv_handcuffed(redraw_mob)
if(slot_legcuffed)
src.legcuffed = W
W.equipped(src, slot)
legcuffed = W
update_inv_legcuffed(redraw_mob)
if(slot_l_hand)
src.l_hand = W
W.equipped(src, slot)
l_hand = W
update_inv_l_hand(redraw_mob)
if(slot_r_hand)
src.r_hand = W
W.equipped(src, slot)
r_hand = W
update_inv_r_hand(redraw_mob)
if(slot_belt)
src.belt = W
W.equipped(src, slot)
belt = W
update_inv_belt(redraw_mob)
if(slot_wear_id)
src.wear_id = W
W.equipped(src, slot)
wear_id = W
update_inv_wear_id(redraw_mob)
if(slot_wear_pda)
src.wear_pda = W
W.equipped(src, slot)
wear_pda = W
update_inv_wear_pda(redraw_mob)
if(slot_l_ear)
src.l_ear = W
l_ear = W
if(l_ear.slot_flags & SLOT_TWOEARS)
var/obj/item/clothing/ears/offear/O = new(W)
O.loc = src
src.r_ear = O
r_ear = O
O.layer = 20
W.equipped(src, slot)
update_inv_ears(redraw_mob)
if(slot_r_ear)
src.r_ear = W
r_ear = W
if(r_ear.slot_flags & SLOT_TWOEARS)
var/obj/item/clothing/ears/offear/O = new(W)
O.loc = src
src.l_ear = O
l_ear = O
O.layer = 20
W.equipped(src, slot)
update_inv_ears(redraw_mob)
if(slot_glasses)
src.glasses = W
W.equipped(src, slot)
glasses = W
update_inv_glasses(redraw_mob)
if(slot_gloves)
src.gloves = W
W.equipped(src, slot)
gloves = W
update_inv_gloves(redraw_mob)
if(slot_head)
src.head = W
head = W
if((head.flags & BLOCKHAIR) || (head.flags & BLOCKHEADHAIR))
update_hair(redraw_mob) //rebuild hair
if(istype(W,/obj/item/clothing/head/kitty))
W.update_icon(src)
W.equipped(src, slot)
update_inv_head(redraw_mob)
if(slot_shoes)
src.shoes = W
W.equipped(src, slot)
shoes = W
update_inv_shoes(redraw_mob)
if(slot_wear_suit)
src.wear_suit = W
W.equipped(src, slot)
wear_suit = W
update_inv_wear_suit(redraw_mob)
if(slot_w_uniform)
src.w_uniform = W
W.equipped(src, slot)
w_uniform = W
update_inv_w_uniform(redraw_mob)
if(slot_l_store)
src.l_store = W
W.equipped(src, slot)
l_store = W
update_inv_pockets(redraw_mob)
if(slot_r_store)
src.r_store = W
W.equipped(src, slot)
r_store = W
update_inv_pockets(redraw_mob)
if(slot_s_store)
src.s_store = W
W.equipped(src, slot)
s_store = W
update_inv_s_store(redraw_mob)
if(slot_in_backpack)
if(src.get_active_hand() == W)
src.unEquip(W)
W.loc = src.back
if(get_active_hand() == W)
unEquip(W)
W.loc = back
if(slot_tie)
var/obj/item/clothing/under/uniform = src.w_uniform
uniform.attackby(W,src)
@@ -321,10 +298,6 @@
src << "<span class='warning'>You are trying to equip this item to an unsupported inventory slot. Report this to a coder!</span>"
return
W.layer = 20
return
/mob/living/carbon/human/put_in_hands(obj/item/W)
if(!W) return 0
if(put_in_active_hand(W)) return 1
@@ -332,520 +305,6 @@
else
..()
/obj/effect/equip_e
name = "equip e"
var/mob/source = null
var/s_loc = null //source location
var/t_loc = null //target location
var/obj/item/item = null
var/place = null
var/pickpocket = null
/obj/effect/equip_e/human
name = "human"
var/mob/living/carbon/human/target = null
/obj/effect/equip_e/process()
return
/obj/effect/equip_e/proc/done()
return
/obj/effect/equip_e/New()
if (!ticker)
qdel(src)
spawn(100)
qdel(src)
..()
return
/obj/effect/equip_e/human/process()
if (item)
item.add_fingerprint(source)
if (item.flags & NODROP)
source << "<span class='warning'>\The [item] is stuck to you!</span>"
qdel(src)
return
else
switch(place)
if("mask")
if (!( target.wear_mask ))
qdel(src)
if("l_hand")
if (!( target.l_hand ))
qdel(src)
if("r_hand")
if (!( target.r_hand ))
qdel(src)
if("suit")
if (!( target.wear_suit ))
qdel(src)
if("uniform")
if (!( target.w_uniform ))
qdel(src)
if("back")
if (!( target.back ))
qdel(src)
if("syringe")
return
if("pill")
return
if("fuel")
return
if("drink")
return
if("dnainjector")
return
if("handcuff")
if (!( target.handcuffed ))
qdel(src)
if("id")
if ((!( target.wear_id ) || !( target.w_uniform )))
qdel(src)
if("splints")
var/count = 0
for(var/organ in list("l_leg","r_leg","l_arm","r_arm"))
var/obj/item/organ/external/o = target.organs_by_name[organ]
if(o.status & ORGAN_SPLINTED)
count = 1
break
if(count == 0)
qdel(src)
return
if("internal")
if ((!( (istype(target.wear_mask, /obj/item/clothing/mask) && (istype(target.back, /obj/item/weapon/tank) || istype(target.belt, /obj/item/weapon/tank) || istype(target.s_store, /obj/item/weapon/tank)) && !( target.internal )) ) && !( target.internal )))
qdel(src)
var/message=null
if(target.frozen)
source << "\red Do not attempt to strip frozen people."
return
switch(place)
if("syringe")
message = "\red <B>[source] is trying to inject [target]!</B>"
if("pill")
message = "\red <B>[source] is trying to force [target] to swallow [item]!</B>"
if("drink")
message = "\red <B>[source] is trying to force [target] to swallow a gulp of [item]!</B>"
if("dnainjector")
message = "\red <B>[source] is trying to inject [target] with the [item]!</B>"
if("mask")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Had their mask removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) mask</font>")
if(target.wear_mask && (target.wear_mask.flags & NODROP))
message = "\red <B>[source] fails to take off \a [target.wear_mask] from [target]'s head!</B>"
return
else if(target.wear_mask)
message = "\red <B>[source] is trying to take off \a [target.wear_mask] from [target]'s head!</B>"
if("l_hand")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their left hand item ([target.l_hand]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) left hand item ([target.l_hand])</font>")
message = "\red <B>[source] is trying to take off \a [target.l_hand] from [target]'s left hand!</B>"
if("r_hand")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their right hand item ([target.r_hand]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) right hand item ([target.r_hand])</font>")
message = "\red <B>[source] is trying to take off \a [target.r_hand] from [target]'s right hand!</B>"
if("gloves")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their gloves ([target.gloves]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) gloves ([target.gloves])</font>")
if(target.gloves && (target.gloves.flags & NODROP))
message = "\red <B>[source] fails to take off \a [target.gloves] from [target]'s hands!</B>"
return
else if(target.gloves)
message = "\red <B>[source] is trying to take off the [target.gloves] from [target]'s hands!</B>"
if("eyes")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their eyewear ([target.glasses]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) eyewear ([target.glasses])</font>")
if(target.glasses && (target.glasses.flags & NODROP))
message = "\red <B>[source] fails to take off \a [target.glasses] from [target]'s eyes!</B>"
return
else if(target.glasses)
message = "\red <B>[source] is trying to take off the [target.glasses] from [target]'s eyes!</B>"
if("l_ear")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their left ear item ([target.l_ear]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) left ear item ([target.l_ear])</font>")
if(target.l_ear && (target.l_ear.flags & NODROP))
message = "\red <B>[source] fails to take off \a [target.l_ear] from [target]'s left ear!</B>"
return
else if(target.l_ear)
message = "\red <B>[source] is trying to take off the [target.l_ear] from [target]'s left ear!</B>"
if("r_ear")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their right ear item ([target.r_ear]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) right ear item ([target.r_ear])</font>")
if(target.r_ear && (target.r_ear.flags & NODROP))
message = "\red <B>[source] fails to take off \a [target.r_ear] from [target]'s right ear!</B>"
return
else if(target.r_ear)
message = "\red <B>[source] is trying to take off the [target.r_ear] from [target]'s right ear!</B>"
if("head")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their hat ([target.head]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) hat ([target.head])</font>")
if(target.head && (target.head.flags & NODROP))
message = "\red <B>[source] fails to take off \a [target.head] from [target]'s head!</B>"
return
else if(target.head)
message = "\red <B>[source] is trying to take off the [target.head] from [target]'s head!</B>"
if("shoes")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their shoes ([target.shoes]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) shoes ([target.shoes])</font>")
if(target.shoes && (target.shoes.flags & NODROP))
message = "\red <B>[source] fails to take off \a [target.shoes] from [target]'s feet!</B>"
return
else if(target.shoes)
message = "\red <B>[source] is trying to take off [target.shoes] from [target]'s feet!</B>"
if("belt")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their belt item ([target.belt]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) belt item ([target.belt])</font>")
if(!pickpocket && target.belt)
message = "\red <B>[source] is trying to take off \a [target.belt] from [target]'s belt!</B>"
if("suit")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their suit ([target.wear_suit]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) suit ([target.wear_suit])</font>")
if(target.wear_suit && (target.wear_suit.flags & NODROP))
message = "\red <B>[source] fails to take off \a [target.wear_suit] from [target]'s body!</B>"
return
else if(target.wear_suit)
message = "\red <B>[source] is trying to take off \a [target.wear_suit] from [target]'s body!</B>"
if("back")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their back item ([target.back]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) back item ([target.back])</font>")
message = "\red <B>[source] is trying to take off \a [target.back] from [target]'s back!</B>"
if("handcuff")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Was unhandcuffed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to unhandcuff [target.name]'s ([target.ckey])</font>")
if(target.handcuffed)
message = "\red <B>[source] is trying to unhandcuff [target]!</B>"
if("legcuff")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Was unlegcuffed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to unlegcuff [target.name]'s ([target.ckey])</font>")
if(target.legcuffed)
message = "\red <B>[source] is trying to unlegcuff [target]!</B>"
else
message = "\red <B>[source] is trying to legcuff [target]!</B>"
if("uniform")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their uniform ([target.w_uniform]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) uniform ([target.w_uniform])</font>")
for(var/obj/item/I in list(target.l_store, target.r_store))
if(I.on_found(source))
return
if(target.w_uniform && (target.w_uniform.flags & NODROP))
message = "\red <B>[source] fails to take off \a [target.w_uniform] from [target]'s body!</B>"
return
else
message = "\red <B>[source] is trying to take off \a [target.w_uniform] from [target]'s body!</B>"
if("tie")
var/obj/item/clothing/under/suit = target.w_uniform
if(suit.accessories.len)
var/obj/item/clothing/accessory/A = suit.accessories[1]
target.attack_log += "\[[time_stamp()]\] <font color='orange'>Has had their accessory ([A]) removed by [source.name] ([source.ckey])</font>"
source.attack_log += "\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) accessory ([A])</font>"
if(istype(A, /obj/item/clothing/accessory/holobadge) || istype(A, /obj/item/clothing/accessory/medal))
for(var/mob/M in viewers(target, null))
M.show_message("\red <B>[source] tears off \the [A] from [target]'s [suit]!</B>" , 1)
done()
return
else
message = "\red <B>[source] is trying to take off \a [A] from [target]'s [suit]!</B>"
if("s_store")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their suit storage item ([target.s_store]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) suit storage item ([target.s_store])</font>")
message = "\red <B>[source] is trying to take off \a [target.s_store] from [target]'s suit!</B>"
if("pockets")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their pockets emptied by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to empty [target.name]'s ([target.ckey]) pockets</font>")
for(var/obj/item/I in list(target.l_store, target.r_store))
if(I.on_found(source))
return
message = "\red <B>[source] is trying to empty [target]'s pockets!</B>"
if("CPR")
if (!target.cpr_time)
qdel(src)
target.cpr_time = 0
message = "\red <B>[source] is trying perform CPR on [target]!</B>"
if("id")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their ID ([target.wear_id]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) ID ([target.wear_id])</font>")
if(!pickpocket)
message = "\red <B>[source] is trying to take off [target.wear_id] from [target]'s uniform!</B>"
else
source << "\blue You try to take off [target.wear_id] from [target]'s uniform!"
if("pda")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their PDA ([target.wear_pda]) removed by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to remove [target.name]'s ([target.ckey]) PDA ([target.wear_pda])</font>")
message = "\red <B>[source] is trying to take off [target.wear_pda] from [target]'s uniform!</B>"
if("internal")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their internals toggled by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to toggle [target.name]'s ([target.ckey]) internals</font>")
if (target.internal)
message = "\red <B>[source] is trying to remove [target]'s internals!</B>"
else
message = "\red <B>[source] is trying to set on [target]'s internals.</B>"
if("splints")
message = "\red <B>[source] is trying to remove [target]'s splints!</B>"
if("sensor")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their sensors toggled by [source.name] ([source.ckey])</font>")
source.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to toggle [target.name]'s ([target.ckey]) sensors</font>")
var/obj/item/clothing/under/suit = target.w_uniform
if (suit.has_sensor >= 2)
source << "The controls are locked."
return
message = "\red <B>[source] is trying to set [target]'s suit sensors!</B>"
for(var/mob/M in viewers(target, null))
if(findtext(message, "is trying to take off from", 1, 0) > 0 || message == null)
message = "\red <B>[source] is trying to put \a [item] on [target]!</B>"
if(findtext(message, "is trying to put on", 1, 0) > 0)
return
else
M.show_message(message, 1)
else
M.show_message(message, 1)
spawn( HUMAN_STRIP_DELAY )
done()
return
return
/*
This proc equips stuff (or does something else) when removing stuff manually from the character window when you click and drag.
It works in conjuction with the process() above.
This proc works for humans only. Aliens stripping humans and the like will all use this proc. Stripping monkeys or somesuch will use their version of this proc.
The first if statement for "mask" and such refers to items that are already equipped and un-equipping them.
The else statement is for equipping stuff to empty slots.
The NODROP flag refers to variable of /obj/item/clothing which either allows or disallows that item to be removed.
It can still be worn/put on as normal.
*/
/obj/effect/equip_e/human/done() //TODO: And rewrite this :< ~Carn
target.cpr_time = 1
if(isanimal(source)) return //animals cannot strip people
if(!source || !target) return //Target or source no longer exist
if(source.loc != s_loc) return //source has moved
if(target.loc != t_loc) return //target has moved
if(!in_range(source, target)) return
if(item && source.get_active_hand() != item) return //Swapped hands / removed item from the active one
if ((source.restrained() || source.stat)) return //Source restrained or unconscious / dead
if(target.frozen)
source << "\red Do not attempt to strip frozen people."
return
var/slot_to_process
var/strip_item //this will tell us which item we will be stripping - if any.
switch(place) //here we go again...
if("mask")
slot_to_process = slot_wear_mask
if (target.wear_mask && !(target.wear_mask.flags & NODROP))
strip_item = target.wear_mask
if("gloves")
slot_to_process = slot_gloves
if (target.gloves && !(target.gloves.flags & NODROP))
strip_item = target.gloves
if("eyes")
slot_to_process = slot_glasses
if (target.glasses)
strip_item = target.glasses
if("belt")
slot_to_process = slot_belt
if (target.belt)
strip_item = target.belt
if("s_store")
slot_to_process = slot_s_store
if (target.s_store)
strip_item = target.s_store
if("head")
slot_to_process = slot_head
if (target.head && !(target.head.flags & NODROP))
strip_item = target.head
if("l_ear")
slot_to_process = slot_l_ear
if (target.l_ear)
strip_item = target.l_ear
if("r_ear")
slot_to_process = slot_r_ear
if (target.r_ear)
strip_item = target.r_ear
if("shoes")
slot_to_process = slot_shoes
if (target.shoes && !(target.shoes.flags & NODROP))
strip_item = target.shoes
if("l_hand")
if (istype(target, /obj/item/clothing/suit/straight_jacket))
qdel(src)
slot_to_process = slot_l_hand
if (target.l_hand)
strip_item = target.l_hand
if("r_hand")
if (istype(target, /obj/item/clothing/suit/straight_jacket))
qdel(src)
slot_to_process = slot_r_hand
if (target.r_hand)
strip_item = target.r_hand
if("uniform")
slot_to_process = slot_w_uniform
if(target.w_uniform && !(target.w_uniform.flags & NODROP))
strip_item = target.w_uniform
if("suit")
slot_to_process = slot_wear_suit
if (target.wear_suit && !(target.wear_suit.flags & NODROP))
strip_item = target.wear_suit
if("tie")
var/obj/item/clothing/under/suit = target.w_uniform
//var/obj/item/clothing/accessory/tie = suit.hastie
/*if(tie)
if (istype(tie,/obj/item/clothing/accessory/storage))
var/obj/item/clothing/accessory/storage/W = tie
if (W.hold)
W.hold.close(usr)
usr.put_in_hands(tie)
suit.hastie = null*/
if(suit && suit.accessories.len)
var/obj/item/clothing/accessory/A = suit.accessories[1]
A.on_removed(usr)
suit.accessories -= A
target.update_inv_w_uniform()
if("id")
slot_to_process = slot_wear_id
if (target.wear_id)
strip_item = target.wear_id
if("pda")
slot_to_process = slot_wear_pda
if (target.wear_pda)
strip_item = target.wear_pda
if("back")
slot_to_process = slot_back
if (target.back)
strip_item = target.back
if("handcuff")
slot_to_process = slot_handcuffed
if (target.handcuffed)
strip_item = target.handcuffed
if("legcuff")
slot_to_process = slot_legcuffed
if (target.legcuffed)
strip_item = target.legcuffed
if("splints")
for(var/organ in list("l_leg","r_leg","l_arm","r_arm"))
var/obj/item/organ/external/o = target.get_organ(organ)
if (o && o.status & ORGAN_SPLINTED)
var/obj/item/W = new /obj/item/stack/medical/splint/single()
o.status &= ~ORGAN_SPLINTED
if (W)
W.loc = target.loc
W.layer = initial(W.layer)
W.add_fingerprint(source)
if("CPR")
if ((target.health > config.health_threshold_dead && target.health <= config.health_threshold_crit))
var/suff = min(target.getOxyLoss(), 7)
target.adjustOxyLoss(-suff)
target.updatehealth()
for(var/mob/O in viewers(source, null))
O.show_message("\red [source] performs CPR on [target]!", 1)
target << "\blue <b>You feel a breath of fresh air enter your lungs. It feels good.</b>"
source << "\red Repeat at least every 7 seconds."
if("dnainjector")
var/obj/item/weapon/dnainjector/S = item
if(S)
S.add_fingerprint(source)
if (!( istype(S, /obj/item/weapon/dnainjector) ))
S.inuse = 0
qdel(src)
S.inject(target, source)
if (S.s_time >= world.time + 30)
S.inuse = 0
qdel(src)
S.s_time = world.time
for(var/mob/O in viewers(source, null))
O.show_message("\red [source] injects [target] with the DNA Injector!", 1)
S.inuse = 0
if("pockets")
slot_to_process = slot_l_store
strip_item = target.l_store //We'll do both
if("sensor")
var/obj/item/clothing/under/suit = target.w_uniform
if (suit)
if(suit.has_sensor >= 2)
source << "The controls are locked."
else
suit.set_sensors(source)
if("internal")
if (target.internal)
target.internal.add_fingerprint(source)
target.internal = null
if (target.internals)
target.internals.icon_state = "internal0"
else
if (!( istype(target.wear_mask, /obj/item/clothing/mask) ))
return
else
if (istype(target.back, /obj/item/weapon/tank))
target.internal = target.back
else if (istype(target.s_store, /obj/item/weapon/tank))
target.internal = target.s_store
else if (istype(target.belt, /obj/item/weapon/tank))
target.internal = target.belt
if (target.internal)
for(var/mob/M in viewers(target, 1))
M.show_message("[target] is now running on internals.", 1)
target.internal.add_fingerprint(source)
if (target.internals)
target.internals.icon_state = "internal1"
if(slot_to_process)
if(strip_item) //Stripping an item from the mob
var/obj/item/W = strip_item
if((W.flags & NODROP) || (W.flags & ABSTRACT)) //Just to be sure
return
target.unEquip(W)
if (target.client)
target.client.screen -= W
if (W)
W.loc = target.loc
W.layer = initial(W.layer)
W.dropped(target)
W.add_fingerprint(source)
if(slot_to_process == slot_l_store) //pockets! Needs to process the other one too. Snowflake code, wooo! It's not like anyone will rewrite this anytime soon. If I'm wrong then... CONGRATULATIONS! ;)
if(target.r_store)
target.unEquip(target.r_store) //At this stage l_store is already processed by the code above, we only need to process r_store.
else
if(item && target.has_organ_for_slot(slot_to_process)) //Placing an item on the mob
if(item.mob_can_equip(target, slot_to_process, 0))
source.unEquip(item)
target.equip_to_slot_if_possible(item, slot_to_process, 0, 1, 1)
item.dropped(source)
source.update_icons()
target.update_icons()
if(source && target)
if(source.machine == target)
target.show_inv(source)
qdel(src)
/mob/proc/get_item_by_slot(slot_id)
switch(slot_id)
if(slot_l_hand)
return l_hand
if(slot_r_hand)
return r_hand
return null
/mob/living/carbon/get_item_by_slot(slot_id)
switch(slot_id)
if(slot_back)
return back
if(slot_wear_mask)
return wear_mask
if(slot_handcuffed)
return handcuffed
if(slot_legcuffed)
return legcuffed
if(slot_l_hand)
return l_hand
if(slot_r_hand)
return r_hand
return null
// Return the item currently in the slot ID
/mob/living/carbon/human/get_item_by_slot(slot_id)
switch(slot_id)
@@ -865,6 +324,8 @@ It can still be worn/put on as normal.
return belt
if(slot_wear_id)
return wear_id
if(slot_wear_pda)
return wear_pda
if(slot_l_ear)
return l_ear
if(slot_r_ear)
@@ -905,6 +366,7 @@ It can still be worn/put on as normal.
shoes,
belt,
wear_id,
wear_pda,
l_store,
r_store,
w_uniform
@@ -918,3 +380,218 @@ It can still be worn/put on as normal.
r_ear,
l_ear,
)
// humans have their pickpocket gloves, so they get no message when stealing things
/mob/living/carbon/human/stripPanelUnequip(obj/item/what, mob/who, where)
var/is_silent = 0
var/obj/item/clothing/gloves/G = gloves
if(istype(G))
is_silent = G.pickpocket
..(what, who, where, silent = is_silent)
// humans have their pickpocket gloves, so they get no message when stealing things
/mob/living/carbon/human/stripPanelEquip(obj/item/what, mob/who, where)
var/is_silent = 0
var/obj/item/clothing/gloves/G = gloves
if(istype(G))
is_silent = G.pickpocket
..(what, who, where, silent = is_silent)
/mob/living/carbon/human/can_equip(obj/item/I, slot, disable_warning = 0)
switch(species.handle_can_equip(I, slot, disable_warning, src))
if(1) return 1
if(2) return 0 //if it returns 2, it wants no normal handling
if(istype(I, /obj/item/clothing/under) || istype(I, /obj/item/clothing/suit))
if(FAT in mutations)
//testing("[M] TOO FAT TO WEAR [src]!")
if(!(I.flags & ONESIZEFITSALL))
if(!disable_warning)
src << "<span class='alert'>You're too fat to wear the [I].</span>"
return 0
switch(slot)
if(slot_l_hand)
if(l_hand)
return 0
return 1
if(slot_r_hand)
if(r_hand)
return 0
return 1
if(slot_wear_mask)
if(wear_mask)
return 0
if(!(I.slot_flags & SLOT_MASK))
return 0
return 1
if(slot_back)
if(back)
return 0
if(!(I.slot_flags & SLOT_BACK))
return 0
return 1
if(slot_wear_suit)
if(wear_suit)
return 0
if(!(I.slot_flags & SLOT_OCLOTHING))
return 0
return 1
if(slot_gloves)
if(gloves)
return 0
if(!(I.slot_flags & SLOT_GLOVES))
return 0
return 1
if(slot_shoes)
if(shoes)
return 0
if(!(I.slot_flags & SLOT_FEET))
return 0
return 1
if(slot_belt)
if(belt)
return 0
if(!w_uniform)
if(!disable_warning)
src << "<span class='alert'>You need a jumpsuit before you can attach this [name].</span>"
return 0
if(!(I.slot_flags & SLOT_BELT))
return
return 1
if(slot_glasses)
if(glasses)
return 0
if(!(I.slot_flags & SLOT_EYES))
return 0
return 1
if(slot_head)
if(head)
return 0
if(!(I.slot_flags & SLOT_HEAD))
return 0
return 1
if(slot_l_ear)
if(l_ear)
return 0
if(!(I.slot_flags & SLOT_EARS))
return 0
if((I.slot_flags & SLOT_TWOEARS) && r_ear )
return 0
return 1
if(slot_r_ear)
if(r_ear)
return 0
if(!(I.slot_flags & SLOT_EARS))
return 0
if((I.slot_flags & SLOT_TWOEARS) && l_ear)
return 0
return 1
if(slot_w_uniform)
if(w_uniform)
return 0
if(!(I.slot_flags & SLOT_ICLOTHING))
return 0
return 1
if(slot_wear_id)
if(wear_id)
return 0
if(!w_uniform)
if(!disable_warning)
src << "<span class='alert'>You need a jumpsuit before you can attach this [name].</span>"
return 0
if(!(I.slot_flags & SLOT_ID))
return 0
return 1
if(slot_wear_pda)
if(wear_pda)
return 0
if(!w_uniform)
if(!disable_warning)
src << "<span class='alert'>You need a jumpsuit before you can attach this [name].</span>"
return 0
if(!(I.slot_flags & SLOT_PDA))
return 0
return 1
if(slot_l_store)
if(I.flags & NODROP) //Pockets aren't visible, so you can't move NODROP items into them.
return 0
if(l_store)
return 0
if(!w_uniform)
if(!disable_warning)
src << "<span class='alert'>You need a jumpsuit before you can attach this [name].</span>"
return 0
if(I.slot_flags & SLOT_DENYPOCKET)
return
if(I.w_class <= 2 || (I.slot_flags & SLOT_POCKET))
return 1
if(slot_r_store)
if(I.flags & NODROP)
return 0
if(r_store)
return 0
if(!w_uniform)
if(!disable_warning)
src << "<span class='alert'>You need a jumpsuit before you can attach this [name].</span>"
return 0
if(I.slot_flags & SLOT_DENYPOCKET)
return 0
if(I.w_class <= 2 || (I.slot_flags & SLOT_POCKET))
return 1
return 0
if(slot_s_store)
if(I.flags & NODROP) //Suit storage NODROP items drop if you take a suit off, this is to prevent people exploiting this.
return 0
if(s_store)
return 0
if(!wear_suit)
if(!disable_warning)
src << "<span class='alert'>You need a suit before you can attach this [name].</span>"
return 0
if(!wear_suit.allowed)
if(!disable_warning)
src << "You somehow have a suit with no defined allowed items for suit storage, stop that."
return 0
if(I.w_class > 4)
if(!disable_warning)
src << "The [name] is too big to attach."
return 0
if(istype(I, /obj/item/device/pda) || istype(I, /obj/item/weapon/pen) || is_type_in_list(I, wear_suit.allowed))
return 1
return 0
if(slot_handcuffed)
if(handcuffed)
return 0
if(!istype(I, /obj/item/weapon/restraints/handcuffs))
return 0
return 1
if(slot_legcuffed)
if(legcuffed)
return 0
if(!istype(I, /obj/item/weapon/restraints/legcuffs))
return 0
return 1
if(slot_in_backpack)
if(back && istype(back, /obj/item/weapon/storage/backpack))
var/obj/item/weapon/storage/backpack/B = back
if(B.contents.len < B.storage_slots && I.w_class <= B.max_w_class)
return 1
return 0
if(slot_tie)
if(!w_uniform)
if(!disable_warning)
src << "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>"
return 0
var/obj/item/clothing/under/uniform = w_uniform
if(uniform.accessories.len && !uniform.can_attach_accessory(src))
if(!disable_warning)
src << "<span class='warning'>You already have an accessory of this type attached to your [uniform].</span>"
return 0
if(!(I.slot_flags & SLOT_TIE))
return 0
return 1
return 0 //Unsupported slot

View File

@@ -52,6 +52,42 @@ datum/species/monkey/get_random_name(var/gender)
/datum/species/monkey/handle_dna(var/mob/living/carbon/human/H)
H.dna.SetSEState(MONKEYBLOCK,1)
/datum/species/monkey/handle_can_equip(obj/item/I, slot, disable_warning = 0, mob/living/carbon/human/user)
switch(slot)
if(slot_l_hand)
if(user.l_hand)
return 2
return 1
if(slot_r_hand)
if(user.r_hand)
return 2
return 1
if(slot_wear_mask)
if(user.wear_mask)
return 2
if(!(I.slot_flags & SLOT_MASK))
return 2
return 1
if(slot_back)
if(user.back)
return 2
if(!(I.slot_flags & SLOT_BACK))
return 2
return 1
if(slot_handcuffed)
if(user.handcuffed)
return 2
if(!istype(I, /obj/item/weapon/restraints/handcuffs))
return 2
return 1
if(slot_in_backpack)
if(user.back && istype(user.back, /obj/item/weapon/storage/backpack))
var/obj/item/weapon/storage/backpack/B = user.back
if(B.contents.len < B.storage_slots && I.w_class <= B.max_w_class)
return 1
return 2
return 2
/datum/species/monkey/tajaran
name = "Farwa"
name_plural = "Farwa"

View File

@@ -364,3 +364,6 @@
/datum/unarmed_attack/claws/armalis
attack_verb = list("slash", "claw")
damage = 6 //they're huge! they should do a little more damage, i'd even go for 15-20 maybe...
/datum/species/proc/handle_can_equip(obj/item/I, slot, disable_warning = 0, mob/living/carbon/human/user)
return 0

View File

@@ -692,9 +692,6 @@ var/global/list/damage_icon_parts = list()
if(head)
head.screen_loc = ui_head //TODO
var/image/standing
if(istype(head,/obj/item/clothing/head/kitty))
standing = image("icon" = head:mob)
else
if(head.icon_override)
standing = image("icon" = head.icon_override, "icon_state" = "[head.icon_state]")
else if(head.sprite_sheets && head.sprite_sheets[species.name])

View File

@@ -890,6 +890,40 @@
/mob/living/proc/can_use_vents()
return "You can't fit into that vent."
// The src mob is trying to strip an item from someone
// Override if a certain type of mob should be behave differently when stripping items (can't, for example)
/mob/living/stripPanelUnequip(obj/item/what, mob/who, where, var/silent = 0)
if(what.flags & NODROP)
src << "<span class='warning'>You can't remove \the [what.name], it appears to be stuck!</span>"
return
if(!silent)
who.visible_message("<span class='danger'>[src] tries to remove [who]'s [what.name].</span>", \
"<span class='userdanger'>[src] tries to remove [who]'s [what.name].</span>")
what.add_fingerprint(src)
if(do_mob(src, who, what.strip_delay))
if(what && what == who.get_item_by_slot(where) && Adjacent(who))
who.unEquip(what)
add_logs(who, src, "stripped", addition="of [what]")
// The src mob is trying to place an item on someone
// Override if a certain mob should be behave differently when placing items (can't, for example)
/mob/living/stripPanelEquip(obj/item/what, mob/who, where, var/silent = 0)
what = src.get_active_hand()
if(what && (what.flags & NODROP))
src << "<span class='warning'>You can't put \the [what.name] on [who], it's stuck to your hand!</span>"
return
if(what)
if(!what.mob_can_equip(who, where, 1))
src << "<span class='warning'>\The [what.name] doesn't fit in that place!</span>"
return
if(!silent)
visible_message("<span class='notice'>[src] tries to put [what] on [who].</span>")
if(do_mob(src, who, what.put_on_delay))
if(what && Adjacent(who))
unEquip(what)
who.equip_to_slot_if_possible(what, where, 0, 1)
add_logs(who, src, "equipped", what)
/mob/living/singularity_act()
var/gain = 20

View File

@@ -469,23 +469,18 @@ var/list/slot_equipment_priority = list( \
return
/mob/proc/show_inv(mob/user as mob)
/mob/proc/show_inv(mob/user)
user.set_machine(src)
var/dat = {"
<B><HR><FONT size=3>[name]</FONT></B>
<BR><HR>
<BR><B>Head(Mask):</B> <A href='?src=\ref[src];item=mask'>[(wear_mask ? wear_mask : "Nothing")]</A>
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=l_hand'>[(l_hand && !(l_hand.flags & ABSTRACT)) ? l_hand : "Nothing"]</A>
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=r_hand'>[(r_hand && !(r_hand.flags & ABSTRACT)) ? r_hand : "Nothing"]</A>
<BR><B>Back:</B> <A href='?src=\ref[src];item=back'>[(back && !(back.flags & ABSTRACT)) ? back : "Nothing"]</A> [((istype(wear_mask, /obj/item/clothing/mask) && istype(back, /obj/item/weapon/tank) && !( internal )) ? text(" <A href='?src=\ref[];item=internal'>Set Internal</A>", src) : "")]
<BR>[(internal ? text("<A href='?src=\ref[src];item=internal'>Remove Internal</A>") : "")]
<BR><A href='?src=\ref[src];item=pockets'>Empty Pockets</A>
<BR><A href='?src=\ref[user];refresh=1'>Refresh</A>
<HR>
<B><FONT size=3>[name]</FONT></B>
<HR>
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=[slot_l_hand]'> [(l_hand&&!(l_hand.flags&ABSTRACT)) ? l_hand : "Nothing"]</A>
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=[slot_r_hand]'> [(r_hand&&!(r_hand.flags&ABSTRACT)) ? r_hand : "Nothing"]</A>
<BR><A href='?src=\ref[user];mach_close=mob\ref[src]'>Close</A>
<BR>"}
user << browse(dat, text("window=mob[];size=325x500", name))
"}
user << browse(dat, "window=mob\ref[src];size=325x500")
onclose(user, "mob\ref[src]")
return
//mob verbs are faster than object verbs. See http://www.byond.com/forum/?post=1326139&page=2#comment8198716 for why this isn't atom/verb/examine()
/mob/verb/examinate(atom/A as mob|obj|turf in view())
@@ -786,6 +781,26 @@ var/list/slot_equipment_priority = list( \
unset_machine()
src << browse(null, t1)
if(href_list["refresh"])
if(machine && in_range(src, usr))
show_inv(machine)
if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr))
if(href_list["item"])
var/slot = text2num(href_list["item"])
var/obj/item/what = get_item_by_slot(slot)
if(what)
usr.stripPanelUnequip(what,src,slot)
else
usr.stripPanelEquip(what,src,slot)
if(usr.machine == src)
if(Adjacent(usr))
show_inv(usr)
else
usr << browse(null,"window=mob\ref[src]")
if(href_list["flavor_more"])
usr << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", name, replacetext(flavor_text, "\n", "<BR>")), text("window=[];size=500x200", name))
onclose(usr, "[name]")
@@ -794,6 +809,16 @@ var/list/slot_equipment_priority = list( \
return
// The src mob is trying to strip an item from someone
// Defined in living.dm
/mob/proc/stripPanelUnequip(obj/item/what, mob/who)
return
// The src mob is trying to place an item on someone
// Defined in living.dm
/mob/proc/stripPanelEquip(obj/item/what, mob/who)
return
/mob/proc/pull_damage()
if(ishuman(src))

View File

@@ -74,7 +74,7 @@
var/mob/living/M = loc
if(M == T) return
if(!istype(M)) return
if(src != M.equipped())
if(src != M.get_active_hand())
stop_aim()
return
M.last_move_intent = world.time

View File

@@ -426,7 +426,6 @@
#include "code\game\machinery\machinery.dm"
#include "code\game\machinery\magnet.dm"
#include "code\game\machinery\mass_driver.dm"
#include "code\game\machinery\metaldetector.dm"
#include "code\game\machinery\navbeacon.dm"
#include "code\game\machinery\newscaster.dm"
#include "code\game\machinery\OpTable.dm"