mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-26 01:04:36 +00:00
Moved into their own folder and got split into three files. Damage zones have been regrouped slightly to make it easier to deal with them. Currently the organ groups are head, l/r leg, l/r arm, and head. Attacking: Armor is properly checked. Currently aiming for the chest gives a higher chance to stun whereas the head will stun for longer. Stungloves/Disarm now show up in the attack log. Stungloves ignore intent. Silicon: AI units can now move between cams that are not on the ss13 network. Cyborg's alert screen should not longer pop up every time they get an alert if they have opened it once during the round. Robot vision now uses the standard amount of energy. Gamemodes: Added Deuryn's unrev message. Runes can only be examined if you are close to them. Moved the Loyalty implants to the HoS' locker at the request of HerpA. Nuke agents now come with explosive implants that will activate upon death. Projectiles: Once again went though the gun code and cleaned things up, it is much better now. Bullet_act fixed up and most mobs now use the one in living, just overload it if they need to do something diff. Freeze /caplaser/xbow no longer have an infinite loop. Shotguns have to be pumped manually. Went though the latest runtime log. Power cells now use return on their give/use procs Assemblies have been reworked and are nearly finished, just need to finish up the special assembly code, redo the signalers, and add one or two new assembly items. Laying down will now only take 3 ticks to get up, from 5. You can no longer punch people on the spawn screen. This is a big one and was cleared by two heads, TK will only allow you to pick up items. If you have an item in your hand it will act normal. This revision got much larger than originally intended my tests show everything is working fine, but you never know. Ill likely do more mob teaks in the next few days. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2333 316c924e-a436-60f5-8080-3fe189b3f50e
2271 lines
68 KiB
Plaintext
2271 lines
68 KiB
Plaintext
/mob/living/carbon/human
|
|
name = "human"
|
|
real_name = "human"
|
|
voice_name = "human"
|
|
icon = 'mob.dmi'
|
|
icon_state = "m-none"
|
|
|
|
|
|
var/r_hair = 0.0
|
|
var/g_hair = 0.0
|
|
var/b_hair = 0.0
|
|
var/h_style = "Short Hair"
|
|
var/r_facial = 0.0
|
|
var/g_facial = 0.0
|
|
var/b_facial = 0.0
|
|
var/f_style = "Shaved"
|
|
var/r_eyes = 0.0
|
|
var/g_eyes = 0.0
|
|
var/b_eyes = 0.0
|
|
var/s_tone = 0.0
|
|
var/age = 30.0
|
|
var/b_type = "A+"
|
|
|
|
var/obj/item/clothing/suit/wear_suit = null
|
|
var/obj/item/clothing/under/w_uniform = null
|
|
var/obj/item/clothing/shoes/shoes = null
|
|
var/obj/item/weapon/belt = null
|
|
var/obj/item/clothing/gloves/gloves = null
|
|
var/obj/item/clothing/glasses/glasses = null
|
|
var/obj/item/clothing/head/head = null
|
|
var/obj/item/clothing/ears/ears = null
|
|
var/obj/item/weapon/card/id/wear_id = null
|
|
var/obj/item/weapon/r_store = null
|
|
var/obj/item/weapon/l_store = null
|
|
var/obj/item/weapon/s_store = null
|
|
var/obj/item/weapon/h_store = null
|
|
|
|
var/icon/stand_icon = null
|
|
var/icon/lying_icon = null
|
|
|
|
var/last_b_state = 1.0
|
|
|
|
var/image/face_standing = null
|
|
var/image/face_lying = null
|
|
|
|
var/hair_icon_state = "hair_a"
|
|
var/face_icon_state = "bald"
|
|
|
|
var/list/body_standing = list()
|
|
var/list/body_lying = list()
|
|
|
|
var/mutantrace = null
|
|
|
|
var/list/organs = list()
|
|
|
|
/mob/living/carbon/human/dummy
|
|
real_name = "Test Dummy"
|
|
nodamage = 1
|
|
|
|
|
|
|
|
/mob/living/carbon/human/New()
|
|
var/datum/reagents/R = new/datum/reagents(1000)
|
|
reagents = R
|
|
R.my_atom = src
|
|
|
|
if(!dna) dna = new /datum/dna(null)
|
|
|
|
var/datum/organ/external/chest/chest = new /datum/organ/external/chest(src)
|
|
var/datum/organ/external/head/head = new /datum/organ/external/head(src)
|
|
var/datum/organ/external/l_arm/l_arm = new /datum/organ/external/l_arm(src)
|
|
var/datum/organ/external/r_arm/r_arm = new /datum/organ/external/r_arm(src)
|
|
var/datum/organ/external/r_leg/r_leg = new /datum/organ/external/r_leg(src)
|
|
var/datum/organ/external/l_leg/l_leg = new /datum/organ/external/l_leg(src)
|
|
chest.owner = src
|
|
head.owner = src
|
|
r_arm.owner = src
|
|
l_arm.owner = src
|
|
r_leg.owner = src
|
|
l_leg.owner = src
|
|
organs += chest
|
|
organs += head
|
|
organs += r_arm
|
|
organs += l_arm
|
|
organs += r_leg
|
|
organs += l_leg
|
|
|
|
var/g = "m"
|
|
if (gender == MALE)
|
|
g = "m"
|
|
else if (gender == FEMALE)
|
|
g = "f"
|
|
else
|
|
gender = MALE
|
|
g = "m"
|
|
|
|
spawn (1)
|
|
if(!stand_icon)
|
|
stand_icon = new /icon('human.dmi', "body_[g]_s")
|
|
if(!lying_icon)
|
|
lying_icon = new /icon('human.dmi', "body_[g]_l")
|
|
icon = stand_icon
|
|
update_clothing()
|
|
src << "\blue Your icons have been generated!"
|
|
|
|
..()
|
|
|
|
// organStructure = new /obj/effect/organstructure/human(src)
|
|
|
|
/mob/living/carbon/human/Bump(atom/movable/AM as mob|obj, yes)
|
|
if ((!( yes ) || now_pushing))
|
|
return
|
|
now_pushing = 1
|
|
if (ismob(AM))
|
|
var/mob/tmob = AM
|
|
if(tmob.a_intent == "help" && a_intent == "help" && tmob.canmove && canmove) // mutual brohugs all around!
|
|
var/turf/oldloc = loc
|
|
loc = tmob.loc
|
|
tmob.loc = oldloc
|
|
now_pushing = 0
|
|
for(var/mob/living/carbon/metroid/Metroid in view(1,tmob))
|
|
if(Metroid.Victim == tmob)
|
|
Metroid.UpdateFeed()
|
|
return
|
|
|
|
if(istype(tmob, /mob/living/carbon/human) && tmob.mutations & FAT)
|
|
if(prob(40) && !(mutations & FAT))
|
|
visible_message("\red <B>[src] fails to push [tmob]'s fat ass out of the way.</B>", \
|
|
"\red <B>You fail to push [tmob]'s fat ass out of the way.</B>")
|
|
now_pushing = 0
|
|
return
|
|
|
|
tmob.LAssailant = src
|
|
|
|
now_pushing = 0
|
|
spawn(0)
|
|
..()
|
|
if (!istype(AM, /atom/movable))
|
|
return
|
|
if (!now_pushing)
|
|
now_pushing = 1
|
|
|
|
if (!AM.anchored)
|
|
var/t = get_dir(src, AM)
|
|
if (istype(AM, /obj/structure/window))
|
|
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
|
|
for(var/obj/structure/window/win in get_step(AM,t))
|
|
now_pushing = 0
|
|
return
|
|
step(AM, t)
|
|
now_pushing = 0
|
|
return
|
|
return
|
|
|
|
/mob/living/carbon/human/movement_delay()
|
|
var/tally = 0
|
|
|
|
if(reagents.has_reagent("hyperzine")) return -1
|
|
|
|
if(reagents.has_reagent("nuka_cola")) return -1
|
|
|
|
if (istype(loc, /turf/space)) return -1 // It's hard to be slowed down in space by... anything
|
|
|
|
var/health_deficiency = (100 - health)
|
|
if(health_deficiency >= 40) tally += (health_deficiency / 25)
|
|
|
|
var/hungry = (500 - nutrition)/5 // So overeat would be 100 and default level would be 80
|
|
if (hungry >= 70) tally += hungry/50
|
|
|
|
if(wear_suit)
|
|
tally += wear_suit.slowdown
|
|
|
|
if(shoes)
|
|
tally += shoes.slowdown
|
|
|
|
if(mutations & FAT)
|
|
tally += 1.5
|
|
if (bodytemperature < 283.222)
|
|
tally += (283.222 - bodytemperature) / 10 * 1.75
|
|
|
|
return tally
|
|
|
|
/mob/living/carbon/human/Stat()
|
|
..()
|
|
statpanel("Status")
|
|
|
|
stat(null, "Intent: [a_intent]")
|
|
stat(null, "Move Mode: [m_intent]")
|
|
if(ticker && ticker.mode && ticker.mode.name == "AI malfunction")
|
|
if(ticker.mode:malf_mode_declared)
|
|
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
|
|
if(emergency_shuttle)
|
|
if(emergency_shuttle.online && emergency_shuttle.location < 2)
|
|
var/timeleft = emergency_shuttle.timeleft()
|
|
if (timeleft)
|
|
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
|
|
|
|
if (client.statpanel == "Status")
|
|
if (internal)
|
|
if (!internal.air_contents)
|
|
del(internal)
|
|
else
|
|
stat("Internal Atmosphere Info", internal.name)
|
|
stat("Tank Pressure", internal.air_contents.return_pressure())
|
|
stat("Distribution Pressure", internal.distribute_pressure)
|
|
if (mind)
|
|
if (mind.special_role == "Changeling" && changeling)
|
|
stat("Chemical Storage", changeling.chem_charges)
|
|
if (istype(wear_suit, /obj/item/clothing/suit/space/space_ninja)&&wear_suit:s_initialized)
|
|
stat("Energy Charge", round(wear_suit:cell:charge/100))
|
|
|
|
/mob/living/carbon/human/ex_act(severity)
|
|
flick("flash", flash)
|
|
|
|
// /obj/item/clothing/suit/bomb_suit(src)
|
|
// /obj/item/clothing/head/bomb_hood(src)
|
|
|
|
if (stat == 2 && client)
|
|
gib(1)
|
|
return
|
|
|
|
else if (stat == 2 && !client)
|
|
gibs(loc, viruses)
|
|
del(src)
|
|
return
|
|
|
|
var/shielded = 0
|
|
var/b_loss = null
|
|
var/f_loss = null
|
|
switch (severity)
|
|
if (1.0)
|
|
b_loss += 500
|
|
if (!prob(getarmor(null, "bomb")))
|
|
gib(1)
|
|
return
|
|
else
|
|
var/atom/target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src)))
|
|
throw_at(target, 200, 4)
|
|
//return
|
|
// var/atom/target = get_edge_target_turf(user, get_dir(src, get_step_away(user, src)))
|
|
//user.throw_at(target, 200, 4)
|
|
|
|
if (2.0)
|
|
if (!shielded)
|
|
b_loss += 60
|
|
|
|
f_loss += 60
|
|
|
|
if (!prob(getarmor(null, "bomb")))
|
|
b_loss = b_loss/1.5
|
|
f_loss = f_loss/1.5
|
|
|
|
if (!istype(ears, /obj/item/clothing/ears/earmuffs))
|
|
ear_damage += 30
|
|
ear_deaf += 120
|
|
|
|
if(3.0)
|
|
b_loss += 30
|
|
if (!prob(getarmor(null, "bomb")))
|
|
b_loss = b_loss/2
|
|
if (!istype(ears, /obj/item/clothing/ears/earmuffs))
|
|
ear_damage += 15
|
|
ear_deaf += 60
|
|
if (prob(50) && !shielded)
|
|
paralysis += 10
|
|
|
|
for(var/organ in organs)
|
|
var/datum/organ/external/temp = organs[text("[]", organ)]
|
|
if (istype(temp, /datum/organ/external))
|
|
switch(temp.name)
|
|
if("head")
|
|
temp.take_damage(b_loss * 0.2, f_loss * 0.2)
|
|
if("chest")
|
|
temp.take_damage(b_loss * 0.4, f_loss * 0.4)
|
|
if("groin")
|
|
temp.take_damage(b_loss * 0.1, f_loss * 0.1)
|
|
if("l_arm")
|
|
temp.take_damage(b_loss * 0.05, f_loss * 0.05)
|
|
if("r_arm")
|
|
temp.take_damage(b_loss * 0.05, f_loss * 0.05)
|
|
/* if("l_hand")
|
|
/ temp.take_damage(b_loss * 0.0225, f_loss * 0.0225)
|
|
if("r_hand")
|
|
temp.take_damage(b_loss * 0.0225, f_loss * 0.0225)*/
|
|
if("l_leg")
|
|
temp.take_damage(b_loss * 0.05, f_loss * 0.05)
|
|
if("r_leg")
|
|
temp.take_damage(b_loss * 0.05, f_loss * 0.05)
|
|
/* if("l_foot")
|
|
temp.take_damage(b_loss * 0.0225, f_loss * 0.0225)
|
|
if("r_foot")
|
|
temp.take_damage(b_loss * 0.0225, f_loss * 0.0225)*/
|
|
|
|
UpdateDamageIcon()
|
|
|
|
|
|
/mob/living/carbon/human/blob_act()
|
|
if (stat == 2)
|
|
return
|
|
var/damage = null
|
|
if (stat != 2)
|
|
damage = rand(30,40)
|
|
|
|
show_message("\red The blob attacks you!")
|
|
|
|
var/list/zones = list("head","chest","chest", "groin", "l_arm", "r_arm", "l_leg", "r_leg")
|
|
|
|
var/zone = pick(zones)
|
|
|
|
var/datum/organ/external/temp = organs["[zone]"]
|
|
|
|
switch(zone)//This really needs an update badly
|
|
if ("head")
|
|
if ((((head && head.body_parts_covered & HEAD) || (wear_mask && wear_mask.body_parts_covered & HEAD)) && prob(99)))
|
|
if (prob(20))
|
|
temp.take_damage(damage, 0)
|
|
else
|
|
show_message("\red You have been protected from a hit to the head.")
|
|
return
|
|
if (damage > 4.9)
|
|
if (weakened < 10)
|
|
weakened = rand(10, 15)
|
|
for(var/mob/O in viewers(src, null))
|
|
O.show_message(text("\red <B>The blob has weakened []!</B>", src), 1, "\red You hear someone fall.", 2)
|
|
temp.take_damage(damage)
|
|
if ("chest")
|
|
if ((((wear_suit && wear_suit.body_parts_covered & UPPER_TORSO) || (w_uniform && w_uniform.body_parts_covered & UPPER_TORSO)) && prob(85)))
|
|
show_message("\red You have been protected from a hit to the chest.")
|
|
return
|
|
if (damage > 4.9)
|
|
if (prob(50))
|
|
if (weakened < 5)
|
|
weakened = 5
|
|
for(var/mob/O in viewers(src, null))
|
|
O.show_message(text("\red <B>The blob has knocked down []!</B>", src), 1, "\red You hear someone fall.", 2)
|
|
else
|
|
if (stunned < 5)
|
|
stunned = 5
|
|
for(var/mob/O in viewers(src, null))
|
|
if(O.client) O.show_message(text("\red <B>The blob has stunned []!</B>", src), 1)
|
|
if(stat != 2) stat = 1
|
|
temp.take_damage(damage)
|
|
if ("groin")
|
|
if ((((wear_suit && wear_suit.body_parts_covered & LOWER_TORSO) || (w_uniform && w_uniform.body_parts_covered & LOWER_TORSO)) && prob(75)))
|
|
show_message("\red You have been protected from a hit to the lower chest.")
|
|
return
|
|
else
|
|
temp.take_damage(damage, 0)
|
|
|
|
|
|
if("l_arm")
|
|
temp.take_damage(damage, 0)
|
|
if("r_arm")
|
|
temp.take_damage(damage, 0)
|
|
if("l_hand")
|
|
temp.take_damage(damage, 0)
|
|
if("r_hand")
|
|
temp.take_damage(damage, 0)
|
|
if("l_leg")
|
|
temp.take_damage(damage, 0)
|
|
if("r_leg")
|
|
temp.take_damage(damage, 0)
|
|
if("l_foot")
|
|
temp.take_damage(damage, 0)
|
|
if("r_foot")
|
|
temp.take_damage(damage, 0)
|
|
|
|
UpdateDamageIcon()
|
|
return
|
|
|
|
/mob/living/carbon/human/u_equip(obj/item/W as obj)
|
|
if (W == wear_suit)
|
|
W = s_store
|
|
if (W)
|
|
u_equip(W)
|
|
if (client)
|
|
client.screen -= W
|
|
if (W)
|
|
W.loc = loc
|
|
W.dropped(src)
|
|
W.layer = initial(W.layer)
|
|
wear_suit = null
|
|
else if (W == w_uniform)
|
|
W = r_store
|
|
if (W)
|
|
u_equip(W)
|
|
if (client)
|
|
client.screen -= W
|
|
if (W)
|
|
W.loc = loc
|
|
W.dropped(src)
|
|
W.layer = initial(W.layer)
|
|
W = l_store
|
|
if (W)
|
|
u_equip(W)
|
|
if (client)
|
|
client.screen -= W
|
|
if (W)
|
|
W.loc = loc
|
|
W.dropped(src)
|
|
W.layer = initial(W.layer)
|
|
W = wear_id
|
|
if (W)
|
|
u_equip(W)
|
|
if (client)
|
|
client.screen -= W
|
|
if (W)
|
|
W.loc = loc
|
|
W.dropped(src)
|
|
W.layer = initial(W.layer)
|
|
W = belt
|
|
if (W)
|
|
u_equip(W)
|
|
if (client)
|
|
client.screen -= W
|
|
if (W)
|
|
W.loc = loc
|
|
W.dropped(src)
|
|
W.layer = initial(W.layer)
|
|
w_uniform = null
|
|
else if (W == gloves)
|
|
gloves = null
|
|
else if (W == glasses)
|
|
glasses = null
|
|
else if (W == head)
|
|
W = h_store
|
|
if (W)
|
|
u_equip(W)
|
|
if (client)
|
|
client.screen -= W
|
|
if (W)
|
|
W.loc = loc
|
|
W.dropped(src)
|
|
W.layer = initial(W.layer)
|
|
head = null
|
|
else if (W == ears)
|
|
ears = null
|
|
else if (W == shoes)
|
|
shoes = null
|
|
else if (W == belt)
|
|
belt = null
|
|
else if (W == wear_mask)
|
|
if(internal)
|
|
if (internals)
|
|
internals.icon_state = "internal0"
|
|
internal = null
|
|
wear_mask = null
|
|
else if (W == wear_id)
|
|
wear_id = null
|
|
else if (W == r_store)
|
|
r_store = null
|
|
else if (W == l_store)
|
|
l_store = null
|
|
else if (W == s_store)
|
|
s_store = null
|
|
else if (W == h_store)
|
|
h_store = null
|
|
else if (W == back)
|
|
back = null
|
|
else if (W == handcuffed)
|
|
handcuffed = null
|
|
else if (W == r_hand)
|
|
r_hand = null
|
|
else if (W == l_hand)
|
|
l_hand = null
|
|
|
|
update_clothing()
|
|
|
|
/mob/living/carbon/human/db_click(text, t1)
|
|
var/obj/item/W = equipped()
|
|
var/emptyHand = (W == null)
|
|
if ((!emptyHand) && (!istype(W, /obj/item)))
|
|
return
|
|
if (emptyHand)
|
|
usr.next_move = usr.prev_move
|
|
usr:lastDblClick -= 3 //permit the double-click redirection to proceed.
|
|
switch(text)
|
|
if("mask")
|
|
if (wear_mask)
|
|
if (emptyHand)
|
|
wear_mask.DblClick()
|
|
return
|
|
if (!( istype(W, /obj/item/clothing/mask) ))
|
|
return
|
|
u_equip(W)
|
|
wear_mask = W
|
|
W.equipped(src, text)
|
|
if("back")
|
|
if (back)
|
|
if (emptyHand)
|
|
back.DblClick()
|
|
return
|
|
if (!istype(W, /obj/item))
|
|
return
|
|
if (!( W.flags & ONBACK ))
|
|
return
|
|
u_equip(W)
|
|
back = W
|
|
W.equipped(src, text)
|
|
|
|
/* if("headset")
|
|
if (ears)
|
|
if (emptyHand)
|
|
ears.DblClick()
|
|
return
|
|
if (!( istype(W, /obj/item/device/radio/headset) ))
|
|
return
|
|
u_equip(W)
|
|
w_radio = W
|
|
W.equipped(src, text) */
|
|
if("o_clothing")
|
|
if (wear_suit)
|
|
if (emptyHand)
|
|
wear_suit.DblClick()
|
|
return
|
|
if (!( istype(W, /obj/item/clothing/suit) ))
|
|
return
|
|
if (mutations & FAT && !(W.flags & ONESIZEFITSALL))
|
|
src << "\red You're too fat to wear the [W.name]!"
|
|
return
|
|
u_equip(W)
|
|
wear_suit = W
|
|
W.equipped(src, text)
|
|
if("gloves")
|
|
if (gloves)
|
|
if (emptyHand)
|
|
gloves.DblClick()
|
|
return
|
|
if (!( istype(W, /obj/item/clothing/gloves) ))
|
|
return
|
|
u_equip(W)
|
|
gloves = W
|
|
W.equipped(src, text)
|
|
if("shoes")
|
|
if (shoes)
|
|
if (emptyHand)
|
|
shoes.DblClick()
|
|
return
|
|
if (!( istype(W, /obj/item/clothing/shoes) ))
|
|
return
|
|
u_equip(W)
|
|
shoes = W
|
|
W.equipped(src, text)
|
|
if("belt")
|
|
if (belt)
|
|
if (emptyHand)
|
|
belt.DblClick()
|
|
return
|
|
if (!W || !W.flags || !( W.flags & ONBELT ))
|
|
return
|
|
u_equip(W)
|
|
belt = W
|
|
W.equipped(src, text)
|
|
if("eyes")
|
|
if (glasses)
|
|
if (emptyHand)
|
|
glasses.DblClick()
|
|
return
|
|
if (!( istype(W, /obj/item/clothing/glasses) ))
|
|
return
|
|
u_equip(W)
|
|
glasses = W
|
|
W.equipped(src, text)
|
|
if("head")
|
|
if (head)
|
|
if (emptyHand)
|
|
head.DblClick()
|
|
return
|
|
if (( istype(W, /obj/item/weapon/paper) ))
|
|
u_equip(W)
|
|
head = W
|
|
else if (!( istype(W, /obj/item/clothing/head) ))
|
|
return
|
|
u_equip(W)
|
|
head = W
|
|
if(istype(W,/obj/item/clothing/head/kitty))
|
|
W.update_icon(src)
|
|
W.equipped(src, text)
|
|
if("ears")
|
|
if (ears)
|
|
if (emptyHand)
|
|
ears.DblClick()
|
|
return
|
|
if (!( istype(W, /obj/item/clothing/ears) ) && !( istype(W, /obj/item/device/radio/headset) ))
|
|
return
|
|
u_equip(W)
|
|
ears = W
|
|
W.equipped(src, text)
|
|
if("i_clothing")
|
|
if (w_uniform)
|
|
if (emptyHand)
|
|
w_uniform.DblClick()
|
|
return
|
|
if (!( istype(W, /obj/item/clothing/under) ))
|
|
return
|
|
if (mutations & FAT && !(W.flags & ONESIZEFITSALL))
|
|
src << "\red You're too fat to wear the [W.name]!"
|
|
return
|
|
u_equip(W)
|
|
w_uniform = W
|
|
W.equipped(src, text)
|
|
if("id")
|
|
if (wear_id)
|
|
if (emptyHand)
|
|
wear_id.DblClick()
|
|
return
|
|
if (!w_uniform)
|
|
return
|
|
if (!istype(W, /obj/item/weapon/card/id) && !istype(W, /obj/item/device/pda) )
|
|
return
|
|
u_equip(W)
|
|
wear_id = W
|
|
W.equipped(src, text)
|
|
if("storage1")
|
|
if (l_store)
|
|
if (emptyHand)
|
|
l_store.DblClick()
|
|
return
|
|
if ((!( istype(W, /obj/item) ) || W.w_class > 2 || !( w_uniform )))
|
|
return
|
|
u_equip(W)
|
|
l_store = W
|
|
if("storage2")
|
|
if (r_store)
|
|
if (emptyHand)
|
|
r_store.DblClick()
|
|
return
|
|
if ((!( istype(W, /obj/item) ) || W.w_class > 2 || !( w_uniform )))
|
|
return
|
|
u_equip(W)
|
|
r_store = W
|
|
if("suit storage")
|
|
if (s_store)
|
|
if (emptyHand)
|
|
s_store.DblClick()
|
|
return
|
|
var/confirm
|
|
if (wear_suit)
|
|
if(!wear_suit.allowed)
|
|
usr << "You somehow have a suit with no defined allowed items for suit storage, stop that."
|
|
return
|
|
if (istype(W, /obj/item/device/pda) || istype(W, /obj/item/weapon/pen))
|
|
confirm = 1
|
|
if (is_type_in_list(W, wear_suit.allowed))
|
|
confirm = 1
|
|
if (!confirm) return
|
|
else
|
|
u_equip(W)
|
|
s_store = W
|
|
|
|
if("hat storage")
|
|
if (h_store)
|
|
if (emptyHand)
|
|
h_store.DblClick()
|
|
return
|
|
var/confirm
|
|
if (head)
|
|
if (istype(W, /obj/item/weapon/pen))
|
|
confirm = 1
|
|
if (istype(head) && is_type_in_list(W, head.allowed)) // NOTE: head is /obj/item/clothing/head/ and parer hat is not /obj/item/clothing/ and does not have "allowed" --rastaf0
|
|
confirm = 1
|
|
if (!confirm) return
|
|
else
|
|
u_equip(W)
|
|
h_store = W
|
|
|
|
update_clothing()
|
|
|
|
return
|
|
|
|
/mob/living/carbon/human/meteorhit(O as obj)
|
|
for(var/mob/M in viewers(src, null))
|
|
if ((M.client && !( M.blinded )))
|
|
M.show_message(text("\red [] has been hit by []", src, O), 1)
|
|
if (health > 0)
|
|
var/dam_zone = pick("chest", "chest", "chest", "head", "groin")
|
|
if (istype(organs[dam_zone], /datum/organ/external))
|
|
var/datum/organ/external/temp = organs[dam_zone]
|
|
if (istype(O, /obj/effect/immovablerod))
|
|
temp.take_damage(101, 0)
|
|
else
|
|
temp.take_damage((istype(O, /obj/effect/meteor/small) ? 10 : 25), 30)
|
|
UpdateDamageIcon()
|
|
updatehealth()
|
|
return
|
|
|
|
/mob/living/carbon/human/Move(a, b, flag)
|
|
|
|
if (buckled)
|
|
return
|
|
|
|
if (restrained())
|
|
pulling = null
|
|
|
|
|
|
var/t7 = 1
|
|
if (restrained())
|
|
for(var/mob/M in range(src, 1))
|
|
if ((M.pulling == src && M.stat == 0 && !( M.restrained() )))
|
|
t7 = null
|
|
if ((t7 && (pulling && ((get_dist(src, pulling) <= 1 || pulling.loc == loc) && (client && client.moving)))))
|
|
var/turf/T = loc
|
|
. = ..()
|
|
|
|
if (pulling && pulling.loc)
|
|
if(!( isturf(pulling.loc) ))
|
|
pulling = null
|
|
return
|
|
else
|
|
if(Debug)
|
|
diary <<"pulling disappeared? at [__LINE__] in mob.dm - pulling = [pulling]"
|
|
diary <<"REPORT THIS"
|
|
|
|
/////
|
|
if(pulling && pulling.anchored)
|
|
pulling = null
|
|
return
|
|
|
|
if (!restrained())
|
|
var/diag = get_dir(src, pulling)
|
|
if ((diag - 1) & diag)
|
|
else
|
|
diag = null
|
|
if ((get_dist(src, pulling) > 1 || diag))
|
|
if (ismob(pulling))
|
|
var/mob/M = pulling
|
|
var/ok = 1
|
|
if (locate(/obj/item/weapon/grab, M.grabbed_by))
|
|
if (prob(75))
|
|
var/obj/item/weapon/grab/G = pick(M.grabbed_by)
|
|
if (istype(G, /obj/item/weapon/grab))
|
|
for(var/mob/O in viewers(M, null))
|
|
O.show_message(text("\red [] has been pulled from []'s grip by []", G.affecting, G.assailant, src), 1)
|
|
//G = null
|
|
del(G)
|
|
else
|
|
ok = 0
|
|
if (locate(/obj/item/weapon/grab, M.grabbed_by.len))
|
|
ok = 0
|
|
if (ok)
|
|
var/t = M.pulling
|
|
M.pulling = null
|
|
|
|
//this is the gay blood on floor shit -- Added back -- Skie
|
|
if (M.lying && (prob(M.bruteloss / 6)))
|
|
var/turf/location = M.loc
|
|
if (istype(location, /turf/simulated))
|
|
location.add_blood(M)
|
|
|
|
|
|
step(pulling, get_dir(pulling.loc, T))
|
|
M.pulling = t
|
|
else
|
|
if (pulling)
|
|
if (istype(pulling, /obj/structure/window))
|
|
if(pulling:ini_dir == NORTHWEST || pulling:ini_dir == NORTHEAST || pulling:ini_dir == SOUTHWEST || pulling:ini_dir == SOUTHEAST)
|
|
for(var/obj/structure/window/win in get_step(pulling,get_dir(pulling.loc, T)))
|
|
pulling = null
|
|
if (pulling)
|
|
step(pulling, get_dir(pulling.loc, T))
|
|
else
|
|
pulling = null
|
|
. = ..()
|
|
if ((s_active && !( s_active in contents ) ))
|
|
s_active.close(src)
|
|
|
|
for(var/mob/living/carbon/metroid/M in view(1,src))
|
|
M.UpdateFeed(src)
|
|
|
|
return
|
|
|
|
/mob/living/carbon/human/update_clothing()
|
|
..()
|
|
|
|
if (monkeyizing)
|
|
return
|
|
|
|
overlays = null
|
|
|
|
// lol
|
|
var/fat = ""
|
|
if (mutations & FAT)
|
|
fat = "fat"
|
|
|
|
if (mutations & HULK)
|
|
overlays += image("icon" = 'genetics.dmi', "icon_state" = "hulk[fat][!lying ? "_s" : "_l"]")
|
|
|
|
if (mutations & COLD_RESISTANCE)
|
|
overlays += image("icon" = 'genetics.dmi', "icon_state" = "fire[fat][!lying ? "_s" : "_l"]")
|
|
|
|
if (mutations & PORTALS)
|
|
overlays += image("icon" = 'genetics.dmi', "icon_state" = "telekinesishead[fat][!lying ? "_s" : "_l"]")
|
|
|
|
if (mutations & LASER)
|
|
overlays += image("icon" = 'genetics.dmi', "icon_state" = "lasereyes[!lying ? "_s" : "_l"]")
|
|
|
|
if (mutantrace)
|
|
switch(mutantrace)
|
|
if("lizard","golem","metroid")
|
|
overlays += image("icon" = 'genetics.dmi', "icon_state" = "[mutantrace][fat][!lying ? "_s" : "_l"]")
|
|
if(face_standing)
|
|
del(face_standing)
|
|
if(face_lying)
|
|
del(face_lying)
|
|
if(stand_icon)
|
|
del(stand_icon)
|
|
if(lying_icon)
|
|
del(lying_icon)
|
|
if("plant")
|
|
if(stat != 2) //if not dead, that is
|
|
overlays += image("icon" = 'genetics.dmi', "icon_state" = "[mutantrace][fat]_[gender][!lying ? "_s" : "_l"]")
|
|
else
|
|
overlays += image("icon" = 'genetics.dmi', "icon_state" = "[mutantrace]_d")
|
|
if(face_standing)
|
|
del(face_standing)
|
|
if(face_lying)
|
|
del(face_lying)
|
|
if(stand_icon)
|
|
del(stand_icon)
|
|
if(lying_icon)
|
|
del(lying_icon)
|
|
else
|
|
if(!face_standing || !face_lying)
|
|
update_face()
|
|
if(!stand_icon || !lying_icon)
|
|
update_body()
|
|
|
|
if(buckled)
|
|
if(istype(buckled, /obj/structure/stool/bed))
|
|
lying = 1
|
|
else
|
|
lying = 0
|
|
|
|
// Automatically drop anything in store / id / belt if you're not wearing a uniform.
|
|
if (!w_uniform)
|
|
for (var/obj/item/thing in list(r_store, l_store, wear_id, belt))
|
|
if (thing)
|
|
u_equip(thing)
|
|
if (client)
|
|
client.screen -= thing
|
|
|
|
if (thing)
|
|
thing.loc = loc
|
|
thing.dropped(src)
|
|
thing.layer = initial(thing.layer)
|
|
|
|
|
|
//if (zone_sel)
|
|
// zone_sel.overlays = null
|
|
// zone_sel.overlays += body_standing
|
|
// zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", zone_sel.selecting))
|
|
|
|
if (lying)
|
|
icon = lying_icon
|
|
|
|
overlays += body_lying
|
|
|
|
if (face_lying)
|
|
overlays += face_lying
|
|
else
|
|
icon = stand_icon
|
|
|
|
overlays += body_standing
|
|
|
|
if (face_standing)
|
|
overlays += face_standing
|
|
|
|
// Uniform
|
|
if(w_uniform)
|
|
if (mutations & FAT && !(w_uniform.flags & ONESIZEFITSALL))
|
|
src << "\red You burst out of the [w_uniform.name]!"
|
|
var/obj/item/clothing/c = w_uniform
|
|
u_equip(c)
|
|
if(client)
|
|
client.screen -= c
|
|
if(c)
|
|
c:loc = loc
|
|
c:dropped(src)
|
|
c:layer = initial(c:layer)
|
|
if(w_uniform)//I should really not need these
|
|
w_uniform.screen_loc = ui_iclothing
|
|
if(istype(w_uniform, /obj/item/clothing/under))
|
|
var/t1 = w_uniform.color
|
|
if (!t1)
|
|
t1 = icon_state
|
|
if (mutations & FAT)
|
|
overlays += image("icon" = 'uniform_fat.dmi', "icon_state" = "[t1][!lying ? "_s" : "_l"]", "layer" = MOB_LAYER)
|
|
else
|
|
overlays += image("icon" = 'uniform.dmi', "icon_state" = text("[][]",t1, (!(lying) ? "_s" : "_l")), "layer" = MOB_LAYER)
|
|
if (w_uniform.blood_DNA)
|
|
var/icon/stain_icon = icon('blood.dmi', "uniformblood[!lying ? "" : "2"]")
|
|
overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
|
|
|
|
if (wear_id)
|
|
overlays += image("icon" = 'mob.dmi', "icon_state" = "id[!lying ? null : "2"]", "layer" = MOB_LAYER)
|
|
|
|
if (client)
|
|
client.screen -= hud_used.intents
|
|
client.screen -= hud_used.mov_int
|
|
|
|
|
|
//Screenlocs for these slots are handled by the huds other_update()
|
|
//because theyre located on the 'other' inventory bar.
|
|
|
|
// Gloves
|
|
if (gloves)
|
|
var/t1 = gloves.item_state
|
|
if (!t1)
|
|
t1 = gloves.icon_state
|
|
overlays += image("icon" = 'hands.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
|
|
if (gloves.blood_DNA)
|
|
var/icon/stain_icon = icon('blood.dmi', "bloodyhands[!lying ? "" : "2"]")
|
|
overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
|
|
else if (blood_DNA)
|
|
var/icon/stain_icon = icon('blood.dmi', "bloodyhands[!lying ? "" : "2"]")
|
|
overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
|
|
// Glasses
|
|
if (glasses)
|
|
var/t1 = glasses.icon_state
|
|
overlays += image("icon" = 'eyes.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
|
|
// Ears
|
|
if (ears)
|
|
var/t1 = ears.icon_state
|
|
overlays += image("icon" = 'ears.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
|
|
// Shoes
|
|
if (shoes)
|
|
var/t1 = shoes.icon_state
|
|
overlays += image("icon" = 'feet.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
|
|
if (shoes.blood_DNA)
|
|
var/icon/stain_icon = icon('blood.dmi', "shoesblood[!lying ? "" : "2"]")
|
|
overlays += image("icon" = stain_icon, "layer" = MOB_LAYER) // Radio
|
|
/* if (w_radio)
|
|
overlays += image("icon" = 'ears.dmi', "icon_state" = "headset[!lying ? "" : "2"]", "layer" = MOB_LAYER) */
|
|
|
|
if (s_store)
|
|
var/t1 = s_store.item_state
|
|
if (!t1)
|
|
t1 = s_store.icon_state
|
|
overlays += image("icon" = 'belt_mirror.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
|
|
s_store.screen_loc = ui_sstore1
|
|
|
|
if (h_store)
|
|
h_store.screen_loc = ui_hstore1
|
|
|
|
if(client) hud_used.other_update() //Update the screenloc of the items on the 'other' inventory bar
|
|
//to hide / show them.
|
|
|
|
if (wear_mask)
|
|
if (istype(wear_mask, /obj/item/clothing/mask))
|
|
var/t1 = wear_mask.icon_state
|
|
overlays += image("icon" = 'mask.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
|
|
if (!istype(wear_mask, /obj/item/clothing/mask/cigarette))
|
|
if (wear_mask.blood_DNA)
|
|
var/icon/stain_icon = icon('blood.dmi', "maskblood[!lying ? "" : "2"]")
|
|
overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
|
|
wear_mask.screen_loc = ui_mask
|
|
|
|
|
|
if (client)
|
|
if (i_select)
|
|
if (intent)
|
|
client.screen += hud_used.intents
|
|
|
|
var/list/L = dd_text2list(intent, ",")
|
|
L[1] += ":-11"
|
|
i_select.screen_loc = dd_list2text(L,",") //ICONS4, FUCKING SHIT
|
|
else
|
|
i_select.screen_loc = null
|
|
if (m_select)
|
|
if (m_int)
|
|
client.screen += hud_used.mov_int
|
|
|
|
var/list/L = dd_text2list(m_int, ",")
|
|
L[1] += ":-11"
|
|
m_select.screen_loc = dd_list2text(L,",") //ICONS4, FUCKING SHIT
|
|
else
|
|
m_select.screen_loc = null
|
|
|
|
|
|
if (wear_suit)
|
|
if (mutations & FAT && !(wear_suit.flags & ONESIZEFITSALL))
|
|
src << "\red You burst out of the [wear_suit.name]!"
|
|
var/obj/item/clothing/c = wear_suit
|
|
u_equip(c)
|
|
if(client)
|
|
client.screen -= c
|
|
if(c)
|
|
c:loc = loc
|
|
c:dropped(src)
|
|
c:layer = initial(c:layer)
|
|
if (istype(wear_suit, /obj/item/clothing/suit))
|
|
var/t1 = wear_suit.icon_state
|
|
overlays += image("icon" = 'suit.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
|
|
if (wear_suit)
|
|
if (wear_suit.blood_DNA)
|
|
var/icon/stain_icon = null
|
|
if (istype(wear_suit, /obj/item/clothing/suit/armor/vest || /obj/item/clothing/suit/wcoat))
|
|
stain_icon = icon('blood.dmi', "armorblood[!lying ? "" : "2"]")
|
|
else if (istype(wear_suit, /obj/item/clothing/suit/det_suit || /obj/item/clothing/suit/labcoat))
|
|
stain_icon = icon('blood.dmi', "coatblood[!lying ? "" : "2"]")
|
|
else
|
|
stain_icon = icon('blood.dmi', "suitblood[!lying ? "" : "2"]")
|
|
overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
|
|
wear_suit.screen_loc = ui_oclothing
|
|
if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
|
|
if (handcuffed)
|
|
handcuffed.loc = loc
|
|
handcuffed.layer = initial(handcuffed.layer)
|
|
handcuffed = null
|
|
if ((l_hand || r_hand))
|
|
var/h = hand
|
|
hand = 1
|
|
drop_item()
|
|
hand = 0
|
|
drop_item()
|
|
hand = h
|
|
|
|
// Head
|
|
if (head)
|
|
var/t1 = head.icon_state
|
|
var/icon/head_icon = icon('head.dmi', text("[][]", t1, (!( lying ) ? null : "2")))
|
|
if(istype(head,/obj/item/clothing/head/kitty))
|
|
head_icon = (( lying ) ? head:mob2 : head:mob)
|
|
overlays += image("icon" = head_icon, "layer" = MOB_LAYER)
|
|
if (head.blood_DNA)
|
|
var/icon/stain_icon = icon('blood.dmi', "helmetblood[!lying ? "" : "2"]")
|
|
overlays += image("icon" = stain_icon, "layer" = MOB_LAYER)
|
|
head.screen_loc = ui_head
|
|
|
|
// Belt
|
|
if (belt)
|
|
var/t1 = belt.item_state
|
|
if (!t1)
|
|
t1 = belt.icon_state
|
|
overlays += image("icon" = 'belt.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
|
|
belt.screen_loc = ui_belt
|
|
|
|
if ((wear_mask && !(wear_mask.see_face)) || (head && !(head.see_face))) // can't see the face
|
|
if (wear_id)
|
|
if (istype(wear_id, /obj/item/weapon/card/id))
|
|
var/obj/item/weapon/card/id/id = wear_id
|
|
if (id.registered)
|
|
name = id.registered
|
|
else
|
|
name = "Unknown"
|
|
else if (istype(wear_id, /obj/item/device/pda))
|
|
var/obj/item/device/pda/pda = wear_id
|
|
if (pda.owner)
|
|
name = pda.owner
|
|
else
|
|
name = "Unknown"
|
|
else
|
|
name = "Unknown"
|
|
else
|
|
if (wear_id)
|
|
if (istype(wear_id, /obj/item/weapon/card/id))
|
|
var/obj/item/weapon/card/id/id = wear_id
|
|
if (id.registered != real_name)
|
|
name = "[real_name] (as [id.registered])"
|
|
|
|
|
|
else if (istype(wear_id, /obj/item/device/pda))
|
|
var/obj/item/device/pda/pda = wear_id
|
|
if (pda.owner)
|
|
if (pda.owner != real_name)
|
|
name = "[real_name] (as [pda.owner])"
|
|
else
|
|
name = real_name
|
|
|
|
if (wear_id)
|
|
wear_id.screen_loc = ui_id
|
|
|
|
if (l_store)
|
|
l_store.screen_loc = ui_storage1
|
|
|
|
if (r_store)
|
|
r_store.screen_loc = ui_storage2
|
|
|
|
if (back)
|
|
var/t1 = back.icon_state
|
|
overlays += image("icon" = 'back.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = MOB_LAYER)
|
|
back.screen_loc = ui_back
|
|
|
|
if (handcuffed)
|
|
pulling = null
|
|
if (!lying)
|
|
overlays += image("icon" = 'mob.dmi', "icon_state" = "handcuff1", "layer" = MOB_LAYER)
|
|
else
|
|
overlays += image("icon" = 'mob.dmi', "icon_state" = "handcuff2", "layer" = MOB_LAYER)
|
|
|
|
if (client)
|
|
client.screen -= contents
|
|
client.screen += contents
|
|
|
|
if (r_hand)
|
|
overlays += image("icon" = 'items_righthand.dmi', "icon_state" = r_hand.item_state ? r_hand.item_state : r_hand.icon_state, "layer" = MOB_LAYER+1)
|
|
|
|
r_hand.screen_loc = ui_rhand
|
|
|
|
if (l_hand)
|
|
overlays += image("icon" = 'items_lefthand.dmi', "icon_state" = l_hand.item_state ? l_hand.item_state : l_hand.icon_state, "layer" = MOB_LAYER+1)
|
|
|
|
l_hand.screen_loc = ui_lhand
|
|
|
|
var/shielded = 0
|
|
for (var/obj/item/weapon/cloaking_device/S in src)
|
|
if (S.active)
|
|
shielded = 2
|
|
break
|
|
|
|
if(istype(wear_suit, /obj/item/clothing/suit/space/space_ninja)&&wear_suit:s_active)
|
|
shielded = 3
|
|
|
|
switch(shielded)
|
|
if(1)
|
|
overlays += image("icon" = 'effects.dmi', "icon_state" = "shield", "layer" = MOB_LAYER+1)
|
|
if(2)
|
|
invisibility = 2
|
|
//New stealth. Hopefully doesn't lag too much. /N
|
|
if(istype(loc, /turf))//If they are standing on a turf.
|
|
AddCamoOverlay(loc)//Overlay camo.
|
|
if(3)
|
|
if(istype(loc, /turf))
|
|
//Ninjas may flick into view once in a while if they are stealthed.
|
|
if(prob(90))
|
|
NinjaStealthActive(loc)
|
|
else
|
|
NinjaStealthMalf()
|
|
else
|
|
invisibility = 0
|
|
/*
|
|
for (var/mob/M in viewers(1, src))//For the love of god DO NOT REFRESH EVERY SECOND - Mport
|
|
if ((M.client && M.machine == src))
|
|
spawn (0)
|
|
show_inv(M)
|
|
return
|
|
*/
|
|
last_b_state = stat
|
|
|
|
/mob/living/carbon/human/hand_p(mob/M as mob)//update needed
|
|
if (M.a_intent == "hurt")
|
|
if (istype(M.wear_mask, /obj/item/clothing/mask/muzzle))
|
|
return
|
|
if (health > 0)
|
|
if (istype(wear_suit, /obj/item/clothing/suit/space))
|
|
if (prob(25))
|
|
for(var/mob/O in viewers(src, null))
|
|
O.show_message(text("\red <B>[M.name] has attempted to bite []!</B>", src), 1)
|
|
return
|
|
else if (istype(wear_suit, /obj/item/clothing/suit/space/santa))
|
|
if (prob(25))
|
|
for(var/mob/O in viewers(src, null))
|
|
O.show_message(text("\red <B>[M.name] has attempted to bite []!</B>", src), 1)
|
|
return
|
|
else if (istype(wear_suit, /obj/item/clothing/suit/bio_suit))
|
|
if (prob(25))
|
|
for(var/mob/O in viewers(src, null))
|
|
O.show_message(text("\red <B>[M.name] has attempted to bite []!</B>", src), 1)
|
|
return
|
|
else if (istype(wear_suit, /obj/item/clothing/suit/armor))
|
|
if (prob(25))
|
|
for(var/mob/O in viewers(src, null))
|
|
O.show_message(text("\red <B>[M.name] has attempted to bite []!</B>", src), 1)
|
|
return
|
|
else
|
|
for(var/mob/O in viewers(src, null))
|
|
if ((O.client && !( O.blinded )))
|
|
O.show_message(text("\red <B>[M.name] has bit []!</B>", src), 1)
|
|
var/damage = rand(1, 3)
|
|
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg", "groin")
|
|
if (istype(organs[text("[]", dam_zone)], /datum/organ/external))
|
|
var/datum/organ/external/temp = organs[text("[]", dam_zone)]
|
|
if (temp.take_damage(damage, 0))
|
|
UpdateDamageIcon()
|
|
else
|
|
UpdateDamage()
|
|
updatehealth()
|
|
|
|
for(var/datum/disease/D in M.viruses)
|
|
if(istype(D, /datum/disease/jungle_fever))
|
|
var/mob/living/carbon/human/H = src
|
|
src = null
|
|
src = H.monkeyize()
|
|
contract_disease(D,1,0)
|
|
return
|
|
|
|
|
|
|
|
|
|
/mob/living/carbon/human/attack_metroid(mob/living/carbon/metroid/M as mob)
|
|
if(M.Victim) return // can't attack while eating!
|
|
|
|
if (health > -100)
|
|
|
|
for(var/mob/O in viewers(src, null))
|
|
if ((O.client && !( O.blinded )))
|
|
O.show_message(text("\red <B>The [M.name] has [pick("bit","slashed")] []!</B>", src), 1)
|
|
|
|
var/damage = rand(1, 3)
|
|
|
|
if(istype(M, /mob/living/carbon/metroid/adult))
|
|
damage = rand(10, 35)
|
|
else
|
|
damage = rand(5, 25)
|
|
|
|
|
|
var/dam_zone = pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg", "groin")
|
|
|
|
var/datum/organ/external/affecting = get_organ(ran_zone(dam_zone))
|
|
var/armor_block = run_armor_check(affecting, "melee")
|
|
apply_damage(damage, CLONE, affecting, armor_block)
|
|
UpdateDamageIcon()
|
|
|
|
|
|
if(M.powerlevel > 0)
|
|
var/stunprob = 10
|
|
var/power = M.powerlevel + rand(0,3)
|
|
|
|
switch(M.powerlevel)
|
|
if(1 to 2) stunprob = 20
|
|
if(3 to 4) stunprob = 30
|
|
if(5 to 6) stunprob = 40
|
|
if(7 to 8) stunprob = 60
|
|
if(9) stunprob = 70
|
|
if(10) stunprob = 95
|
|
|
|
if(prob(stunprob))
|
|
M.powerlevel -= 3
|
|
if(M.powerlevel < 0)
|
|
M.powerlevel = 0
|
|
|
|
for(var/mob/O in viewers(src, null))
|
|
if ((O.client && !( O.blinded )))
|
|
O.show_message(text("\red <B>The [M.name] has shocked []!</B>", src), 1)
|
|
|
|
if (weakened < power)
|
|
weakened = power
|
|
if (stuttering < power)
|
|
stuttering = power
|
|
if (stunned < power)
|
|
stunned = power
|
|
|
|
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
|
|
s.set_up(5, 1, src)
|
|
s.start()
|
|
|
|
if (prob(stunprob) && M.powerlevel >= 8)
|
|
fireloss += M.powerlevel * rand(6,10)
|
|
|
|
|
|
updatehealth()
|
|
|
|
return
|
|
|
|
|
|
/mob/living/carbon/human/restrained()
|
|
if (handcuffed)
|
|
return 1
|
|
if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
|
|
return 1
|
|
return 0
|
|
|
|
/mob/living/carbon/human/proc/update_body()
|
|
if(stand_icon)
|
|
del(stand_icon)
|
|
if(lying_icon)
|
|
del(lying_icon)
|
|
|
|
if (mutantrace)
|
|
return
|
|
|
|
var/g = "m"
|
|
if (gender == MALE)
|
|
g = "m"
|
|
else if (gender == FEMALE)
|
|
g = "f"
|
|
|
|
stand_icon = new /icon('human.dmi', "blank")
|
|
lying_icon = new /icon('human.dmi', "blank")
|
|
|
|
var/husk = (mutations & HUSK)
|
|
var/obese = (mutations & FAT)
|
|
|
|
if (husk)
|
|
stand_icon.Blend(new /icon('human.dmi', "husk_s"), ICON_OVERLAY)
|
|
lying_icon.Blend(new /icon('human.dmi', "husk_l"), ICON_OVERLAY)
|
|
else if(obese)
|
|
stand_icon.Blend(new /icon('human.dmi', "fatbody_s"), ICON_OVERLAY)
|
|
lying_icon.Blend(new /icon('human.dmi', "fatbody_l"), ICON_OVERLAY)
|
|
else
|
|
stand_icon.Blend(new /icon('human.dmi', "chest_[g]_s"), ICON_OVERLAY)
|
|
lying_icon.Blend(new /icon('human.dmi', "chest_[g]_l"), ICON_OVERLAY)
|
|
|
|
for (var/part in list("head", "arm_left", "arm_right", "hand_left", "hand_right", "leg_left", "leg_right", "foot_left", "foot_right"))
|
|
stand_icon.Blend(new /icon('human.dmi', "[part]_s"), ICON_OVERLAY)
|
|
lying_icon.Blend(new /icon('human.dmi', "[part]_l"), ICON_OVERLAY)
|
|
|
|
stand_icon.Blend(new /icon('human.dmi', "groin_[g]_s"), ICON_OVERLAY)
|
|
lying_icon.Blend(new /icon('human.dmi', "groin_[g]_l"), ICON_OVERLAY)
|
|
|
|
// Skin tone
|
|
if (s_tone >= 0)
|
|
stand_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
|
|
lying_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
|
|
else
|
|
stand_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
|
|
lying_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
|
|
|
|
if (underwear > 0)
|
|
if(!obese)
|
|
stand_icon.Blend(new /icon('human.dmi', "underwear[underwear]_[g]_s"), ICON_OVERLAY)
|
|
lying_icon.Blend(new /icon('human.dmi', "underwear[underwear]_[g]_l"), ICON_OVERLAY)
|
|
|
|
/mob/living/carbon/human/proc/update_face()
|
|
del(face_standing)
|
|
del(face_lying)
|
|
|
|
if (mutantrace)
|
|
return
|
|
|
|
var/g = "m"
|
|
if (gender == MALE)
|
|
g = "m"
|
|
else if (gender == FEMALE)
|
|
g = "f"
|
|
|
|
var/icon/eyes_s = new/icon("icon" = 'human_face.dmi', "icon_state" = "eyes_s")
|
|
var/icon/eyes_l = new/icon("icon" = 'human_face.dmi', "icon_state" = "eyes_l")
|
|
eyes_s.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
|
|
eyes_l.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
|
|
|
|
var/icon/hair_s = new/icon("icon" = 'human_face.dmi', "icon_state" = "[hair_icon_state]_s")
|
|
var/icon/hair_l = new/icon("icon" = 'human_face.dmi', "icon_state" = "[hair_icon_state]_l")
|
|
hair_s.Blend(rgb(r_hair, g_hair, b_hair), ICON_ADD)
|
|
hair_l.Blend(rgb(r_hair, g_hair, b_hair), ICON_ADD)
|
|
|
|
var/icon/facial_s = new/icon("icon" = 'human_face.dmi', "icon_state" = "[face_icon_state]_s")
|
|
var/icon/facial_l = new/icon("icon" = 'human_face.dmi', "icon_state" = "[face_icon_state]_l")
|
|
facial_s.Blend(rgb(r_facial, g_facial, b_facial), ICON_ADD)
|
|
facial_l.Blend(rgb(r_facial, g_facial, b_facial), ICON_ADD)
|
|
|
|
var/icon/mouth_s = new/icon("icon" = 'human_face.dmi', "icon_state" = "mouth_[g]_s")
|
|
var/icon/mouth_l = new/icon("icon" = 'human_face.dmi', "icon_state" = "mouth_[g]_l")
|
|
|
|
eyes_s.Blend(hair_s, ICON_OVERLAY)
|
|
eyes_l.Blend(hair_l, ICON_OVERLAY)
|
|
eyes_s.Blend(mouth_s, ICON_OVERLAY)
|
|
eyes_l.Blend(mouth_l, ICON_OVERLAY)
|
|
eyes_s.Blend(facial_s, ICON_OVERLAY)
|
|
eyes_l.Blend(facial_l, ICON_OVERLAY)
|
|
|
|
face_standing = new /image()
|
|
face_lying = new /image()
|
|
face_standing.icon = eyes_s
|
|
face_lying.icon = eyes_l
|
|
|
|
del(mouth_l)
|
|
del(mouth_s)
|
|
del(facial_l)
|
|
del(facial_s)
|
|
del(hair_l)
|
|
del(hair_s)
|
|
del(eyes_l)
|
|
del(eyes_s)
|
|
|
|
/mob/living/carbon/human/var/co2overloadtime = null
|
|
/mob/living/carbon/human/var/temperature_resistance = T0C+75
|
|
|
|
/obj/effect/equip_e/human/process()
|
|
if (item)
|
|
item.add_fingerprint(source)
|
|
if (!item)
|
|
switch(place)
|
|
if("mask")
|
|
if (!( target.wear_mask ))
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
/* if("headset")
|
|
if (!( target.w_radio ))
|
|
//SN src = null
|
|
del(src)
|
|
return */
|
|
if("l_hand")
|
|
if (!( target.l_hand ))
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if("r_hand")
|
|
if (!( target.r_hand ))
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if("suit")
|
|
if (!( target.wear_suit ))
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if("uniform")
|
|
if (!( target.w_uniform ))
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if("back")
|
|
if (!( target.back ))
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if("syringe")
|
|
return
|
|
if("pill")
|
|
return
|
|
if("fuel")
|
|
return
|
|
if("drink")
|
|
return
|
|
if("dnainjector")
|
|
return
|
|
if("handcuff")
|
|
if (!( target.handcuffed ))
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if("id")
|
|
if ((!( target.wear_id ) || !( target.w_uniform )))
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if("internal")
|
|
if ((!( (istype(target.wear_mask, /obj/item/clothing/mask) && istype(target.back, /obj/item/weapon/tank) && !( target.internal )) ) && !( target.internal )))
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
|
|
var/list/L = list( "syringe", "pill", "drink", "dnainjector", "fuel")
|
|
if ((item && !( L.Find(place) )))
|
|
if(isrobot(source) && place != "handcuff")
|
|
del(src)
|
|
return
|
|
for(var/mob/O in viewers(target, null))
|
|
O.show_message(text("\red <B>[] is trying to put \a [] on []</B>", source, item, target), 1)
|
|
else
|
|
if (place == "syringe")
|
|
for(var/mob/O in viewers(target, null))
|
|
O.show_message(text("\red <B>[] is trying to inject []!</B>", source, target), 1)
|
|
else
|
|
if (place == "pill")
|
|
for(var/mob/O in viewers(target, null))
|
|
O.show_message(text("\red <B>[] is trying to force [] to swallow []!</B>", source, target, item), 1)
|
|
else
|
|
if(place == "fuel")
|
|
for(var/mob/O in viewers(target, null))
|
|
O.show_message(text("\red [source] is trying to force [target] to eat the [item:content]!"), 1)
|
|
else
|
|
if (place == "drink")
|
|
for(var/mob/O in viewers(target, null))
|
|
O.show_message(text("\red <B>[] is trying to force [] to swallow a gulp of []!</B>", source, target, item), 1)
|
|
else
|
|
if (place == "dnainjector")
|
|
for(var/mob/O in viewers(target, null))
|
|
O.show_message(text("\red <B>[] is trying to inject [] with the []!</B>", source, target, item), 1)
|
|
else
|
|
var/message = null
|
|
switch(place)
|
|
if("mask")
|
|
if(istype(target.wear_mask, /obj/item/clothing)&&!target.wear_mask:canremove)
|
|
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.wear_mask, target)
|
|
else
|
|
message = text("\red <B>[] is trying to take off \a [] from []'s head!</B>", source, target.wear_mask, target)
|
|
/* if("headset")
|
|
message = text("\red <B>[] is trying to take off \a [] from []'s face!</B>", source, target.w_radio, target) */
|
|
if("l_hand")
|
|
message = text("\red <B>[] is trying to take off \a [] from []'s left hand!</B>", source, target.l_hand, target)
|
|
if("r_hand")
|
|
message = text("\red <B>[] is trying to take off \a [] from []'s right hand!</B>", source, target.r_hand, target)
|
|
if("gloves")
|
|
if(istype(target.gloves, /obj/item/clothing)&&!target.gloves:canremove)
|
|
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.gloves, target)
|
|
else
|
|
message = text("\red <B>[] is trying to take off the [] from []'s hands!</B>", source, target.gloves, target)
|
|
if("eyes")
|
|
if(istype(target.glasses, /obj/item/clothing)&&!target.glasses:canremove)
|
|
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.glasses, target)
|
|
else
|
|
message = text("\red <B>[] is trying to take off the [] from []'s eyes!</B>", source, target.glasses, target)
|
|
if("ears")
|
|
if(istype(target.ears, /obj/item/clothing)&&!target.ears:canremove)
|
|
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.ears, target)
|
|
else
|
|
message = text("\red <B>[] is trying to take off the [] from []'s ears!</B>", source, target.ears, target)
|
|
if("head")
|
|
if(istype(target.head, /obj/item/clothing)&&!target.head:canremove)
|
|
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.head, target)
|
|
else
|
|
message = text("\red <B>[] is trying to take off the [] from []'s head!</B>", source, target.head, target)
|
|
if("shoes")
|
|
if(istype(target.shoes, /obj/item/clothing)&&!target.shoes:canremove)
|
|
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.shoes, target)
|
|
else
|
|
message = text("\red <B>[] is trying to take off the [] from []'s feet!</B>", source, target.shoes, target)
|
|
if("belt")
|
|
message = text("\red <B>[] is trying to take off the [] from []'s belt!</B>", source, target.belt, target)
|
|
if("suit")
|
|
if(istype(target.wear_suit, /obj/item/clothing)&&!target.wear_suit:canremove)
|
|
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.wear_suit, target)
|
|
else
|
|
message = text("\red <B>[] is trying to take off \a [] from []'s body!</B>", source, target.wear_suit, target)
|
|
if("back")
|
|
message = text("\red <B>[] is trying to take off \a [] from []'s back!</B>", source, target.back, target)
|
|
if("handcuff")
|
|
message = text("\red <B>[] is trying to unhandcuff []!</B>", source, target)
|
|
if("uniform")
|
|
if(istype(target.w_uniform, /obj/item/clothing)&&!target.w_uniform:canremove)
|
|
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.w_uniform, target)
|
|
else
|
|
message = text("\red <B>[] is trying to take off \a [] from []'s body!</B>", source, target.w_uniform, target)
|
|
if("s_store")
|
|
message = text("\red <B>[] is trying to take off \a [] from []'s suit!</B>", source, target.s_store, target)
|
|
if("h_store")
|
|
message = text("\red <B>[] is trying to empty []'s hat!</B>", source, target)
|
|
if("pockets")
|
|
for(var/obj/item/weapon/mousetrap/MT in list(target.l_store, target.r_store))
|
|
if(MT.armed)
|
|
for(var/mob/O in viewers(target, null))
|
|
if(O == source)
|
|
O.show_message(text("\red <B>You reach into the [target]'s pockets, but there was a live mousetrap in there!</B>"), 1)
|
|
else
|
|
O.show_message(text("\red <B>[source] reaches into [target]'s pockets and sets off a hidden mousetrap!</B>"), 1)
|
|
target.u_equip(MT)
|
|
if (target.client)
|
|
target.client.screen -= MT
|
|
MT.loc = source.loc
|
|
MT.triggered(source, source.hand ? "l_hand" : "r_hand")
|
|
MT.layer = OBJ_LAYER
|
|
return
|
|
message = text("\red <B>[] is trying to empty []'s pockets!!</B>", source, target)
|
|
if("CPR")
|
|
if (target.cpr_time >= world.time + 3)
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
message = text("\red <B>[] is trying perform CPR on []!</B>", source, target)
|
|
if("id")
|
|
message = text("\red <B>[] is trying to take off [] from []'s uniform!</B>", source, target.wear_id, target)
|
|
if("internal")
|
|
if (target.internal)
|
|
message = text("\red <B>[] is trying to remove []'s internals</B>", source, target)
|
|
else
|
|
message = text("\red <B>[] is trying to set on []'s internals.</B>", source, target)
|
|
else
|
|
for(var/mob/M in viewers(target, null))
|
|
M.show_message(message, 1)
|
|
spawn( 40 )
|
|
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.
|
|
!canremove 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()
|
|
if(!source || !target) return
|
|
if(source.loc != s_loc) return
|
|
if(target.loc != t_loc) return
|
|
if(LinkBlocked(s_loc,t_loc)) return
|
|
if(item && source.equipped() != item) return
|
|
if ((source.restrained() || source.stat)) return
|
|
switch(place)
|
|
if("mask")
|
|
if (target.wear_mask)
|
|
if(istype(target.wear_mask, /obj/item/clothing)&& !target.wear_mask:canremove)
|
|
return
|
|
var/obj/item/clothing/W = target.wear_mask
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if (istype(item, /obj/item/clothing/mask))
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.wear_mask = item
|
|
item.loc = target
|
|
/* if("headset")
|
|
if (target.w_radio)
|
|
var/obj/item/W = target.w_radio
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
else
|
|
if (istype(item, /obj/item/device/radio/headset))
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.w_radio = item
|
|
item.loc = target*/
|
|
if("gloves")
|
|
if (target.gloves)
|
|
if(istype(target.gloves, /obj/item/clothing)&& !target.gloves:canremove)
|
|
return
|
|
var/obj/item/clothing/W = target.gloves
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if (istype(item, /obj/item/clothing/gloves))
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.gloves = item
|
|
item.loc = target
|
|
if("eyes")
|
|
if (target.glasses)
|
|
if(istype(target.glasses, /obj/item/clothing)&& !target.glasses:canremove)
|
|
return
|
|
var/obj/item/W = target.glasses
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if (istype(item, /obj/item/clothing/glasses))
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.glasses = item
|
|
item.loc = target
|
|
if("belt")
|
|
if (target.belt)
|
|
var/obj/item/W = target.belt
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if ((istype(item, /obj) && item.flags & 128 && target.w_uniform))
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.belt = item
|
|
item.loc = target
|
|
if("s_store")
|
|
if (target.s_store)
|
|
var/obj/item/W = target.s_store
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if (istype(item, /obj) && target.wear_suit)
|
|
var/confirm
|
|
for(var/i=1, i<=target.wear_suit.allowed.len, i++)
|
|
// world << "[target.wear_suit.allowed[i]] and [W.type]"
|
|
if (findtext("[item.type]","[target.wear_suit.allowed[i]]") || istype(item, /obj/item/device/pda) || istype(item, /obj/item/weapon/pen))
|
|
confirm = 1
|
|
break
|
|
if (!confirm) return
|
|
else
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.s_store = item
|
|
item.loc = target
|
|
if("head")
|
|
if (target.head)
|
|
if(istype(target.head, /obj/item/clothing)&& !target.head:canremove)
|
|
return
|
|
var/obj/item/W = target.head
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if (istype(item, /obj/item/clothing/head))
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.head = item
|
|
item.loc = target
|
|
if("ears")
|
|
if (target.ears)
|
|
if(istype(target.ears, /obj/item/clothing)&& !target.ears:canremove)
|
|
return
|
|
var/obj/item/W = target.ears
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if (istype(item, /obj/item/clothing/ears))
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.ears = item
|
|
item.loc = target
|
|
else if (istype(item, /obj/item/device/radio/headset))
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.ears = item
|
|
item.loc = target
|
|
if("shoes")
|
|
if (target.shoes)
|
|
if(istype(target.shoes, /obj/item/clothing)&& !target.shoes:canremove)
|
|
return
|
|
var/obj/item/W = target.shoes
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if (istype(item, /obj/item/clothing/shoes))
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.shoes = item
|
|
item.loc = target
|
|
if("l_hand")
|
|
if (istype(target, /obj/item/clothing/suit/straight_jacket))
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if (target.l_hand)
|
|
var/obj/item/W = target.l_hand
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if(istype(item, /obj/item))
|
|
source.drop_item()
|
|
if(item)
|
|
loc = target
|
|
item.layer = 20
|
|
target.l_hand = item
|
|
item.loc = target
|
|
item.add_fingerprint(target)
|
|
if("r_hand")
|
|
if (istype(target, /obj/item/clothing/suit/straight_jacket))
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if (target.r_hand)
|
|
var/obj/item/W = target.r_hand
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if (istype(item, /obj/item))
|
|
source.drop_item()
|
|
loc = target
|
|
if (item)
|
|
item.layer = 20
|
|
target.r_hand = item
|
|
item.loc = target
|
|
item.add_fingerprint(target)
|
|
if("uniform")
|
|
if (target.w_uniform)
|
|
if(istype(target.w_uniform, /obj/item/clothing)&& !target.w_uniform:canremove)
|
|
return
|
|
var/obj/item/W = target.w_uniform
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
W = target.l_store
|
|
if (W)
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W = target.r_store
|
|
if (W)
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W = target.wear_id
|
|
if (W)
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
else
|
|
if (istype(item, /obj/item/clothing/under))
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.w_uniform = item
|
|
item.loc = target
|
|
if("suit")
|
|
if(target.wear_suit)
|
|
var/obj/item/W = target.wear_suit
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if (istype(item, /obj/item/clothing/suit))
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.wear_suit = item
|
|
item.loc = target
|
|
if("id")
|
|
if (target.wear_id)
|
|
var/obj/item/W = target.wear_id
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if (((istype(item, /obj/item/weapon/card/id)||istype(item, /obj/item/device/pda)) && target.w_uniform))
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.wear_id = item
|
|
item.loc = target
|
|
if("back")
|
|
if (target.back)
|
|
var/obj/item/W = target.back
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if ((istype(item, /obj/item) && item.flags & 1))
|
|
source.drop_item()
|
|
loc = target
|
|
item.layer = 20
|
|
target.back = item
|
|
item.loc = target
|
|
if("h_store")
|
|
if (target.h_store)
|
|
var/obj/item/W = target.h_store
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
if("handcuff")
|
|
if (target.handcuffed)
|
|
var/obj/item/W = target.handcuffed
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
else
|
|
if (istype(item, /obj/item/weapon/handcuffs))
|
|
target.drop_from_slot(target.r_hand)
|
|
target.drop_from_slot(target.l_hand)
|
|
source.drop_item()
|
|
target.handcuffed = item
|
|
item.loc = target
|
|
if("CPR")
|
|
if (target.cpr_time >= world.time + 30)
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if ((target.health >= -99.0 && target.health < 0))
|
|
target.cpr_time = world.time
|
|
var/suff = min(target.oxyloss, 7)
|
|
target.oxyloss -= suff
|
|
target.updatehealth()
|
|
for(var/mob/O in viewers(source, null))
|
|
O.show_message(text("\red [] performs CPR on []!", source, target), 1)
|
|
target << "\blue <b>You feel a breath of fresh air enter your lungs. It feels good.</b>"
|
|
source << "\red Repeat every 7 seconds AT LEAST."
|
|
if("fuel")
|
|
var/obj/item/weapon/fuel/S = item
|
|
if (!( istype(S, /obj/item/weapon/fuel) ))
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if (S.s_time >= world.time + 30)
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
S.s_time = world.time
|
|
var/a = S.content
|
|
for(var/mob/O in viewers(source, null))
|
|
O.show_message(text("\red [source] forced [target] to eat the [a]!"), 1)
|
|
S.injest(target)
|
|
if("dnainjector")
|
|
var/obj/item/weapon/dnainjector/S = item
|
|
if(item)
|
|
item.add_fingerprint(source)
|
|
item:inject(target, null)
|
|
if (!( istype(S, /obj/item/weapon/dnainjector) ))
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
if (S.s_time >= world.time + 30)
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
S.s_time = world.time
|
|
for(var/mob/O in viewers(source, null))
|
|
O.show_message(text("\red [] injects [] with the DNA Injector!", source, target), 1)
|
|
if("pockets")
|
|
if (target.l_store)
|
|
var/obj/item/W = target.l_store
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
if (target.r_store)
|
|
var/obj/item/W = target.r_store
|
|
target.u_equip(W)
|
|
if (target.client)
|
|
target.client.screen -= W
|
|
if (W)
|
|
W.loc = target.loc
|
|
W.dropped(target)
|
|
W.layer = initial(W.layer)
|
|
W.add_fingerprint(source)
|
|
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(text("[] is now running on internals.", target), 1)
|
|
target.internal.add_fingerprint(source)
|
|
if (target.internals)
|
|
target.internals.icon_state = "internal1"
|
|
else
|
|
if(source)
|
|
source.update_clothing()
|
|
if(target)
|
|
target.update_clothing()
|
|
//SN src = null
|
|
del(src)
|
|
return
|
|
|
|
/mob/living/carbon/human/show_inv(mob/user as mob)
|
|
|
|
user.machine = src
|
|
var/dat = {"
|
|
<B><HR><FONT size=3>[name]</FONT></B>
|
|
<BR><HR>
|
|
<BR><B>Head(Mask):</B> <A href='?src=\ref[src];item=mask'>[(wear_mask ? wear_mask : "Nothing")]</A>
|
|
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=l_hand'>[(l_hand ? l_hand : "Nothing")]</A>
|
|
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=r_hand'>[(r_hand ? r_hand : "Nothing")]</A>
|
|
<BR><B>Gloves:</B> <A href='?src=\ref[src];item=gloves'>[(gloves ? gloves : "Nothing")]</A>
|
|
<BR><B>Eyes:</B> <A href='?src=\ref[src];item=eyes'>[(glasses ? glasses : "Nothing")]</A>
|
|
<BR><B>Ears:</B> <A href='?src=\ref[src];item=ears'>[(ears ? ears : "Nothing")]</A>
|
|
<BR><B>Head:</B> <A href='?src=\ref[src];item=head'>[(head ? head : "Nothing")]</A>
|
|
<BR><B>Shoes:</B> <A href='?src=\ref[src];item=shoes'>[(shoes ? shoes : "Nothing")]</A>
|
|
<BR><B>Belt:</B> <A href='?src=\ref[src];item=belt'>[(belt ? belt : "Nothing")]</A>
|
|
<BR><B>Uniform:</B> <A href='?src=\ref[src];item=uniform'>[(w_uniform ? w_uniform : "Nothing")]</A>
|
|
<BR><B>(Exo)Suit:</B> <A href='?src=\ref[src];item=suit'>[(wear_suit ? wear_suit : "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><B>ID:</B> <A href='?src=\ref[src];item=id'>[(wear_id ? wear_id : "Nothing")]</A>
|
|
<BR><B>Suit Storage:</B> <A href='?src=\ref[src];item=s_store'>[(s_store ? s_store : "Nothing")]</A>
|
|
<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[src];item=h_store'>Empty Hat</A>
|
|
<BR><A href='?src=\ref[user];refresh=1'>Refresh</A>
|
|
<BR><A href='?src=\ref[user];mach_close=mob[name]'>Close</A>
|
|
<BR>"}
|
|
user << browse(dat, text("window=mob[name];size=340x480"))
|
|
onclose(user, "mob[name]")
|
|
return
|
|
|
|
// called when something steps onto a human
|
|
// this could be made more general, but for now just handle mulebot
|
|
/mob/living/carbon/human/HasEntered(var/atom/movable/AM)
|
|
var/obj/machinery/bot/mulebot/MB = AM
|
|
if(istype(MB))
|
|
MB.RunOver(src)
|
|
|
|
//gets assignment from ID or ID inside PDA or PDA itself
|
|
//Useful when player do something with computers
|
|
/mob/living/carbon/human/proc/get_assignment(var/if_no_id = "No id", var/if_no_job = "No job")
|
|
var/obj/item/device/pda/pda = wear_id
|
|
var/obj/item/weapon/card/id/id = wear_id
|
|
if (istype(pda))
|
|
if (pda.id)
|
|
. = pda.id.assignment
|
|
else
|
|
. = pda.ownjob
|
|
else if (istype(id))
|
|
. = id.assignment
|
|
else
|
|
return if_no_id
|
|
if (!.)
|
|
. = if_no_job
|
|
return
|
|
|
|
//gets name from ID or ID inside PDA or PDA itself
|
|
//Useful when player do something with computers
|
|
/mob/living/carbon/human/proc/get_authentification_name(var/if_no_id = "Unknown")
|
|
var/obj/item/device/pda/pda = wear_id
|
|
var/obj/item/weapon/card/id/id = wear_id
|
|
if (istype(pda))
|
|
if (pda.id)
|
|
. = pda.id.registered
|
|
else
|
|
. = pda.owner
|
|
else if (istype(id))
|
|
. = id.registered
|
|
else
|
|
return if_no_id
|
|
return
|
|
|
|
//gets name from ID or PDA itself, ID inside PDA doesn't matter
|
|
//Useful when player is being seen by other mobs
|
|
/mob/living/carbon/human/proc/get_visible_name(var/if_no_id = "Unknown")
|
|
var/obj/item/device/pda/pda = wear_id
|
|
var/obj/item/weapon/card/id/id = wear_id
|
|
if (istype(pda))
|
|
. = pda.owner
|
|
else if (istype(id))
|
|
. = id.registered
|
|
else
|
|
return if_no_id
|
|
return
|
|
|
|
//gets ID card object from special clothes slot or null.
|
|
/mob/living/carbon/human/proc/get_idcard()
|
|
var/obj/item/weapon/card/id/id = wear_id
|
|
var/obj/item/device/pda/pda = wear_id
|
|
if (istype(pda) && pda.id)
|
|
id = pda.id
|
|
if (istype(id))
|
|
return id
|
|
|
|
//Added a safety check in case you want to shock a human mob directly through electrocute_act.
|
|
/mob/living/carbon/human/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/safety = 0)
|
|
if(!safety)
|
|
if(gloves)
|
|
var/obj/item/clothing/gloves/G = gloves
|
|
siemens_coeff = G.siemens_coefficient
|
|
return ..(shock_damage,source,siemens_coeff)
|
|
|
|
|
|
/mob/living/carbon/human/proc/get_damaged_organs(var/brute, var/burn)
|
|
var/list/datum/organ/external/parts = list()
|
|
for(var/datum/organ/external/organ in organs)
|
|
if((brute && organ.brute_dam) || (burn && organ.burn_dam))
|
|
parts += organ
|
|
return parts
|
|
|
|
/mob/living/carbon/human/proc/get_damageable_organs()
|
|
var/list/datum/organ/external/parts = list()
|
|
for(var/datum/organ/external/organ in organs)
|
|
if(organ.brute_dam + organ.burn_dam < organ.max_damage)
|
|
parts += organ
|
|
return parts
|
|
|
|
// heal ONE external organ, organ gets randomly selected from damaged ones.
|
|
/mob/living/carbon/human/heal_organ_damage(var/brute, var/burn)
|
|
var/list/datum/organ/external/parts = get_damaged_organs(brute,burn)
|
|
if(!parts.len)
|
|
return
|
|
var/datum/organ/external/picked = pick(parts)
|
|
picked.heal_damage(brute,burn)
|
|
updatehealth()
|
|
UpdateDamageIcon()
|
|
|
|
// damage ONE external organ, organ gets randomly selected from damaged ones.
|
|
/mob/living/carbon/human/take_organ_damage(var/brute, var/burn)
|
|
var/list/datum/organ/external/parts = get_damageable_organs()
|
|
if(!parts.len)
|
|
return
|
|
var/datum/organ/external/picked = pick(parts)
|
|
picked.take_damage(brute,burn)
|
|
updatehealth()
|
|
UpdateDamageIcon()
|
|
|
|
// heal MANY external organs, in random order
|
|
/mob/living/carbon/human/heal_overall_damage(var/brute, var/burn)
|
|
var/list/datum/organ/external/parts = get_damaged_organs(brute,burn)
|
|
|
|
while(parts.len && (brute>0 || burn>0) )
|
|
var/datum/organ/external/picked = pick(parts)
|
|
|
|
var/brute_was = picked.brute_dam
|
|
var/burn_was = picked.burn_dam
|
|
|
|
picked.heal_damage(brute,burn)
|
|
|
|
brute -= (brute_was-picked.brute_dam)
|
|
burn -= (burn_was-picked.burn_dam)
|
|
|
|
parts -= picked
|
|
updatehealth()
|
|
UpdateDamageIcon()
|
|
|
|
// damage MANY external organs, in random order
|
|
/mob/living/carbon/human/take_overall_damage(var/brute, var/burn)
|
|
var/list/datum/organ/external/parts = get_damageable_organs()
|
|
|
|
while(parts.len && (brute>0 || burn>0) )
|
|
var/datum/organ/external/picked = pick(parts)
|
|
|
|
var/brute_was = picked.brute_dam
|
|
var/burn_was = picked.burn_dam
|
|
|
|
picked.take_damage(brute,burn)
|
|
|
|
brute -= (picked.brute_dam-brute_was)
|
|
burn -= (picked.burn_dam-burn_was)
|
|
|
|
parts -= picked
|
|
updatehealth()
|
|
UpdateDamageIcon()
|
|
|
|
/mob/living/carbon/human/Topic(href, href_list)
|
|
if (href_list["refresh"])
|
|
if((machine)&&(in_range(src, usr)))
|
|
show_inv(machine)
|
|
|
|
if (href_list["mach_close"])
|
|
var/t1 = text("window=[]", href_list["mach_close"])
|
|
machine = null
|
|
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( )
|
|
O.source = usr
|
|
O.target = src
|
|
O.item = usr.equipped()
|
|
O.s_loc = usr.loc
|
|
O.t_loc = loc
|
|
O.place = href_list["item"]
|
|
requests += O
|
|
spawn( 0 )
|
|
O.process()
|
|
return
|
|
..()
|
|
return
|
|
|
|
|
|
///eyecheck()
|
|
///Returns a number between -1 to 2
|
|
/mob/living/carbon/human/eyecheck()
|
|
var/number = 0
|
|
if(istype(src.head, /obj/item/clothing/head/helmet/welding))
|
|
if(!src.head:up)
|
|
number += 2
|
|
if(istype(src.head, /obj/item/clothing/head/helmet/space))
|
|
number += 2
|
|
if(istype(src.glasses, /obj/item/clothing/glasses/sunglasses))
|
|
number += 1
|
|
if(istype(src.glasses, /obj/item/clothing/glasses/thermal))
|
|
number -= 1
|
|
return number
|
|
|
|
|
|
/mob/living/carbon/human/IsAdvancedToolUser()
|
|
return 1//Humans can use guns and such
|
|
|
|
|
|
/mob/living/carbon/human/updatehealth()
|
|
if(src.nodamage)
|
|
src.health = 100
|
|
src.stat = 0
|
|
return
|
|
bruteloss = 0
|
|
fireloss = 0
|
|
for(var/datum/organ/external/O in organs)
|
|
src.bruteloss += O.brute_dam
|
|
src.fireloss += O.burn_dam
|
|
src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.bruteloss - src.cloneloss
|
|
|
|
|