mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-04 22:52:03 +00:00
Organs:
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
This commit is contained in:
@@ -68,16 +68,6 @@
|
||||
return ..(gibbed)
|
||||
|
||||
|
||||
/mob/living/blob/bullet_act(var/obj/item/projectile/Proj, var/datum/organ/external/def_zone)
|
||||
for(var/i = 1, i<= Proj.mobdamage.len, i++)
|
||||
switch(i)
|
||||
if(1)
|
||||
bruteloss += Proj.mobdamage[BRUTE]
|
||||
if(2)
|
||||
fireloss += Proj.mobdamage[BURN]
|
||||
return
|
||||
|
||||
|
||||
/mob/living/blob/blob_act()
|
||||
src << "The blob attempts to reabsorb you."
|
||||
toxloss += 20
|
||||
|
||||
@@ -167,35 +167,34 @@
|
||||
set category = "Alien"
|
||||
|
||||
if(powerc(50))
|
||||
if(!isalien(target))
|
||||
toxloss -= 50
|
||||
src << "\green You spit neurotoxin at [target]."
|
||||
for(var/mob/O in oviewers())
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << "\red [src] spits neurotoxin at [target]!"
|
||||
//I'm not motivated enough to revise this. Prjectile code in general needs update.
|
||||
var/turf/T = loc
|
||||
var/turf/U = (istype(target, /atom/movable) ? target.loc : target)
|
||||
|
||||
if(!U || !T)
|
||||
return
|
||||
while(U && !istype(U,/turf))
|
||||
U = U.loc
|
||||
if(!istype(T, /turf))
|
||||
return
|
||||
if (U == T)
|
||||
usr.bullet_act(src, src.get_organ_target())
|
||||
return
|
||||
if(!istype(U, /turf))
|
||||
return
|
||||
|
||||
var/obj/item/projectile/dart/A = new /obj/item/projectile/dart(usr.loc)
|
||||
|
||||
A.current = U
|
||||
A.yo = U.y - T.y
|
||||
A.xo = U.x - T.x
|
||||
//
|
||||
A.process()
|
||||
else
|
||||
if(isalien(target))
|
||||
src << "\green Your allies are not a valid target."
|
||||
return
|
||||
toxloss -= 50
|
||||
src << "\green You spit neurotoxin at [target]."
|
||||
for(var/mob/O in oviewers())
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << "\red [src] spits neurotoxin at [target]!"
|
||||
//I'm not motivated enough to revise this. Prjectile code in general needs update.
|
||||
var/turf/T = loc
|
||||
var/turf/U = (istype(target, /atom/movable) ? target.loc : target)
|
||||
|
||||
if(!U || !T)
|
||||
return
|
||||
while(U && !istype(U,/turf))
|
||||
U = U.loc
|
||||
if(!istype(T, /turf))
|
||||
return
|
||||
if (U == T)
|
||||
usr.bullet_act(src, src.get_organ_target())
|
||||
return
|
||||
if(!istype(U, /turf))
|
||||
return
|
||||
|
||||
var/obj/item/projectile/energy/dart/A = new /obj/item/projectile/energy/dart(usr.loc)
|
||||
|
||||
A.current = U
|
||||
A.yo = U.y - T.y
|
||||
A.xo = U.x - T.x
|
||||
A.process()
|
||||
return
|
||||
@@ -21,13 +21,6 @@
|
||||
src.hand = 1
|
||||
drop_item()
|
||||
src.hand = h
|
||||
if (istype(src.wear_suit, /obj/item/clothing/suit/armor/a_i_a_ptank))
|
||||
var/obj/item/clothing/suit/armor/a_i_a_ptank/A = src.wear_suit
|
||||
bombers += "[src.key] has detonated a suicide bomb. Temp = [A.part4.air_contents.temperature-T0C]."
|
||||
// world << "Detected that [src.key] is wearing a bomb" debug stuff
|
||||
if(A.status && prob(90))
|
||||
// world << "Bomb has ignited?"
|
||||
A.part4.ignite()
|
||||
|
||||
if (src.key)
|
||||
spawn(10)
|
||||
|
||||
@@ -74,110 +74,7 @@
|
||||
if (client.statpanel == "Status")
|
||||
stat(null, "Plasma Stored: [toxloss]")
|
||||
|
||||
/mob/living/carbon/alien/humanoid/bullet_act(var/obj/item/projectile/Proj)
|
||||
var/shielded = 0
|
||||
|
||||
if(prob(80))
|
||||
for(var/mob/living/carbon/metroid/M in view(1,src))
|
||||
if(M.Victim == src)
|
||||
M.bullet_act(Proj)
|
||||
return
|
||||
|
||||
|
||||
for(var/obj/item/weapon/cloaking_device/S in src)
|
||||
if (S.active)
|
||||
shielded = 1
|
||||
S.active = 0
|
||||
S.icon_state = "shield0"
|
||||
if ((shielded && Proj.flag != "bullet"))
|
||||
if (Proj.flag)
|
||||
src << "\blue Your shield was disturbed by a laser!"
|
||||
if(paralysis <= 12) paralysis = 12
|
||||
updatehealth()
|
||||
if (locate(/obj/item/weapon/grab, src))
|
||||
var/mob/safe = null
|
||||
if (istype(l_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = l_hand
|
||||
if ((G.state == 3 && get_dir(src, Proj) == dir))
|
||||
safe = G.affecting
|
||||
if (istype(r_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon.grab/G = r_hand
|
||||
if ((G.state == 3 && get_dir(src, Proj) == dir))
|
||||
safe = G.affecting
|
||||
if (safe)
|
||||
return safe.bullet_act(Proj)
|
||||
|
||||
for(var/i = 1, i<= Proj.mobdamage.len, i++)
|
||||
|
||||
switch(i)
|
||||
if(1)
|
||||
var/d = Proj.mobdamage[BRUTE]
|
||||
if(!Proj.nodamage) bruteloss += d
|
||||
updatehealth()
|
||||
if(2)
|
||||
var/d = Proj.mobdamage[BURN]
|
||||
if(!Proj.nodamage) fireloss += d
|
||||
updatehealth()
|
||||
if(3)
|
||||
var/d = Proj.mobdamage[TOX]
|
||||
if(!Proj.nodamage) toxloss += d
|
||||
updatehealth()
|
||||
if(4)
|
||||
var/d = Proj.mobdamage[OXY]
|
||||
if(!Proj.nodamage) oxyloss += d
|
||||
updatehealth()
|
||||
if(5)
|
||||
var/d = Proj.mobdamage[CLONE]
|
||||
if(!Proj.nodamage) cloneloss += d
|
||||
updatehealth()
|
||||
|
||||
if(Proj.effects["stun"] && prob(Proj.effectprob["stun"]))
|
||||
if(Proj.effectmod["stun"] == SET)
|
||||
stunned = Proj.effects["stun"]
|
||||
else
|
||||
stunned += Proj.effects["stun"]
|
||||
|
||||
|
||||
if(Proj.effects["weak"] && prob(Proj.effectprob["weak"]))
|
||||
if(Proj.effectmod["weak"] == SET)
|
||||
weakened = Proj.effects["weak"]
|
||||
else
|
||||
weakened += Proj.effects["weak"]
|
||||
|
||||
if(Proj.effects["paralysis"] && prob(Proj.effectprob["paralysis"]))
|
||||
if(Proj.effectmod["paralysis"] == SET)
|
||||
paralysis = Proj.effects["paralysis"]
|
||||
else
|
||||
paralysis += Proj.effects["paralysis"]
|
||||
|
||||
if(Proj.effects["stutter"] && prob(Proj.effectprob["stutter"]))
|
||||
if(Proj.effectmod["stutter"] == SET)
|
||||
stuttering = Proj.effects["stutter"]
|
||||
else
|
||||
stuttering += Proj.effects["stutter"]
|
||||
|
||||
if(Proj.effects["drowsyness"] && prob(Proj.effectprob["drowsyness"]))
|
||||
if(Proj.effectmod["drowsyness"] == SET)
|
||||
drowsyness = Proj.effects["drowsyness"]
|
||||
else
|
||||
drowsyness += Proj.effects["drowsyness"]
|
||||
|
||||
// Aliums not effected by radiation damage
|
||||
|
||||
if(Proj.effects["eyeblur"] && prob(Proj.effectprob["eyeblur"]))
|
||||
if(Proj.effectmod["eyeblur"] == SET)
|
||||
eye_blurry = Proj.effects["eyeblur"]
|
||||
else
|
||||
eye_blurry += Proj.effects["eyeblur"]
|
||||
|
||||
if(Proj.effects["emp"])
|
||||
var/emppulse = Proj.effects["emp"]
|
||||
if(prob(Proj.effectprob["emp"]))
|
||||
empulse(src, emppulse, emppulse)
|
||||
else
|
||||
empulse(src, 0, emppulse)
|
||||
|
||||
return
|
||||
///mob/living/carbon/alien/humanoid/bullet_act(var/obj/item/projectile/Proj) taken care of in living
|
||||
|
||||
/mob/living/carbon/alien/humanoid/emp_act(severity)
|
||||
if(wear_suit) wear_suit.emp_act(severity)
|
||||
|
||||
@@ -66,101 +66,8 @@
|
||||
stat(null, "Plasma Stored: [toxloss]")
|
||||
|
||||
|
||||
//This is okay I guess unless we add alien shields or something. Should be cleaned up a bit.
|
||||
/mob/living/carbon/alien/larva/bullet_act(var/obj/item/projectile/Proj)
|
||||
///mob/living/carbon/alien/larva/bullet_act(var/obj/item/projectile/Proj) taken care of in living
|
||||
|
||||
if(prob(80))
|
||||
for(var/mob/living/carbon/metroid/M in view(1,src))
|
||||
if(M.Victim == src)
|
||||
M.bullet_act(Proj)
|
||||
return
|
||||
|
||||
|
||||
if (locate(/obj/item/weapon/grab, src))
|
||||
var/mob/safe = null
|
||||
if (istype(l_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = l_hand
|
||||
if ((G.state == 3 && get_dir(src, Proj) == dir))
|
||||
safe = G.affecting
|
||||
if (istype(r_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon.grab/G = r_hand
|
||||
if ((G.state == 3 && get_dir(src, Proj) == dir))
|
||||
safe = G.affecting
|
||||
if (safe)
|
||||
return safe.bullet_act(Proj)
|
||||
|
||||
|
||||
for(var/i = 1, i<= Proj.mobdamage.len, i++)
|
||||
|
||||
switch(i)
|
||||
if(1)
|
||||
var/d = Proj.mobdamage[BRUTE]
|
||||
if(!Proj.nodamage) bruteloss += d
|
||||
updatehealth()
|
||||
if(2)
|
||||
var/d = Proj.mobdamage[BURN]
|
||||
if(!Proj.nodamage) fireloss += d
|
||||
updatehealth()
|
||||
if(3)
|
||||
var/d = Proj.mobdamage[TOX]
|
||||
if(!Proj.nodamage) toxloss += d
|
||||
updatehealth()
|
||||
if(4)
|
||||
var/d = Proj.mobdamage[OXY]
|
||||
if(!Proj.nodamage) oxyloss += d
|
||||
updatehealth()
|
||||
if(5)
|
||||
var/d = Proj.mobdamage[CLONE]
|
||||
if(!Proj.nodamage) cloneloss += d
|
||||
updatehealth()
|
||||
|
||||
if(Proj.effects["stun"] && prob(Proj.effectprob["stun"]))
|
||||
if(Proj.effectmod["stun"] == SET)
|
||||
stunned = Proj.effects["stun"]
|
||||
else
|
||||
stunned += Proj.effects["stun"]
|
||||
|
||||
|
||||
if(Proj.effects["weak"] && prob(Proj.effectprob["weak"]))
|
||||
if(Proj.effectmod["weak"] == SET)
|
||||
weakened = Proj.effects["weak"]
|
||||
else
|
||||
weakened += Proj.effects["weak"]
|
||||
|
||||
if(Proj.effects["paralysis"] && prob(Proj.effectprob["paralysis"]))
|
||||
if(Proj.effectmod["paralysis"] == SET)
|
||||
paralysis = Proj.effects["paralysis"]
|
||||
else
|
||||
paralysis += Proj.effects["paralysis"]
|
||||
|
||||
if(Proj.effects["stutter"] && prob(Proj.effectprob["stutter"]))
|
||||
if(Proj.effectmod["stutter"] == SET)
|
||||
stuttering = Proj.effects["stutter"]
|
||||
else
|
||||
stuttering += Proj.effects["stutter"]
|
||||
|
||||
if(Proj.effects["drowsyness"] && prob(Proj.effectprob["drowsyness"]))
|
||||
if(Proj.effectmod["drowsyness"] == SET)
|
||||
drowsyness = Proj.effects["drowsyness"]
|
||||
else
|
||||
drowsyness += Proj.effects["drowsyness"]
|
||||
|
||||
// Aliums not effected by radiation damage
|
||||
|
||||
if(Proj.effects["eyeblur"] && prob(Proj.effectprob["eyeblur"]))
|
||||
if(Proj.effectmod["eyeblur"] == SET)
|
||||
eye_blurry = Proj.effects["eyeblur"]
|
||||
else
|
||||
eye_blurry += Proj.effects["eyeblur"]
|
||||
|
||||
if(Proj.effects["emp"])
|
||||
var/emppulse = Proj.effects["emp"]
|
||||
if(prob(Proj.effectprob["emp"]))
|
||||
empulse(src, emppulse, emppulse)
|
||||
else
|
||||
empulse(src, 0, emppulse)
|
||||
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/larva/emp_act(severity)
|
||||
..()
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
back = jetpack
|
||||
return
|
||||
|
||||
bullet_act(flags)
|
||||
take_overall_damage(15,0)
|
||||
return
|
||||
// bullet_act(flags)
|
||||
// take_overall_damage(15,0)
|
||||
// return
|
||||
|
||||
movement_delay()
|
||||
return -5
|
||||
|
||||
@@ -1,46 +1,89 @@
|
||||
/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 )
|
||||
if(!dna) dna = new /datum/dna(null)
|
||||
|
||||
var/datum/organ/external/chest/chest = new /datum/organ/external/chest( src )
|
||||
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
|
||||
var/datum/organ/external/groin/groin = new /datum/organ/external/groin( src )
|
||||
groin.owner = src
|
||||
var/datum/organ/external/head/head = new /datum/organ/external/head( src )
|
||||
head.owner = src
|
||||
var/datum/organ/external/l_arm/l_arm = new /datum/organ/external/l_arm( src )
|
||||
l_arm.owner = src
|
||||
var/datum/organ/external/r_arm/r_arm = new /datum/organ/external/r_arm( src )
|
||||
r_arm.owner = src
|
||||
var/datum/organ/external/l_hand/l_hand = new /datum/organ/external/l_hand( src )
|
||||
l_hand.owner = src
|
||||
var/datum/organ/external/r_hand/r_hand = new /datum/organ/external/r_hand( src )
|
||||
r_hand.owner = src
|
||||
var/datum/organ/external/l_leg/l_leg = new /datum/organ/external/l_leg( src )
|
||||
l_leg.owner = src
|
||||
var/datum/organ/external/r_leg/r_leg = new /datum/organ/external/r_leg( src )
|
||||
l_arm.owner = src
|
||||
r_leg.owner = src
|
||||
var/datum/organ/external/l_foot/l_foot = new /datum/organ/external/l_foot( src )
|
||||
l_foot.owner = src
|
||||
var/datum/organ/external/r_foot/r_foot = new /datum/organ/external/r_foot( src )
|
||||
r_foot.owner = src
|
||||
|
||||
organs["chest"] = chest
|
||||
organs["groin"] = groin
|
||||
organs["head"] = head
|
||||
organs["l_arm"] = l_arm
|
||||
organs["r_arm"] = r_arm
|
||||
organs["l_hand"] = l_hand
|
||||
organs["r_hand"] = r_hand
|
||||
organs["l_leg"] = l_leg
|
||||
organs["r_leg"] = r_leg
|
||||
organs["l_foot"] = l_foot
|
||||
organs["r_foot"] = r_foot
|
||||
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)
|
||||
@@ -62,14 +105,7 @@
|
||||
|
||||
..()
|
||||
|
||||
organStructure = new /obj/effect/organstructure/human(src)
|
||||
|
||||
/mob/living/carbon/human/cyborg
|
||||
New()
|
||||
..()
|
||||
if(organStructure) //hacky, but it's not supposed to be in for a long time anyway
|
||||
del(organStructure)
|
||||
organStructure = new /obj/effect/organstructure/cyber(src)
|
||||
// organStructure = new /obj/effect/organstructure/human(src)
|
||||
|
||||
/mob/living/carbon/human/Bump(atom/movable/AM as mob|obj, yes)
|
||||
if ((!( yes ) || now_pushing))
|
||||
@@ -176,8 +212,8 @@
|
||||
/mob/living/carbon/human/ex_act(severity)
|
||||
flick("flash", flash)
|
||||
|
||||
// /obj/item/clothing/suit/bomb_suit( src )
|
||||
// /obj/item/clothing/head/bomb_hood( src )
|
||||
// /obj/item/clothing/suit/bomb_suit(src)
|
||||
// /obj/item/clothing/head/bomb_hood(src)
|
||||
|
||||
if (stat == 2 && client)
|
||||
gib(1)
|
||||
@@ -242,18 +278,18 @@
|
||||
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("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)
|
||||
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")
|
||||
/* 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)
|
||||
temp.take_damage(b_loss * 0.0225, f_loss * 0.0225)*/
|
||||
|
||||
UpdateDamageIcon()
|
||||
|
||||
@@ -267,13 +303,13 @@
|
||||
|
||||
show_message("\red The blob attacks you!")
|
||||
|
||||
var/list/zones = list("head","chest","chest", "groin", "l_arm", "r_arm", "l_hand", "r_hand", "l_leg", "r_leg", "l_foot", "r_foot")
|
||||
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)
|
||||
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))
|
||||
@@ -958,7 +994,7 @@
|
||||
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 || /obj/item/clothing/suit/armor/a_i_a_ptank))
|
||||
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"]")
|
||||
@@ -1101,11 +1137,7 @@
|
||||
*/
|
||||
last_b_state = stat
|
||||
|
||||
/mob/living/carbon/human/hand_p(mob/M as mob)
|
||||
if (!ticker)
|
||||
M << "You cannot attack people before the game has started."
|
||||
return
|
||||
|
||||
/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
|
||||
@@ -1130,11 +1162,6 @@
|
||||
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/swat_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
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
@@ -1155,224 +1182,12 @@
|
||||
src = null
|
||||
src = H.monkeyize()
|
||||
contract_disease(D,1,0)
|
||||
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/attack_paw(mob/M as mob)
|
||||
..()
|
||||
if (M.a_intent == "help")
|
||||
help_shake_act(M)
|
||||
else
|
||||
if (istype(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 if (istype(wear_suit, /obj/item/clothing/suit/swat_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
|
||||
for(var/mob/O in viewers(src, null))
|
||||
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_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
if (!ticker)
|
||||
M << "You cannot attack people before the game has started."
|
||||
return
|
||||
|
||||
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
M << "No attacking people at spawn, you jackass."
|
||||
return
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if ("help")
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\blue [M] caresses [src] with its scythe like arm."), 1)
|
||||
if ("grab")
|
||||
//This will be changed to skin, where we can skin a dead human corpse//Actually, that sounds kind of impractical./N
|
||||
if (M == src)
|
||||
return
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
|
||||
G.assailant = M
|
||||
if (M.hand)
|
||||
M.l_hand = G
|
||||
else
|
||||
M.r_hand = G
|
||||
G.layer = 20
|
||||
G.affecting = src
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
|
||||
|
||||
if ("hurt")
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/damage = rand(15, 30) // How much damage aliens do to humans? Increasing -- TLE
|
||||
// I've decreased the chance of humans being protected by uniforms. Now aliens can actually damage them.
|
||||
var/datum/organ/external/affecting = organs["chest"]
|
||||
var/t = M.zone_sel.selecting
|
||||
if ((t in list( "eyes", "mouth" )))
|
||||
t = "head"
|
||||
var/def_zone = ran_zone(t)
|
||||
if (organs[def_zone])
|
||||
affecting = organs[def_zone]
|
||||
if ((istype(affecting, /datum/organ/external) && prob(95)))
|
||||
playsound(loc, 'slice.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has slashed at []!</B>", M, src), 1)
|
||||
if (def_zone == "head")
|
||||
if ((((head && head.body_parts_covered & HEAD) || (wear_mask && wear_mask.body_parts_covered & HEAD)) && prob(5)))
|
||||
if (prob(20))
|
||||
affecting.take_damage(damage, 0)
|
||||
else
|
||||
show_message("\red You have been protected from a hit to the head.")
|
||||
return
|
||||
if (damage >= 25)
|
||||
if (weakened < 10)
|
||||
weakened = rand(10, 15)
|
||||
for(var/mob/O in viewers(M, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has wounded []!</B>", M, src), 1, "\red You hear someone fall.", 2)
|
||||
affecting.take_damage(damage)
|
||||
else
|
||||
if (def_zone == "chest")
|
||||
if ((((wear_suit && wear_suit.body_parts_covered & UPPER_TORSO) || (w_uniform && w_uniform.body_parts_covered & LOWER_TORSO)) && prob(10)))
|
||||
show_message("\blue You have been protected from a hit to the chest.")
|
||||
return
|
||||
if (damage >= 25)
|
||||
if (prob(50))
|
||||
if (weakened < 5)
|
||||
weakened = 5
|
||||
playsound(loc, 'slashmiss.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has tackled down []!</B>", M, 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.blinded )))
|
||||
O.show_message(text("\red <B>[] has stunned []!</B>", M, src), 1)
|
||||
if(stat != 2) stat = 1
|
||||
affecting.take_damage(damage)
|
||||
else
|
||||
if (def_zone == "groin")
|
||||
if ((((wear_suit && wear_suit.body_parts_covered & LOWER_TORSO) || (w_uniform && w_uniform.body_parts_covered & LOWER_TORSO)) && prob(1)))
|
||||
show_message("\blue You have been protected from a hit to the lower chest.")
|
||||
return
|
||||
if (damage >= 25)
|
||||
if (prob(50))
|
||||
if (weakened < 3)
|
||||
weakened = 3
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has tackled down []!</B>", M, src), 1, "\red You hear someone fall.", 2)
|
||||
else
|
||||
if (stunned < 3)
|
||||
stunned = 3
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has stunned []!</B>", M, src), 1)
|
||||
if(stat != 2) stat = 1
|
||||
affecting.take_damage(damage)
|
||||
else
|
||||
affecting.take_damage(damage)
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'slashmiss.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[M] has lunged at [src] but missed!</B>"), 1)
|
||||
if ("disarm")
|
||||
var/damage = 5
|
||||
var/datum/organ/external/affecting = organs["chest"]
|
||||
var/t = M.zone_sel.selecting
|
||||
if ((t in list( "eyes", "mouth" )))
|
||||
t = "head"
|
||||
var/def_zone = ran_zone(t)
|
||||
if (organs[def_zone])
|
||||
affecting = organs[def_zone]
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/randn = rand(1, 100)
|
||||
if (randn <= 90)
|
||||
playsound(loc, 'pierce.ogg', 25, 1, -1)
|
||||
if (weakened < 15)
|
||||
weakened = rand(10, 15)
|
||||
affecting.take_damage(damage)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has tackled down []!</B>", M, src), 1)
|
||||
else
|
||||
if (randn <= 99)
|
||||
playsound(loc, 'slash.ogg', 25, 1, -1)
|
||||
drop_item()
|
||||
affecting.take_damage(damage)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] disarmed []!</B>", M, src), 1)
|
||||
else
|
||||
playsound(loc, 'slashmiss.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has tried to disarm []!</B>", M, src), 1)
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/human/attack_metroid(mob/living/carbon/metroid/M as mob)
|
||||
if (!ticker)
|
||||
M << "You cannot attack people before the game has started."
|
||||
return
|
||||
|
||||
if(M.Victim) return // can't attack while eating!
|
||||
|
||||
if (health > -100)
|
||||
@@ -1389,23 +1204,12 @@
|
||||
damage = rand(5, 25)
|
||||
|
||||
|
||||
var/dam_zone = pick("head", "chest", "l_hand", "r_hand", "l_leg", "r_leg", "groin")
|
||||
var/dam_zone = pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg", "groin")
|
||||
|
||||
|
||||
if (dam_zone == "chest")
|
||||
if ((((wear_suit && wear_suit.body_parts_covered & UPPER_TORSO) || (w_uniform && w_uniform.body_parts_covered & LOWER_TORSO)) && prob(10)))
|
||||
if(prob(20))
|
||||
show_message("\blue You have been protected from a hit to the chest.")
|
||||
return
|
||||
|
||||
|
||||
|
||||
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()
|
||||
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)
|
||||
@@ -1448,186 +1252,6 @@
|
||||
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/attack_hand(mob/living/carbon/human/M as mob)
|
||||
if (!ticker)
|
||||
M << "You cannot attack people before the game has started."
|
||||
return
|
||||
|
||||
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
M << "No attacking people at spawn, you jackass."
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
if ((M.gloves && M.gloves.elecgen == 1 && M.a_intent == "hurt") /*&& (!istype(src:wear_suit, /obj/item/clothing/suit/judgerobe))*/)
|
||||
if(M.gloves.uses > 0)
|
||||
M.gloves.uses--
|
||||
if (weakened < 5)
|
||||
weakened = 5
|
||||
if (stuttering < 5)
|
||||
stuttering = 5
|
||||
if (stunned < 5)
|
||||
stunned = 5
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if (O.client)
|
||||
O.show_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>", 1, "\red You hear someone fall", 2)
|
||||
else
|
||||
M.gloves.elecgen = 0
|
||||
M << "\red Not enough charge! "
|
||||
return
|
||||
|
||||
if (M.a_intent == "help")
|
||||
if (health > 0)
|
||||
help_shake_act(M)
|
||||
else
|
||||
if (M.health >= -75.0)
|
||||
if (((M.head && M.head.flags & 4) || ((M.wear_mask && !( M.wear_mask.flags & 32 )) || ((head && head.flags & 4) || (wear_mask && !( wear_mask.flags & 32 ))))))
|
||||
M << "\blue <B>Remove that mask!</B>"
|
||||
return
|
||||
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()
|
||||
return
|
||||
else
|
||||
if (M.a_intent == "grab")
|
||||
if (M == src)
|
||||
return
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
|
||||
G.assailant = M
|
||||
if (M.hand)
|
||||
M.l_hand = G
|
||||
else
|
||||
M.r_hand = G
|
||||
G.layer = 20
|
||||
G.affecting = src
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
|
||||
else
|
||||
if (M.a_intent == "hurt" && !(M.gloves && M.gloves.elecgen == 1))
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/damage = 0
|
||||
if(organStructure && organStructure.arms)
|
||||
damage = rand(organStructure.arms.minDamage,organStructure.arms.maxDamage)
|
||||
else
|
||||
damage = rand(1, 9) //oh boy
|
||||
var/datum/organ/external/affecting = organs["chest"]
|
||||
var/t = M.zone_sel.selecting
|
||||
if ((t in list( "eyes", "mouth" )))
|
||||
t = "head"
|
||||
var/def_zone = ran_zone(t)
|
||||
if (organs[text("[]", def_zone)])
|
||||
affecting = organs[text("[]", def_zone)]
|
||||
if ((istype(affecting, /datum/organ/external) && prob(90)))
|
||||
if (M.mutations & HULK)
|
||||
damage += 5
|
||||
spawn(0)
|
||||
paralysis += 1
|
||||
step_away(src,M,15)
|
||||
sleep(3)
|
||||
step_away(src,M,15)
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] has punched []!</B>", M, src), 1)
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Punched [src.name] ([src.ckey])</font>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been punched by [M.name] ([M.ckey])</font>")
|
||||
|
||||
if (def_zone == "head")
|
||||
if ((((head && head.body_parts_covered & HEAD) || (wear_mask && wear_mask.body_parts_covered & HEAD)) && prob(99)))
|
||||
if (prob(20))
|
||||
affecting.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(M, null))
|
||||
O.show_message(text("\red <B>[] has weakened []!</B>", M, src), 1, "\red You hear someone fall.", 2)
|
||||
affecting.take_damage(damage)
|
||||
else
|
||||
if (def_zone == "chest")
|
||||
if ((((wear_suit && wear_suit.body_parts_covered & UPPER_TORSO) || (w_uniform && w_uniform.body_parts_covered & LOWER_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
|
||||
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] has knocked down []!</B>", M, src), 1, "\red You hear someone fall.", 2)
|
||||
else
|
||||
if (stunned < 5)
|
||||
stunned = 5
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] has stunned []!</B>", M, src), 1)
|
||||
if(stat != 2) stat = 1
|
||||
affecting.take_damage(damage)
|
||||
else
|
||||
if (def_zone == "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
|
||||
if (damage > 4.9)
|
||||
if (prob(50))
|
||||
if (weakened < 3)
|
||||
weakened = 3
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] has knocked down []!</B>", M, src), 1, "\red You hear someone fall.", 2)
|
||||
else
|
||||
if (stunned < 3)
|
||||
stunned = 3
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] has stunned []!</B>", M, src), 1)
|
||||
if(stat != 2) stat = 1
|
||||
affecting.take_damage(damage)
|
||||
else
|
||||
affecting.take_damage(damage)
|
||||
|
||||
UpdateDamageIcon()
|
||||
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'punchmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] has attempted to punch []!</B>", M, src), 1)
|
||||
return
|
||||
else
|
||||
if (!( lying ) && !(M.gloves && M.gloves.elecgen == 1))
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/randn = rand(1, 100)
|
||||
if (randn <= 25)
|
||||
weakened = 2
|
||||
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] has pushed down []!</B>", M, src), 1)
|
||||
else
|
||||
if (randn <= 60)
|
||||
drop_item()
|
||||
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] has disarmed []!</B>", M, src), 1)
|
||||
else
|
||||
playsound(loc, 'punchmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("\red <B>[] has attempted to disarm []!</B>", M, src), 1)
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/restrained()
|
||||
if (handcuffed)
|
||||
@@ -1877,9 +1501,7 @@
|
||||
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/suit/armor/a_i_a_ptank))//Exception for suicide vests.
|
||||
message = text("\red <B>[] fails to take off \a [] from []'s body!</B>", source, target.wear_suit, target)
|
||||
else if(istype(target.wear_suit, /obj/item/clothing)&&!target.wear_suit:canremove)
|
||||
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)
|
||||
@@ -2153,13 +1775,14 @@ It can still be worn/put on as normal.
|
||||
W.layer = initial(W.layer)
|
||||
W.add_fingerprint(source)
|
||||
else
|
||||
if (istype(item, /obj/item))
|
||||
if(istype(item, /obj/item))
|
||||
source.drop_item()
|
||||
loc = target
|
||||
item.layer = 20
|
||||
target.l_hand = item
|
||||
item.loc = target
|
||||
item.add_fingerprint(target)
|
||||
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
|
||||
@@ -2232,15 +1855,7 @@ It can still be worn/put on as normal.
|
||||
target.w_uniform = item
|
||||
item.loc = target
|
||||
if("suit")
|
||||
if (target.wear_suit)
|
||||
if(istype(target.wear_suit, /obj/item/clothing/suit/armor/a_i_a_ptank))//triggers suicide vest if someone else tries to take it off/N
|
||||
var/obj/item/clothing/suit/armor/a_i_a_ptank/A = target.wear_suit//mostly a copy from death.dm code.
|
||||
bombers += "[target.key] has detonated a suicide bomb. Temp = [A.part4.air_contents.temperature-T0C]."
|
||||
if(A.status && prob(90))
|
||||
A.part4.ignite()
|
||||
return
|
||||
if(istype(target.wear_suit, /obj/item/clothing)&& !target.wear_suit:canremove)
|
||||
if(!istype(target.wear_suit, /obj/item/clothing/suit/armor/a_i_a_ptank)) return//Can remove the suicide vest if it didn't trigger.
|
||||
if(target.wear_suit)
|
||||
var/obj/item/W = target.wear_suit
|
||||
target.u_equip(W)
|
||||
if (target.client)
|
||||
@@ -2419,75 +2034,6 @@ It can still be worn/put on as normal.
|
||||
del(src)
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/proc/TakeDamage(zone, brute, burn)
|
||||
var/datum/organ/external/E = organs[text("[]", zone)]
|
||||
if (istype(E, /datum/organ/external))
|
||||
if (E.take_damage(brute, burn))
|
||||
UpdateDamageIcon()
|
||||
else
|
||||
UpdateDamage()
|
||||
else
|
||||
return 0
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/proc/HealDamage(zone, brute, burn)
|
||||
|
||||
var/datum/organ/external/E = organs[text("[]", zone)]
|
||||
if (istype(E, /datum/organ/external))
|
||||
if (E.heal_damage(brute, burn))
|
||||
UpdateDamageIcon()
|
||||
else
|
||||
UpdateDamage()
|
||||
else
|
||||
return 0
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/proc/UpdateDamage()
|
||||
|
||||
bruteloss = 0
|
||||
fireloss = 0
|
||||
var/datum/organ/external/O
|
||||
for(var/t in organs)
|
||||
O = organs[t]
|
||||
if (istype(O, /datum/organ/external))
|
||||
bruteloss += O.brute_dam
|
||||
fireloss += O.burn_dam
|
||||
return
|
||||
|
||||
// new damage icon system
|
||||
// now constructs damage icon for each organ from mask * damage field
|
||||
|
||||
/mob/living/carbon/human/proc/UpdateDamageIcon()
|
||||
del(body_standing)
|
||||
body_standing = list()
|
||||
del(body_lying)
|
||||
body_lying = list()
|
||||
bruteloss = 0
|
||||
fireloss = 0
|
||||
var/datum/organ/external/O
|
||||
for(var/t in organs)
|
||||
O = organs[t]
|
||||
if (istype(O, /datum/organ/external))
|
||||
bruteloss += O.brute_dam
|
||||
fireloss += O.burn_dam
|
||||
|
||||
var/icon/DI = new /icon('dam_human.dmi', O.damage_state) // the damage icon for whole human
|
||||
DI.Blend(new /icon('dam_mask.dmi', O.icon_name), ICON_MULTIPLY) // mask with this organ's pixels
|
||||
|
||||
// world << "[O.icon_name] [O.damage_state] \icon[DI]"
|
||||
|
||||
body_standing += DI
|
||||
|
||||
DI = new /icon('dam_human.dmi', "[O.damage_state]-2") // repeat for lying icons
|
||||
DI.Blend(new /icon('dam_mask.dmi', "[O.icon_name]2"), ICON_MULTIPLY)
|
||||
|
||||
// world << "[O.r_name]2 [O.d_i_state]-2 \icon[DI]"
|
||||
|
||||
body_lying += DI
|
||||
|
||||
//body_standing += new /icon( 'dam_zones.dmi', text("[]", O.d_i_state) )
|
||||
//body_lying += new /icon( 'dam_zones.dmi', text("[]2", O.d_i_state) )
|
||||
|
||||
/mob/living/carbon/human/show_inv(mob/user as mob)
|
||||
|
||||
user.machine = src
|
||||
@@ -2593,16 +2139,14 @@ It can still be worn/put on as normal.
|
||||
|
||||
/mob/living/carbon/human/proc/get_damaged_organs(var/brute, var/burn)
|
||||
var/list/datum/organ/external/parts = list()
|
||||
for(var/organ_name in organs)
|
||||
var/datum/organ/external/organ = organs[organ_name]
|
||||
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/organ_name in organs)
|
||||
var/datum/organ/external/organ = organs[organ_name]
|
||||
for(var/datum/organ/external/organ in organs)
|
||||
if(organ.brute_dam + organ.burn_dam < organ.max_damage)
|
||||
parts += organ
|
||||
return parts
|
||||
@@ -2710,3 +2254,17 @@ It can still be worn/put on as normal.
|
||||
/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
|
||||
|
||||
|
||||
|
||||
74
code/modules/mob/living/carbon/human/human_attackalien.dm
Normal file
74
code/modules/mob/living/carbon/human/human_attackalien.dm
Normal file
@@ -0,0 +1,74 @@
|
||||
/mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
if(check_shields(0, M.name))
|
||||
visible_message("\red <B>[M] attempted to touch [src]!</B>")
|
||||
return 0
|
||||
|
||||
switch(M.a_intent)
|
||||
if ("help")
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\blue [M] caresses [src] with its scythe like arm."), 1)
|
||||
if ("grab")
|
||||
if(M == src) return
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
|
||||
G.assailant = M
|
||||
if (M.hand)
|
||||
M.l_hand = G
|
||||
else
|
||||
M.r_hand = G
|
||||
G.layer = 20
|
||||
G.affecting = src
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
|
||||
|
||||
if("hurt")
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/damage = rand(15, 30)
|
||||
if(!damage)
|
||||
playsound(loc, 'slashmiss.ogg', 50, 1, -1)
|
||||
visible_message("\red <B>[M] has lunged at [src]!</B>")
|
||||
return 0
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
|
||||
var/armor_block = run_armor_check(affecting, "melee")
|
||||
|
||||
playsound(loc, 'slice.ogg', 25, 1, -1)
|
||||
visible_message("\red <B>[M] has slashed at [src]!</B>")
|
||||
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
if (damage >= 25)
|
||||
visible_message("\red <B>[M] has wounded [src]!</B>")
|
||||
apply_effect(4, WEAKEN, armor_block)
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
|
||||
if("disarm")
|
||||
var/randn = rand(1, 100)
|
||||
if (randn <= 90)
|
||||
playsound(loc, 'pierce.ogg', 25, 1, -1)
|
||||
if (weakened < 15)
|
||||
weakened = rand(10, 15)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has tackled down []!</B>", M, src), 1)
|
||||
else
|
||||
if (randn <= 99)
|
||||
playsound(loc, 'slash.ogg', 25, 1, -1)
|
||||
drop_item()
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] disarmed []!</B>", M, src), 1)
|
||||
else
|
||||
playsound(loc, 'slashmiss.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("\red <B>[] has tried to disarm []!</B>", M, src), 1)
|
||||
return
|
||||
120
code/modules/mob/living/carbon/human/human_attackhand.dm
Normal file
120
code/modules/mob/living/carbon/human/human_attackhand.dm
Normal file
@@ -0,0 +1,120 @@
|
||||
/mob/living/carbon/human/attack_hand(mob/living/carbon/human/M as mob)
|
||||
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
M << "No attacking people at spawn, you jackass."
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
if(check_shields(0, M.name))
|
||||
visible_message("\red <B>[M] attempted to touch [src]!</B>")
|
||||
return 0
|
||||
|
||||
if((M.gloves && M.gloves.elecgen == 1))
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Stungloved [src.name] ([src.ckey])</font>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been stungloved by [M.name] ([M.ckey])</font>")
|
||||
|
||||
if(M.gloves.uses <= 0)
|
||||
M.gloves.elecgen = 0
|
||||
visible_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>")
|
||||
M << "\red Not enough charge! "
|
||||
return
|
||||
M.gloves.uses--
|
||||
var/armorblock = run_armor_check(M.zone_sel.selecting, "energy")
|
||||
apply_effects(5,5,0,0,5,0,0,armorblock)
|
||||
visible_message("\red <B>[src] has been touched with the stun gloves by [M]!</B>")
|
||||
return 1
|
||||
|
||||
switch(M.a_intent)
|
||||
if("help")
|
||||
if(health > 0)
|
||||
help_shake_act(M)
|
||||
return 1
|
||||
if(M.health < -75) return 0
|
||||
|
||||
if((M.head && (M.head.flags & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags & MASKCOVERSMOUTH)))
|
||||
M << "\blue <B>Remove your mask!</B>"
|
||||
return 0
|
||||
if((head && (head.flags & HEADCOVERSMOUTH)) || (wear_mask && (wear_mask.flags & MASKCOVERSMOUTH)))
|
||||
M << "\blue <B>Remove his mask!</B>"
|
||||
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()
|
||||
return 1
|
||||
|
||||
if("grab")
|
||||
if(M == src) return 0
|
||||
if(w_uniform) w_uniform.add_fingerprint(M)
|
||||
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M)
|
||||
G.assailant = M
|
||||
if (M.hand)
|
||||
M.l_hand = G
|
||||
else
|
||||
M.r_hand = G
|
||||
G.layer = 20
|
||||
G.affecting = src
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("\red [M] has grabbed [src] passively!")
|
||||
return 1
|
||||
|
||||
if("hurt")
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Punched [src.name] ([src.ckey])</font>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been punched by [M.name] ([M.ckey])</font>")
|
||||
|
||||
var/damage = rand(0, 9)
|
||||
if(!damage)
|
||||
playsound(loc, 'punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("\red <B>[M] has attempted to punch [src]!</B>")
|
||||
return 0
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
|
||||
var/armor_block = run_armor_check(affecting, "melee")
|
||||
|
||||
if(M.mutations & HULK) damage += 5
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
|
||||
visible_message("\red <B>[M] has punched [src]!</B>")
|
||||
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
if(damage >= 9)
|
||||
visible_message("\red <B>[M] has weakened [src]!</B>")
|
||||
apply_effect(4, WEAKEN, armor_block)
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
|
||||
|
||||
if("disarm")
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Disarmed [src.name] ([src.ckey])</font>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been disarmed by [M.name] ([M.ckey])</font>")
|
||||
|
||||
if(w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/datum/organ/external/affecting = organs[ran_zone(M.zone_sel.selecting)]
|
||||
var/randn = rand(1, 100)
|
||||
if (randn <= 25)
|
||||
apply_effect(2, WEAKEN, run_armor_check(affecting, "melee"))
|
||||
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("\red <B>[M] has pushed [src]!</B>")
|
||||
return
|
||||
|
||||
if(randn <= 60)
|
||||
drop_item()
|
||||
playsound(loc, 'thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("\red <B>[M] has disarmed [src]!</B>")
|
||||
return
|
||||
|
||||
playsound(loc, 'punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("\red <B>[M] attempted to disarm [src]!</B>")
|
||||
return
|
||||
|
||||
|
||||
25
code/modules/mob/living/carbon/human/human_attackpaw.dm
Normal file
25
code/modules/mob/living/carbon/human/human_attackpaw.dm
Normal file
@@ -0,0 +1,25 @@
|
||||
/mob/living/carbon/human/attack_paw(mob/M as mob)
|
||||
..()
|
||||
if (M.a_intent == "help")
|
||||
help_shake_act(M)
|
||||
else
|
||||
if (istype(wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
return
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
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")
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(dam_zone))
|
||||
var/armor_block = run_armor_check(affecting, "melee")
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
UpdateDamageIcon()
|
||||
|
||||
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
|
||||
80
code/modules/mob/living/carbon/human/human_damage.dm
Normal file
80
code/modules/mob/living/carbon/human/human_damage.dm
Normal file
@@ -0,0 +1,80 @@
|
||||
/mob/living/carbon/human/proc/HealDamage(zone, brute, burn)
|
||||
var/datum/organ/external/E = get_organ(zone)
|
||||
if(istype(E, /datum/organ/external))
|
||||
if (E.heal_damage(brute, burn))
|
||||
UpdateDamageIcon()
|
||||
else
|
||||
UpdateDamage()
|
||||
else
|
||||
return 0
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/UpdateDamage()
|
||||
bruteloss = 0
|
||||
fireloss = 0
|
||||
for(var/datum/organ/external/O in organs)
|
||||
if(istype(O, /datum/organ/external))
|
||||
bruteloss += O.brute_dam
|
||||
fireloss += O.burn_dam
|
||||
return
|
||||
|
||||
// new damage icon system
|
||||
// now constructs damage icon for each organ from mask * damage field
|
||||
|
||||
/mob/living/carbon/human/UpdateDamageIcon()
|
||||
del(body_standing)
|
||||
body_standing = list()
|
||||
del(body_lying)
|
||||
body_lying = list()
|
||||
UpdateDamage()
|
||||
for(var/datum/organ/external/O in organs)
|
||||
if(istype(O, /datum/organ/external))
|
||||
var/icon/DI = new /icon('dam_human.dmi', O.damage_state) // the damage icon for whole human
|
||||
DI.Blend(new /icon('dam_mask.dmi', O.icon_name), ICON_MULTIPLY) // mask with this organ's pixels
|
||||
|
||||
// world << "[O.icon_name] [O.damage_state] \icon[DI]"
|
||||
|
||||
body_standing += DI
|
||||
|
||||
DI = new /icon('dam_human.dmi', "[O.damage_state]-2") // repeat for lying icons
|
||||
DI.Blend(new /icon('dam_mask.dmi', "[O.icon_name]2"), ICON_MULTIPLY)
|
||||
|
||||
// world << "[O.r_name]2 [O.d_i_state]-2 \icon[DI]"
|
||||
|
||||
body_lying += DI
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/get_organ(var/zone)
|
||||
if(!zone) zone = "chest"
|
||||
for(var/datum/organ/external/O in organs)
|
||||
if(O.name == zone)
|
||||
return O
|
||||
return null
|
||||
|
||||
|
||||
/mob/living/carbon/human/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0)
|
||||
if((damagetype != BRUTE) && (damagetype != BURN))
|
||||
..(damage, damagetype, def_zone, blocked)
|
||||
return 1
|
||||
|
||||
if(blocked >= 2) return 0
|
||||
|
||||
var/datum/organ/external/organ = null
|
||||
if(isorgan(def_zone))
|
||||
organ = def_zone
|
||||
else
|
||||
if(!def_zone) def_zone = ran_zone(def_zone)
|
||||
organ = get_organ(check_zone(def_zone))
|
||||
if(!organ) return 0
|
||||
if(blocked)
|
||||
damage = (damage/(blocked+1))
|
||||
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
organ.take_damage(damage, 0)
|
||||
if(BURN)
|
||||
organ.take_damage(0, damage)
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
return 1
|
||||
@@ -8,301 +8,114 @@ emp_act
|
||||
|
||||
*/
|
||||
|
||||
/mob/living/carbon/human/bullet_act(A as obj, var/datum/organ/external/def_zone)
|
||||
//Preparing the var for grabbing the armor information, can't grab the values yet because we don't know what kind of bullet was used. --NEO
|
||||
|
||||
var/obj/item/projectile/P = A//I really don't like how metroids are scattered throughout the code
|
||||
if(prob(80))
|
||||
for(var/mob/living/carbon/metroid/M in view(1,src))
|
||||
if(M.Victim == src)
|
||||
M.bullet_act(A) // the bullet hits them, not src!
|
||||
return
|
||||
|
||||
var/list/hand_held_shields = list("/obj/item/weapon/shield/riot","/obj/item/weapon/melee/energy/sword")
|
||||
if(l_hand)
|
||||
if(is_type_in_list(l_hand, hand_held_shields))//Current base is the prob(50-d/3) Should likely give the things their own block prob
|
||||
if(prob(50 - round(P.damage / 3)))
|
||||
show_message("\red You block the [P.name] with your [l_hand.name]!", 4)
|
||||
if(r_hand)
|
||||
if(is_type_in_list(r_hand, hand_held_shields))
|
||||
if(prob(50 - round(P.damage / 3)))
|
||||
show_message("\red You block the [P.name] with your [l_hand.name]!", 4)
|
||||
|
||||
var/obj/item/weapon/cloaking_device/C = locate((/obj/item/weapon/cloaking_device) in src)
|
||||
if(C)
|
||||
if(C.active)
|
||||
C.attack_self(src)//Should shut it off
|
||||
src << "\blue Your [C.name] was disrupted!"
|
||||
stunned = max(stunned, rand(2,4))//Why in the hell did this use to be 120 para
|
||||
|
||||
var/datum/organ/external/affecting
|
||||
if(!def_zone)
|
||||
var/organ = organs[ran_zone("chest")]
|
||||
if (istype(organ, /datum/organ/external))
|
||||
affecting = organ
|
||||
else
|
||||
affecting = organs["[def_zone]"]
|
||||
|
||||
if(!affecting)
|
||||
return
|
||||
if(locate(/obj/item/weapon/grab, src))
|
||||
var/mob/safe = null
|
||||
if (istype(l_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = l_hand
|
||||
if ((G.state == 3 && get_dir(src, A) == dir))
|
||||
safe = G.affecting
|
||||
if (istype(r_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon.grab/G = r_hand
|
||||
if ((G.state == 3 && get_dir(src, A) == dir))
|
||||
safe = G.affecting
|
||||
if (safe && A)
|
||||
return safe.bullet_act(A)
|
||||
|
||||
var/absorb = 0
|
||||
var/soften = 0
|
||||
|
||||
for(var/i = 1, i<= P.mobdamage.len, i++)
|
||||
|
||||
switch(i)
|
||||
if(1)
|
||||
var/d = P.mobdamage[BRUTE]
|
||||
if(d)
|
||||
var/list/armor = getarmor(affecting, P.flag)
|
||||
if (prob(armor["armor"]))
|
||||
absorb = 1
|
||||
else
|
||||
if(prob(armor["armor"])/2)
|
||||
soften = 1
|
||||
d = d / 2
|
||||
/mob/living/carbon/human/bullet_act(var/obj/item/projectile/P, var/def_zone)
|
||||
if(check_shields(P.damage, "the [P.name]"))
|
||||
P.on_hit(src, 2)
|
||||
return 2
|
||||
return (..())
|
||||
|
||||
|
||||
if(!P.nodamage) affecting.take_damage(d, 0)
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
if(2)
|
||||
var/d = P.mobdamage[BURN]
|
||||
if(d)
|
||||
var/list/armor = getarmor(affecting, P.flag)
|
||||
if (prob(armor["armor"]))
|
||||
absorb = 1
|
||||
else
|
||||
if(prob(armor["armor"])/2)
|
||||
soften = 1
|
||||
d = d / 2
|
||||
|
||||
|
||||
if(!P.nodamage) affecting.take_damage(0, d)
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
if(3)
|
||||
var/d = P.mobdamage[TOX]
|
||||
if(d)
|
||||
var/list/armor = getarmor(affecting, P.flag)
|
||||
if (prob(armor["armor"]))
|
||||
absorb = 1
|
||||
else
|
||||
if(prob(armor["armor"])/2)
|
||||
soften = 1
|
||||
d = d / 2
|
||||
|
||||
|
||||
if(!P.nodamage) toxloss += d
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
if(4)
|
||||
var/d = P.mobdamage[OXY]
|
||||
if(d)
|
||||
var/list/armor = getarmor(affecting, P.flag)
|
||||
if (prob(armor["armor"]))
|
||||
absorb = 1
|
||||
else
|
||||
if(prob(armor["armor"])/2)
|
||||
soften = 1
|
||||
d = d / 2
|
||||
|
||||
|
||||
if(!P.nodamage) oxyloss += d
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
if(5)
|
||||
var/d = P.mobdamage[CLONE]
|
||||
if(d)
|
||||
var/list/armor = getarmor(affecting, P.flag)
|
||||
if (prob(armor["armor"]))
|
||||
absorb = 1
|
||||
else
|
||||
if(prob(armor["armor"])/2)
|
||||
soften = 1
|
||||
d = d / 2
|
||||
|
||||
|
||||
if(!nodamage) cloneloss += d
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////// All the unique projectile stuff goes here ///////////////////
|
||||
|
||||
if(absorb)
|
||||
show_message("\red Your armor absorbs the blow!", 4)
|
||||
return // a projectile can be deflected/absorbed given the right amount of protection
|
||||
if(soften)
|
||||
show_message("\red Your armor only softens the blow!", 4)
|
||||
|
||||
var/nostutter = 0
|
||||
|
||||
if(P.effects["stun"] && prob(P.effectprob["stun"]))
|
||||
var/list/armor = getarmor(affecting, "taser")
|
||||
if (!prob(armor["armor"]))
|
||||
if(P.effectmod["stun"] == SET)
|
||||
stunned = P.effects["stun"]
|
||||
else
|
||||
stunned += P.effects["stun"]
|
||||
else
|
||||
nostutter = 1
|
||||
|
||||
|
||||
if(P.effects["weak"] && prob(P.effectprob["weak"]))
|
||||
if(P.effectmod["weak"] == SET)
|
||||
weakened = P.effects["weak"]
|
||||
else
|
||||
weakened += P.effects["weak"]
|
||||
|
||||
if(P.effects["paralysis"] && prob(P.effectprob["paralysis"]))
|
||||
if(P.effectmod["paralysis"] == SET)
|
||||
paralysis = P.effects["paralysis"]
|
||||
else
|
||||
paralysis += P.effects["paralysis"]
|
||||
|
||||
if(P.effects["stutter"] && prob(P.effectprob["stutter"]) && !nostutter)
|
||||
if(P.effectmod["stutter"] == SET)
|
||||
stuttering = P.effects["stutter"]
|
||||
else
|
||||
stuttering += P.effects["stutter"]
|
||||
|
||||
if(P.effects["drowsyness"] && prob(P.effectprob["drowsyness"]))
|
||||
if(P.effectmod["drowsyness"] == SET)
|
||||
drowsyness = P.effects["drowsyness"]
|
||||
else
|
||||
drowsyness += P.effects["drowsyness"]
|
||||
|
||||
if(P.effects["radiation"] && prob(P.effectprob["radiation"]))
|
||||
var/list/armor = getarmor(affecting, "rad")
|
||||
if (!prob(armor["armor"]))
|
||||
if(P.effectmod["radiation"] == SET)
|
||||
radiation = P.effects["radiation"]
|
||||
else
|
||||
radiation += P.effects["radiation"]
|
||||
|
||||
if(P.effects["eyeblur"] && prob(P.effectprob["eyeblur"]))
|
||||
if(P.effectmod["eyeblur"] == SET)
|
||||
eye_blurry = P.effects["eyeblur"]
|
||||
else
|
||||
eye_blurry += P.effects["eyeblur"]
|
||||
|
||||
if(P.effects["emp"])
|
||||
var/emppulse = P.effects["emp"]
|
||||
if(prob(P.effectprob["emp"]))
|
||||
empulse(src, emppulse, emppulse)
|
||||
else
|
||||
empulse(src, 0, emppulse)
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/getarmor(var/datum/organ/external/def_zone, var/type)
|
||||
/mob/living/carbon/human/getarmor(var/def_zone, var/type)
|
||||
var/armorval = 0
|
||||
var/organnum = 0
|
||||
|
||||
if(def_zone)
|
||||
if(isorgan(def_zone))
|
||||
return checkarmor(def_zone, type)
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(def_zone))
|
||||
return checkarmor(affecting, type)
|
||||
//If a specific bodypart is targetted, check how that bodypart is protected and return the value.
|
||||
|
||||
if(istype(def_zone))
|
||||
return checkarmor(def_zone, type)
|
||||
//If a specific bodypart is targetted, check how that bodypart is protected and return the value. --NEO
|
||||
//If you don't specify a bodypart, it checks ALL your bodyparts for protection, and averages out the values
|
||||
for(var/datum/organ/external/organ in organs)
|
||||
if(istype(organ))
|
||||
armorval += checkarmor(organ, type)
|
||||
organnum++
|
||||
return armorval/max(organnum, 1)
|
||||
|
||||
else
|
||||
//If you don't specify a bodypart, it checks ALL your bodyparts for protection, and averages out the values
|
||||
for(var/organ_name in organs)
|
||||
var/datum/organ/external/organ = organs[organ_name]
|
||||
if (istype(organ))
|
||||
var/list/organarmor = checkarmor(organ, type)
|
||||
armorval += organarmor["armor"]
|
||||
organnum++
|
||||
//world << "Debug text: full body armor check in progress, [organ.name] is best protected against [type] damage by [organarmor["clothes"]], with a value of [organarmor["armor"]]"
|
||||
//world << "Debug text: full body armor check complete, average of [armorval/organnum] protection against [type] damage."
|
||||
return armorval/organnum
|
||||
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/human/proc/checkarmor(var/datum/organ/external/def_zone, var/type)
|
||||
if (!type)
|
||||
return
|
||||
var/obj/item/clothing/best
|
||||
var/armorval = 0
|
||||
|
||||
//I don't really like the way this is coded, but I can't think of a better way to check what they're actually wearing as opposed to something they're holding. --NEO
|
||||
|
||||
if(head && istype(head,/obj/item/clothing))
|
||||
if(def_zone.body_part & head.body_parts_covered)
|
||||
if(head.armor[type] > armorval)
|
||||
armorval = head.armor[type]
|
||||
best = head
|
||||
|
||||
if(wear_mask && istype(wear_mask,/obj/item/clothing))
|
||||
if(def_zone.body_part & wear_mask.body_parts_covered)
|
||||
if(wear_mask.armor[type] > armorval)
|
||||
armorval = wear_mask.armor[type]
|
||||
best = wear_mask
|
||||
|
||||
if(wear_suit && istype(wear_suit,/obj/item/clothing))
|
||||
if(def_zone.body_part & wear_suit.body_parts_covered)
|
||||
if(wear_suit.armor[type] > armorval)
|
||||
armorval = wear_suit.armor[type]
|
||||
best = wear_suit
|
||||
|
||||
if(w_uniform && istype(w_uniform,/obj/item/clothing))
|
||||
if(def_zone.body_part & w_uniform.body_parts_covered)
|
||||
if(w_uniform.armor[type] > armorval)
|
||||
armorval = w_uniform.armor[type]
|
||||
best = w_uniform
|
||||
|
||||
if(shoes && istype(shoes,/obj/item/clothing))
|
||||
if(def_zone.body_part & shoes.body_parts_covered)
|
||||
if(shoes.armor[type] > armorval)
|
||||
armorval = shoes.armor[type]
|
||||
best = shoes
|
||||
|
||||
if(gloves && istype(gloves,/obj/item/clothing))
|
||||
if(def_zone.body_part & gloves.body_parts_covered)
|
||||
if(gloves.armor[type] > armorval)
|
||||
armorval = gloves.armor[type]
|
||||
best = gloves
|
||||
|
||||
var/list/result = list(clothes = best, armor = armorval)
|
||||
return result
|
||||
if(!type) return 0
|
||||
var/protection = 0
|
||||
var/list/body_parts = list(head, wear_mask, wear_suit, w_uniform)
|
||||
for(var/bp in body_parts)
|
||||
if(!bp) continue
|
||||
if(bp && istype(bp ,/obj/item/clothing))
|
||||
var/obj/item/clothing/C = bp
|
||||
if(C.body_parts_covered & def_zone.body_part)
|
||||
protection += C.armor[type]
|
||||
return protection
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/check_shields(var/damage = 0, var/attack_text = "the attack")
|
||||
var/list/hand_held_shields = list("/obj/item/weapon/shield/riot","/obj/item/weapon/melee/energy/sword")
|
||||
if(l_hand && is_type_in_list(l_hand, hand_held_shields))//Current base is the prob(50-d/3)
|
||||
if(prob(50 - round(damage / 3)))
|
||||
show_message("\red You block [attack_text] with your [l_hand.name]!", 4)
|
||||
return 1
|
||||
if(r_hand && is_type_in_list(r_hand, hand_held_shields))
|
||||
if(prob(50 - round(damage / 3)))
|
||||
show_message("\red You block [attack_text] with your [l_hand.name]!", 4)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/mob/living/carbon/human/emp_act(severity)
|
||||
/*if(wear_suit) wear_suit.emp_act(severity)
|
||||
if(w_uniform) w_uniform.emp_act(severity)
|
||||
if(shoes) shoes.emp_act(severity)
|
||||
if(belt) belt.emp_act(severity)
|
||||
if(gloves) gloves.emp_act(severity)
|
||||
if(glasses) glasses.emp_act(severity)
|
||||
if(head) head.emp_act(severity)
|
||||
if(ears) ears.emp_act(severity)
|
||||
if(wear_id) wear_id.emp_act(severity)
|
||||
if(r_store) r_store.emp_act(severity)
|
||||
if(l_store) l_store.emp_act(severity)
|
||||
if(s_store) s_store.emp_act(severity)
|
||||
if(h_store) h_store.emp_act(severity)
|
||||
..()*/
|
||||
for(var/obj/O in src)
|
||||
if(!O) continue
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/attacked_by(var/obj/item/I, var/mob/living/user, var/def_zone)
|
||||
if(!I || !user) return 0
|
||||
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(user.zone_sel.selecting))
|
||||
var/hit_area = parse_zone(affecting.name)
|
||||
|
||||
visible_message("\red <B>[src] has been attacked in the [hit_area] with [I.name] by [user]!</B>")
|
||||
|
||||
if(check_shields(I.force, "the [I.name]"))
|
||||
world << "SHIELDS"
|
||||
return 0
|
||||
var/armor = run_armor_check(affecting, "melee", "Your armor has protected you from a hit to the [hit_area].", "Your armor has softened hit to your [hit_area].")
|
||||
if(armor >= 2) return 0
|
||||
apply_damage(I.force, I.damtype, affecting, armor)
|
||||
|
||||
var/bloody = 0
|
||||
if((I.damtype == BRUTE) && prob(25 + (I.force * 2)))
|
||||
src.add_blood(src)
|
||||
if(prob(33))
|
||||
bloody = 1
|
||||
var/turf/location = loc
|
||||
if(istype(location, /turf/simulated))
|
||||
location.add_blood(src)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.gloves) H.gloves.add_blood(src)
|
||||
else H.add_blood(src)
|
||||
if(H.wear_suit) H.wear_suit.add_blood(src)
|
||||
else if(H.w_uniform) H.w_uniform.add_blood(src)
|
||||
|
||||
switch(hit_area)
|
||||
if("head")//Harder to score a stun but if you do it lasts a bit longer
|
||||
if(prob(I.force))
|
||||
apply_effect(20, PARALYZE, armor)
|
||||
visible_message("\red <B>[src] has been knocked unconscious!</B>")
|
||||
if(src != user)
|
||||
ticker.mode.remove_revolutionary(mind)
|
||||
|
||||
if(bloody)//Apply blood
|
||||
if(wear_mask) wear_mask.add_blood(src)
|
||||
if(head) head.add_blood(src)
|
||||
if(glasses && prob(33)) glasses.add_blood(src)
|
||||
|
||||
if("chest")//Easier to score a stun but lasts less time
|
||||
if(prob((I.force + 10)))
|
||||
apply_effect(5, WEAKEN, armor)
|
||||
visible_message("\red <B>[src] has been knocked down!</B>")
|
||||
|
||||
if(bloody)
|
||||
if(src.wear_suit) src.wear_suit.add_blood(src)
|
||||
if(src.w_uniform) src.w_uniform.add_blood(src)
|
||||
src.UpdateDamageIcon()
|
||||
@@ -6,7 +6,7 @@
|
||||
//Do we have a working jetpack
|
||||
if(istype(back, /obj/item/weapon/tank/jetpack))
|
||||
var/obj/item/weapon/tank/jetpack/J = back
|
||||
if(J.allow_thrust(0.01, src))
|
||||
if(J.allow_thrust(0.005, src))
|
||||
inertia_dir = 0
|
||||
return 1
|
||||
|
||||
|
||||
@@ -576,23 +576,15 @@
|
||||
|
||||
switch(body_part)
|
||||
if(HEAD)
|
||||
TakeDamage("head", 0, 2.5*discomfort)
|
||||
apply_damage(2.5*discomfort, BURN, "head")
|
||||
if(UPPER_TORSO)
|
||||
TakeDamage("chest", 0, 2.5*discomfort)
|
||||
if(LOWER_TORSO)
|
||||
TakeDamage("groin", 0, 2.0*discomfort)
|
||||
apply_damage(2.5*discomfort, BURN, "chest")
|
||||
if(LEGS)
|
||||
TakeDamage("l_leg", 0, 0.6*discomfort)
|
||||
TakeDamage("r_leg", 0, 0.6*discomfort)
|
||||
apply_damage(0.6*discomfort, BURN, "l_leg")
|
||||
apply_damage(0.6*discomfort, BURN, "r_leg")
|
||||
if(ARMS)
|
||||
TakeDamage("l_arm", 0, 0.4*discomfort)
|
||||
TakeDamage("r_arm", 0, 0.4*discomfort)
|
||||
if(FEET)
|
||||
TakeDamage("l_foot", 0, 0.25*discomfort)
|
||||
TakeDamage("r_foot", 0, 0.25*discomfort)
|
||||
if(HANDS)
|
||||
TakeDamage("l_hand", 0, 0.25*discomfort)
|
||||
TakeDamage("r_hand", 0, 0.25*discomfort)
|
||||
apply_damage(0.4*discomfort, BURN, "l_arm")
|
||||
apply_damage(0.4*discomfort, BURN, "r_arm")
|
||||
|
||||
handle_chemicals_in_body()
|
||||
if(reagents) reagents.metabolize(src)
|
||||
@@ -659,7 +651,7 @@
|
||||
|
||||
handle_regular_status_updates()
|
||||
|
||||
health = 100 - (oxyloss + toxloss + fireloss + bruteloss + cloneloss)
|
||||
// health = 100 - (oxyloss + toxloss + fireloss + bruteloss + cloneloss)
|
||||
|
||||
if(oxyloss > 50) paralysis = max(paralysis, 3)
|
||||
|
||||
@@ -669,7 +661,7 @@
|
||||
sleeping--
|
||||
|
||||
if(resting)
|
||||
weakened = max(weakened, 5)
|
||||
weakened = max(weakened, 3)
|
||||
|
||||
if(health < -100 || brain_op_stage == 4.0)
|
||||
death()
|
||||
|
||||
@@ -140,62 +140,9 @@
|
||||
|
||||
|
||||
/mob/living/carbon/metroid/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj)
|
||||
if (locate(/obj/item/weapon/grab, src))
|
||||
var/mob/safe = null
|
||||
if (istype(l_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = l_hand
|
||||
if ((G.state == 3 && get_dir(src, Proj) == dir))
|
||||
safe = G.affecting
|
||||
if (istype(r_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon.grab/G = r_hand
|
||||
if ((G.state == 3 && get_dir(src, Proj) == dir))
|
||||
safe = G.affecting
|
||||
if (safe)
|
||||
return safe.bullet_act(Proj)
|
||||
|
||||
attacked += 10
|
||||
for(var/i = 1, i<= Proj.mobdamage.len, i++)
|
||||
|
||||
switch(i)
|
||||
if(1)
|
||||
var/d = Proj.mobdamage[BRUTE]
|
||||
if(!Proj.nodamage) bruteloss += d
|
||||
updatehealth()
|
||||
if(2)
|
||||
var/d = Proj.mobdamage[BURN]
|
||||
if(!Proj.nodamage) fireloss += d
|
||||
updatehealth()
|
||||
if(3)
|
||||
var/d = Proj.mobdamage[TOX]
|
||||
if(!Proj.nodamage) toxloss += d
|
||||
updatehealth()
|
||||
if(4)
|
||||
var/d = Proj.mobdamage[OXY]
|
||||
if(!Proj.nodamage) oxyloss += d
|
||||
updatehealth()
|
||||
if(5)
|
||||
var/d = Proj.mobdamage[CLONE]
|
||||
if(!Proj.nodamage) cloneloss += d
|
||||
updatehealth()
|
||||
|
||||
|
||||
if(Proj.flag == "taser" && prob(35))
|
||||
// Metroids have a small chance of "absorbing" taser shots. Deal /w it
|
||||
powerlevel++
|
||||
src << "<i>I have absorbed the electrode projectile...</i>"
|
||||
|
||||
// K
|
||||
// ~~~~ N
|
||||
// Metroids aren't effected by extra status effect. DO NOT NERF THIS PLZ THNX - LOVE, DOOHL 3===========D ~~~~ HONK
|
||||
// ~~~~ H
|
||||
//EMP is special and yes they are because emp
|
||||
if(Proj.effects["emp"])
|
||||
var/emppulse = Proj.effects["emp"]
|
||||
if(prob(Proj.effectprob["emp"]))
|
||||
empulse(src, emppulse, emppulse)
|
||||
else
|
||||
empulse(src, 0, emppulse)
|
||||
..(Proj)
|
||||
return 0
|
||||
|
||||
|
||||
/mob/living/carbon/metroid/emp_act(severity)
|
||||
|
||||
@@ -106,89 +106,7 @@
|
||||
health = 100 - oxyloss - toxloss - fireloss - bruteloss
|
||||
return
|
||||
|
||||
/mob/living/carbon/monkey/bullet_act(var/obj/item/projectile/Proj)
|
||||
|
||||
if(prob(80))
|
||||
for(var/mob/living/carbon/metroid/M in view(1,src))
|
||||
if(M.Victim == src)
|
||||
M.bullet_act(Proj)
|
||||
return
|
||||
|
||||
for(var/i = 1, i<= Proj.mobdamage.len, i++)
|
||||
|
||||
switch(i)
|
||||
if(1)
|
||||
var/d = Proj.mobdamage[BRUTE]
|
||||
if(!Proj.nodamage) src.take_organ_damage(d)
|
||||
updatehealth()
|
||||
if(2)
|
||||
var/d = Proj.mobdamage[BURN]
|
||||
if(!Proj.nodamage) src.take_organ_damage(0, d)
|
||||
updatehealth()
|
||||
if(3)
|
||||
var/d = Proj.mobdamage[TOX]
|
||||
if(!Proj.nodamage) toxloss += d
|
||||
updatehealth()
|
||||
if(4)
|
||||
var/d = Proj.mobdamage[OXY]
|
||||
if(!Proj.nodamage) oxyloss += d
|
||||
updatehealth()
|
||||
if(5)
|
||||
var/d = Proj.mobdamage[CLONE]
|
||||
if(!Proj.nodamage) cloneloss += d
|
||||
updatehealth()
|
||||
|
||||
if(Proj.effects["stun"] && prob(Proj.effectprob["stun"]))
|
||||
if(Proj.effectmod["stun"] == SET)
|
||||
stunned = Proj.effects["stun"]
|
||||
else
|
||||
stunned += Proj.effects["stun"]
|
||||
|
||||
|
||||
if(Proj.effects["weak"] && prob(Proj.effectprob["weak"]))
|
||||
if(Proj.effectmod["weak"] == SET)
|
||||
weakened = Proj.effects["weak"]
|
||||
else
|
||||
weakened += Proj.effects["weak"]
|
||||
|
||||
if(Proj.effects["paralysis"] && prob(Proj.effectprob["paralysis"]))
|
||||
if(Proj.effectmod["paralysis"] == SET)
|
||||
paralysis = Proj.effects["paralysis"]
|
||||
else
|
||||
paralysis += Proj.effects["paralysis"]
|
||||
|
||||
if(Proj.effects["stutter"] && prob(Proj.effectprob["stutter"]))
|
||||
if(Proj.effectmod["stutter"] == SET)
|
||||
stuttering = Proj.effects["stutter"]
|
||||
else
|
||||
stuttering += Proj.effects["stutter"]
|
||||
|
||||
if(Proj.effects["drowsyness"] && prob(Proj.effectprob["drowsyness"]))
|
||||
if(Proj.effectmod["drowsyness"] == SET)
|
||||
drowsyness = Proj.effects["drowsyness"]
|
||||
else
|
||||
drowsyness += Proj.effects["drowsyness"]
|
||||
|
||||
if(Proj.effects["radiation"] && prob(Proj.effectprob["radiation"]))
|
||||
if(Proj.effectmod["radiation"] == SET)
|
||||
radiation = Proj.effects["radiation"]
|
||||
else
|
||||
radiation += Proj.effects["radiation"]
|
||||
|
||||
if(Proj.effects["eyeblur"] && prob(Proj.effectprob["eyeblur"]))
|
||||
if(Proj.effectmod["eyeblur"] == SET)
|
||||
eye_blurry = Proj.effects["eyeblur"]
|
||||
else
|
||||
eye_blurry += Proj.effects["eyeblur"]
|
||||
|
||||
if(Proj.effects["emp"])
|
||||
var/emppulse = Proj.effects["emp"]
|
||||
if(prob(Proj.effectprob["emp"]))
|
||||
empulse(src, emppulse, emppulse)
|
||||
else
|
||||
empulse(src, 0, emppulse)
|
||||
|
||||
return
|
||||
//mob/living/carbon/monkey/bullet_act(var/obj/item/projectile/Proj)taken care of in living
|
||||
|
||||
/mob/living/carbon/monkey/hand_p(mob/M as mob)
|
||||
if ((M.a_intent == "hurt" && !( istype(wear_mask, /obj/item/clothing/mask/muzzle) )))
|
||||
|
||||
72
code/modules/mob/living/damage_procs.dm
Normal file
72
code/modules/mob/living/damage_procs.dm
Normal file
@@ -0,0 +1,72 @@
|
||||
|
||||
/*
|
||||
apply_damage(a,b,c)
|
||||
args
|
||||
a:damage - How much damage to take
|
||||
b:damage_type - What type of damage to take, brute, burn
|
||||
c:def_zone - Where to take the damage if its brute or burn
|
||||
Returns
|
||||
standard 0 if fail
|
||||
*/
|
||||
/mob/living/proc/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0)
|
||||
if(!damage || (blocked >= 2)) return 0
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
bruteloss += (damage/(blocked+1))
|
||||
if(BURN)
|
||||
if(mutations & COLD_RESISTANCE) damage = 0
|
||||
fireloss += (damage/(blocked+1))
|
||||
if(TOX)
|
||||
toxloss += (damage/(blocked+1))
|
||||
if(OXY)
|
||||
oxyloss += (damage/(blocked+1))
|
||||
if(CLONE)
|
||||
cloneloss += (damage/(blocked+1))
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/proc/apply_damages(var/brute = 0, var/burn = 0, var/tox = 0, var/oxy = 0, var/clone = 0, var/def_zone = null, var/blocked = 0)
|
||||
if(blocked >= 2) return 0
|
||||
if(brute) apply_damage(brute, BRUTE, def_zone, blocked)
|
||||
if(burn) apply_damage(burn, BURN, def_zone, blocked)
|
||||
if(tox) apply_damage(tox, TOX, def_zone, blocked)
|
||||
if(oxy) apply_damage(oxy, OXY, def_zone, blocked)
|
||||
if(clone) apply_damage(clone, CLONE, def_zone, blocked)
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/mob/living/proc/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0)
|
||||
if(!effect || (blocked >= 2)) return 0
|
||||
switch(effecttype)
|
||||
if(STUN)
|
||||
stunned = max(stunned,(effect/(blocked+1)))
|
||||
if(WEAKEN)
|
||||
weakened = max(weakened,(effect/(blocked+1)))
|
||||
if(PARALYZE)
|
||||
paralysis = max(paralysis,(effect/(blocked+1)))
|
||||
if(IRRADIATE)
|
||||
radiation += min((effect - (effect*getarmor(null, "rad"))), 0)//Rads auto check armor
|
||||
if(STUTTER)
|
||||
stuttering = max(stuttering,(effect/(blocked+1)))
|
||||
if(EYE_BLUR)
|
||||
eye_blurry = max(eye_blurry,(effect/(blocked+1)))
|
||||
if(DROWSY)
|
||||
drowsyness = max(drowsyness,(effect/(blocked+1)))
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/proc/apply_effects(var/stun = 0, var/weaken = 0, var/paralyze = 0, var/irradiate = 0, var/stutter = 0, var/eyeblur = 0, var/drowsy = 0, var/blocked = 0)
|
||||
if(blocked >= 2) return 0
|
||||
if(stun) apply_effect(stun, STUN, blocked)
|
||||
if(weaken) apply_effect(weaken, WEAKEN, blocked)
|
||||
if(paralyze) apply_effect(paralyze, PARALYZE, blocked)
|
||||
if(irradiate) apply_effect(irradiate, IRRADIATE, blocked)
|
||||
if(stutter) apply_effect(stutter, STUTTER, blocked)
|
||||
if(eyeblur) apply_effect(eyeblur, EYE_BLUR, blocked)
|
||||
if(drowsy) apply_effect(drowsy, DROWSY, blocked)
|
||||
return 1
|
||||
@@ -1,105 +1,19 @@
|
||||
/mob/living/verb/succumb()
|
||||
set hidden = 1
|
||||
|
||||
if ((src.health < 0 && src.health > -95.0))
|
||||
src.oxyloss += src.health + 200
|
||||
src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.bruteloss
|
||||
src << "\blue You have given up life and succumbed to death."
|
||||
|
||||
|
||||
/mob/living/bullet_act(var/obj/item/projectile/Proj)
|
||||
|
||||
for(var/i = 1, i<= Proj.mobdamage.len, i++)
|
||||
|
||||
switch(i)
|
||||
if(1)
|
||||
if (istype(src, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = src
|
||||
var/dam_zone = pick("chest", "chest", "chest", "groin", "head")
|
||||
if (H.organs[text("[]", dam_zone)])
|
||||
var/datum/organ/external/affecting = H.organs[text("[]", dam_zone)]
|
||||
if (affecting.take_damage(Proj.mobdamage[BRUTE], 0))
|
||||
H.UpdateDamageIcon()
|
||||
else
|
||||
H.UpdateDamage()
|
||||
src.updatehealth()
|
||||
|
||||
else
|
||||
if(!nodamage) src.take_organ_damage(Proj.mobdamage[BRUTE])
|
||||
|
||||
if(2)
|
||||
var/d = Proj.mobdamage[BURN]
|
||||
if(!Proj.nodamage) fireloss += d
|
||||
updatehealth()
|
||||
if(3)
|
||||
var/d = Proj.mobdamage[TOX]
|
||||
if(!Proj.nodamage) toxloss += d
|
||||
updatehealth()
|
||||
if(4)
|
||||
var/d = Proj.mobdamage[OXY]
|
||||
if(!Proj.nodamage) oxyloss += d
|
||||
updatehealth()
|
||||
if(5)
|
||||
var/d = Proj.mobdamage[CLONE]
|
||||
if(!Proj.nodamage) cloneloss += d
|
||||
updatehealth()
|
||||
|
||||
if(Proj.effects["stun"] && prob(Proj.effectprob["stun"]))
|
||||
if(Proj.effectmod["stun"] == SET)
|
||||
stunned = Proj.effects["stun"]
|
||||
else
|
||||
stunned += Proj.effects["stun"]
|
||||
|
||||
|
||||
if(Proj.effects["weak"] && prob(Proj.effectprob["weak"]))
|
||||
if(Proj.effectmod["weak"] == SET)
|
||||
weakened = Proj.effects["weak"]
|
||||
else
|
||||
weakened += Proj.effects["weak"]
|
||||
|
||||
if(Proj.effects["paralysis"] && prob(Proj.effectprob["paralysis"]))
|
||||
if(Proj.effectmod["paralysis"] == SET)
|
||||
paralysis = Proj.effects["paralysis"]
|
||||
else
|
||||
paralysis += Proj.effects["paralysis"]
|
||||
|
||||
if(Proj.effects["stutter"] && prob(Proj.effectprob["stutter"]))
|
||||
if(Proj.effectmod["stutter"] == SET)
|
||||
stuttering = Proj.effects["stutter"]
|
||||
else
|
||||
stuttering += Proj.effects["stutter"]
|
||||
|
||||
if(Proj.effects["drowsyness"] && prob(Proj.effectprob["drowsyness"]))
|
||||
if(Proj.effectmod["drowsyness"] == SET)
|
||||
drowsyness = Proj.effects["drowsyness"]
|
||||
else
|
||||
drowsyness += Proj.effects["drowsyness"]
|
||||
|
||||
if(Proj.effects["radiation"] && prob(Proj.effectprob["radiation"]))
|
||||
if(Proj.effectmod["radiation"] == SET)
|
||||
radiation = Proj.effects["radiation"]
|
||||
else
|
||||
radiation += Proj.effects["radiation"]
|
||||
|
||||
if(Proj.effects["eyeblur"] && prob(Proj.effectprob["eyeblur"]))
|
||||
if(Proj.effectmod["eyeblur"] == SET)
|
||||
eye_blurry = Proj.effects["eyeblur"]
|
||||
else
|
||||
eye_blurry += Proj.effects["eyeblur"]
|
||||
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/proc/updatehealth()
|
||||
if (!src.nodamage)
|
||||
if(organStructure && organStructure.chest)
|
||||
health = organStructure.chest.maxHealth - oxyloss - toxloss - fireloss - bruteloss
|
||||
else
|
||||
src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.bruteloss - src.cloneloss
|
||||
if(!src.nodamage)
|
||||
src.health = 100 - src.oxyloss - src.toxloss - src.fireloss - src.bruteloss - src.cloneloss
|
||||
else
|
||||
src.health = 100
|
||||
src.stat = 0
|
||||
|
||||
|
||||
//sort of a legacy burn method for /electrocute, /shock, and the e_chair
|
||||
/mob/living/proc/burn_skin(burn_amount)
|
||||
if(istype(src, /mob/living/carbon/human))
|
||||
@@ -236,4 +150,7 @@
|
||||
src.handcuffed = initial(src.handcuffed)
|
||||
if(src.stat > 1) src.stat=0
|
||||
..()
|
||||
return
|
||||
return
|
||||
|
||||
/mob/living/proc/UpdateDamageIcon()
|
||||
return
|
||||
53
code/modules/mob/living/living_defense.dm
Normal file
53
code/modules/mob/living/living_defense.dm
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
/*
|
||||
run_armor_check(a,b)
|
||||
args
|
||||
a:def_zone - What part is getting hit, if null will check entire body
|
||||
b:attack_flag - What type of attack, bullet, laser, energy, melee
|
||||
|
||||
Returns
|
||||
0 - no block
|
||||
1 - halfblock
|
||||
2 - fullblock
|
||||
*/
|
||||
/mob/living/proc/run_armor_check(var/def_zone = null, var/attack_flag = "melee", var/absorb_text = null, var/soften_text = null)
|
||||
var/armor = getarmor(def_zone, attack_flag)
|
||||
var/absorb = 0
|
||||
if(prob(armor))
|
||||
absorb += 1
|
||||
if(prob(armor))
|
||||
absorb += 1
|
||||
if(absorb >= 2)
|
||||
if(absorb_text)
|
||||
show_message("[absorb_text]")
|
||||
else
|
||||
show_message("\red Your armor absorbs the blow!")
|
||||
return 2
|
||||
if(absorb == 1)
|
||||
if(absorb_text)
|
||||
show_message("[soften_text]",4)
|
||||
else
|
||||
show_message("\red Your armor softens the blow!")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/mob/living/proc/getarmor(var/def_zone, var/type)
|
||||
return 0
|
||||
|
||||
|
||||
/mob/living/bullet_act(var/obj/item/projectile/P, var/def_zone)
|
||||
var/obj/item/weapon/cloaking_device/C = locate((/obj/item/weapon/cloaking_device) in src)
|
||||
if(C && C.active)
|
||||
C.attack_self(src)//Should shut it off
|
||||
src << "\blue Your [C.name] was disrupted!"
|
||||
stunned = max(stunned, 2)
|
||||
|
||||
var/absorb = run_armor_check(def_zone, P.flag)
|
||||
if(absorb >= 2)
|
||||
P.on_hit(src,2)
|
||||
return 2
|
||||
if(!P.nodamage)
|
||||
apply_damage((P.damage/(absorb+1)), P.damage_type)
|
||||
P.on_hit(src, absorb)
|
||||
return absorb
|
||||
@@ -276,19 +276,9 @@
|
||||
return
|
||||
|
||||
/mob/living/silicon/ai/bullet_act(var/obj/item/projectile/Proj)
|
||||
|
||||
// AI bullet code is pretty simple. No other effect really need to be added.
|
||||
if(!Proj.nodamage) bruteloss += Proj.damage
|
||||
|
||||
if(Proj.effects["emp"])
|
||||
var/emppulse = Proj.effects["emp"]
|
||||
if(prob(Proj.effectprob["emp"]))
|
||||
empulse(src, emppulse, emppulse)
|
||||
else
|
||||
empulse(src, 0, emppulse)
|
||||
|
||||
..(Proj)
|
||||
updatehealth()
|
||||
|
||||
return 2
|
||||
|
||||
/mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
if (!ticker)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
T.hologram.dir = direct
|
||||
return//Relay move and then return if that's the case.
|
||||
|
||||
if(!old) return
|
||||
if(!old) return
|
||||
|
||||
var/dx = 0
|
||||
var/dy = 0
|
||||
@@ -43,16 +43,8 @@
|
||||
var/list/old_types = dd_text2list("[A.type]", "/")
|
||||
|
||||
for(var/obj/machinery/camera/current in world)
|
||||
if(user.network != current.network)
|
||||
continue // different network (syndicate)
|
||||
if(ticker.mode.name == "AI malfunction")
|
||||
if(current.z != user.z && (user.network != "Prison") && (user.network != "SS13"))
|
||||
continue
|
||||
else
|
||||
if(current.z != user.z && (user.network != "Prison") && (user.network != "AI Satellite"))
|
||||
continue // different viewing plane
|
||||
if(!current.status)
|
||||
continue // ignore disabled cameras
|
||||
if(user.network != current.network) continue
|
||||
if(!current.status) continue // ignore disabled cameras
|
||||
|
||||
//make sure it's the right direction
|
||||
if(dx && (current.x * dx <= old.x * dx))
|
||||
|
||||
@@ -114,18 +114,7 @@
|
||||
src.updatehealth()
|
||||
return
|
||||
|
||||
/mob/living/silicon/pai/bullet_act(var/obj/item/projectile/Proj)
|
||||
|
||||
bruteloss += Proj.damage
|
||||
if(Proj.effects["emp"])
|
||||
var/emppulse = Proj.effects["emp"]
|
||||
if(prob(Proj.effectprob["emp"]))
|
||||
empulse(src, emppulse, emppulse)
|
||||
else
|
||||
empulse(src, 0, emppulse)
|
||||
updatehealth()
|
||||
|
||||
return
|
||||
//mob/living/silicon/pai/bullet_act(var/obj/item/projectile/Proj)
|
||||
|
||||
/mob/living/silicon/pai/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
if (!ticker)
|
||||
|
||||
@@ -59,12 +59,6 @@
|
||||
src.cell.use(5)
|
||||
if(src.module_state_3)
|
||||
src.cell.use(5)
|
||||
if (sight_mode & BORGMESON)
|
||||
src.cell.use(50)
|
||||
if (sight_mode & BORGTHERM)
|
||||
src.cell.use(100)
|
||||
if (sight_mode & BORGXRAY)
|
||||
src.cell.use(200)
|
||||
src.cell.use(1)
|
||||
src.blinded = 0
|
||||
src.stat = 0
|
||||
|
||||
@@ -247,18 +247,10 @@
|
||||
|
||||
|
||||
/mob/living/silicon/robot/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!Proj.nodamage) bruteloss += Proj.damage
|
||||
|
||||
if(Proj.effects["emp"])
|
||||
var/emppulse = Proj.effects["emp"]
|
||||
if(prob(Proj.effectprob["emp"]))
|
||||
empulse(src, emppulse, emppulse)
|
||||
else
|
||||
empulse(src, 0, emppulse)
|
||||
|
||||
..(Proj)
|
||||
updatehealth()
|
||||
if(prob(75) && Proj.damage > 0) spark_system.start()
|
||||
return
|
||||
return 2
|
||||
|
||||
|
||||
/mob/living/silicon/robot/Bump(atom/movable/AM as mob|obj, yes)
|
||||
@@ -316,7 +308,7 @@
|
||||
C = O
|
||||
L[A.name] = list(A, (C) ? C : O, list(alarmsource))
|
||||
src << text("--- [class] alarm detected in [A.name]!")
|
||||
if (viewalerts) robot_alerts()
|
||||
// if (viewalerts) robot_alerts()
|
||||
return 1
|
||||
|
||||
|
||||
@@ -334,7 +326,7 @@
|
||||
L -= I
|
||||
if (cleared)
|
||||
src << text("--- [class] alarm in [A.name] has been cleared.")
|
||||
if (viewalerts) robot_alerts()
|
||||
// if (viewalerts) robot_alerts()
|
||||
return !cleared
|
||||
|
||||
|
||||
|
||||
@@ -226,7 +226,6 @@ obj/item/weapon/robot_module/syndicate
|
||||
*/ //Merged with Service borg, not a death, just a transformation
|
||||
|
||||
obj/item/weapon/robot_module/syndicate/New()
|
||||
src.modules += new /obj/item/weapon/gun/energy/crossbow/cyborg(src)
|
||||
src.modules += new /obj/item/weapon/card/emag(src)
|
||||
|
||||
|
||||
|
||||
@@ -24,4 +24,32 @@
|
||||
return
|
||||
|
||||
/mob/living/silicon/IsAdvancedToolUser()
|
||||
return 1
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!Proj.nodamage) bruteloss += Proj.damage
|
||||
Proj.on_hit(src,2)
|
||||
return 2
|
||||
|
||||
/mob/living/silicon/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0)
|
||||
return 0//The only effect that can hit them atm is flashes and they still directly edit so this works for now
|
||||
/*
|
||||
if(!effect || (blocked >= 2)) return 0
|
||||
switch(effecttype)
|
||||
if(STUN)
|
||||
stunned = max(stunned,(effect/(blocked+1)))
|
||||
if(WEAKEN)
|
||||
weakened = max(weakened,(effect/(blocked+1)))
|
||||
if(PARALYZE)
|
||||
paralysis = max(paralysis,(effect/(blocked+1)))
|
||||
if(IRRADIATE)
|
||||
radiation += min((effect - (effect*getarmor(null, "rad"))), 0)//Rads auto check armor
|
||||
if(STUTTER)
|
||||
stuttering = max(stuttering,(effect/(blocked+1)))
|
||||
if(EYE_BLUR)
|
||||
eye_blurry = max(eye_blurry,(effect/(blocked+1)))
|
||||
if(DROWSY)
|
||||
drowsyness = max(drowsyness,(effect/(blocked+1)))
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
return 1*/
|
||||
File diff suppressed because it is too large
Load Diff
222
code/modules/mob/mob_grab.dm
Normal file
222
code/modules/mob/mob_grab.dm
Normal file
@@ -0,0 +1,222 @@
|
||||
/obj/item/weapon/grab
|
||||
name = "grab"
|
||||
icon = 'screen1.dmi'
|
||||
icon_state = "grabbed"
|
||||
var/obj/screen/grab/hud1 = null
|
||||
var/mob/affecting = null
|
||||
var/mob/assailant = null
|
||||
var/state = 1.0
|
||||
var/killing = 0.0
|
||||
var/allow_upgrade = 1.0
|
||||
var/last_suffocate = 1.0
|
||||
layer = 21
|
||||
abstract = 1.0
|
||||
item_state = "nothing"
|
||||
w_class = 5.0
|
||||
|
||||
|
||||
/obj/item/weapon/grab/proc/throw()
|
||||
if(affecting)
|
||||
var/grabee = affecting
|
||||
spawn(0)
|
||||
del(src)
|
||||
return grabee
|
||||
return null
|
||||
|
||||
|
||||
/obj/item/weapon/grab/proc/synch()
|
||||
if(affecting.anchored)//This will prevent from grabbing people that are anchored.
|
||||
del(src)
|
||||
if (assailant.r_hand == src)
|
||||
hud1.screen_loc = ui_rhand
|
||||
else
|
||||
hud1.screen_loc = ui_lhand
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/grab/process()
|
||||
if(!assailant || !affecting)
|
||||
del(src)
|
||||
return
|
||||
if ((!( isturf(assailant.loc) ) || (!( isturf(affecting.loc) ) || (assailant.loc != affecting.loc && get_dist(assailant, affecting) > 1))))
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if (assailant.client)
|
||||
assailant.client.screen -= hud1
|
||||
assailant.client.screen += hud1
|
||||
if (assailant.pulling == affecting)
|
||||
assailant.pulling = null
|
||||
if (state <= 2)
|
||||
allow_upgrade = 1
|
||||
if ((assailant.l_hand && assailant.l_hand != src && istype(assailant.l_hand, /obj/item/weapon/grab)))
|
||||
var/obj/item/weapon/grab/G = assailant.l_hand
|
||||
if (G.affecting != affecting)
|
||||
allow_upgrade = 0
|
||||
if ((assailant.r_hand && assailant.r_hand != src && istype(assailant.r_hand, /obj/item/weapon/grab)))
|
||||
var/obj/item/weapon/grab/G = assailant.r_hand
|
||||
if (G.affecting != affecting)
|
||||
allow_upgrade = 0
|
||||
if (state == 2)
|
||||
var/h = affecting.hand
|
||||
affecting.hand = 0
|
||||
affecting.drop_item()
|
||||
affecting.hand = 1
|
||||
affecting.drop_item()
|
||||
affecting.hand = h
|
||||
for(var/obj/item/weapon/grab/G in affecting.grabbed_by)
|
||||
if (G.state == 2)
|
||||
allow_upgrade = 0
|
||||
//Foreach goto(341)
|
||||
if (allow_upgrade)
|
||||
hud1.icon_state = "reinforce"
|
||||
else
|
||||
hud1.icon_state = "!reinforce"
|
||||
else
|
||||
if (!( affecting.buckled ))
|
||||
affecting.loc = assailant.loc
|
||||
if ((killing && state == 3))
|
||||
affecting.stunned = max(5, affecting.stunned)
|
||||
affecting.paralysis = max(3, affecting.paralysis)
|
||||
affecting.losebreath = min(affecting.losebreath + 2, 3)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/grab/proc/s_click(obj/screen/S as obj)
|
||||
if (assailant.next_move > world.time)
|
||||
return
|
||||
if ((!( assailant.canmove ) || assailant.lying))
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
switch(S.id)
|
||||
if(1.0)
|
||||
if (state >= 3)
|
||||
if (!( killing ))
|
||||
for(var/mob/O in viewers(assailant, null))
|
||||
O.show_message(text("\red [] has temporarily tightened his grip on []!", assailant, affecting), 1)
|
||||
//Foreach goto(97)
|
||||
assailant.next_move = world.time + 10
|
||||
//affecting.stunned = max(2, affecting.stunned)
|
||||
//affecting.paralysis = max(1, affecting.paralysis)
|
||||
affecting.losebreath = min(affecting.losebreath + 1, 3)
|
||||
last_suffocate = world.time
|
||||
flick("disarm/killf", S)
|
||||
else
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/grab/proc/s_dbclick(obj/screen/S as obj)
|
||||
//if ((assailant.next_move > world.time && !( last_suffocate < world.time + 2 )))
|
||||
// return
|
||||
if ((!( assailant.canmove ) || assailant.lying))
|
||||
del(src)
|
||||
return
|
||||
switch(S.id)
|
||||
if(1.0)
|
||||
if (state < 2)
|
||||
if (!( allow_upgrade ))
|
||||
return
|
||||
if (prob(75))
|
||||
for(var/mob/O in viewers(assailant, null))
|
||||
O.show_message(text("\red [] has grabbed [] aggressively (now hands)!", assailant, affecting), 1)
|
||||
state = 2
|
||||
icon_state = "grabbed1"
|
||||
else
|
||||
for(var/mob/O in viewers(assailant, null))
|
||||
O.show_message(text("\red [] has failed to grab [] aggressively!", assailant, affecting), 1)
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
if (state < 3)
|
||||
if(istype(affecting, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = affecting
|
||||
if(H.mutations & FAT)
|
||||
assailant << "\blue You can't strangle [affecting] through all that fat!"
|
||||
return
|
||||
|
||||
/*Hrm might want to add this back in
|
||||
//we should be able to strangle the Captain if he is wearing a hat
|
||||
for(var/obj/item/clothing/C in list(H.head, H.wear_suit, H.wear_mask, H.w_uniform))
|
||||
if(C.body_parts_covered & HEAD)
|
||||
assailant << "\blue You have to take off [affecting]'s [C.name] first!"
|
||||
return
|
||||
|
||||
if(istype(H.wear_suit, /obj/item/clothing/suit/space) || istype(H.wear_suit, /obj/item/clothing/suit/armor) || istype(H.wear_suit, /obj/item/clothing/suit/bio_suit) || istype(H.wear_suit, /obj/item/clothing/suit/swat_suit))
|
||||
assailant << "\blue You can't strangle [affecting] through their suit collar!"
|
||||
return
|
||||
*/
|
||||
for(var/mob/O in viewers(assailant, null))
|
||||
O.show_message(text("\red [] has reinforced his grip on [] (now neck)!", assailant, affecting), 1)
|
||||
|
||||
state = 3
|
||||
icon_state = "grabbed+1"
|
||||
if (!( affecting.buckled ))
|
||||
affecting.loc = assailant.loc
|
||||
affecting.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their neck grabbed by [assailant.name] ([assailant.ckey])</font>")
|
||||
assailant.attack_log += text("\[[time_stamp()]\] <font color='red'>Grabbed the neck of [affecting.name] ([affecting.ckey])</font>")
|
||||
hud1.icon_state = "disarm/kill"
|
||||
hud1.name = "disarm/kill"
|
||||
else
|
||||
if (state >= 3)
|
||||
killing = !( killing )
|
||||
if (killing)
|
||||
for(var/mob/O in viewers(assailant, null))
|
||||
O.show_message(text("\red [] has tightened his grip on []'s neck!", assailant, affecting), 1)
|
||||
affecting.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been strangled (kill intent) by [assailant.name] ([assailant.ckey])</font>")
|
||||
assailant.attack_log += text("\[[time_stamp()]\] <font color='red'>Strangled (kill intent) [affecting.name] ([affecting.ckey])</font>")
|
||||
assailant.next_move = world.time + 10
|
||||
affecting.losebreath += 1
|
||||
hud1.icon_state = "disarm/kill1"
|
||||
else
|
||||
hud1.icon_state = "disarm/kill"
|
||||
for(var/mob/O in viewers(assailant, null))
|
||||
O.show_message(text("\red [] has loosened the grip on []'s neck!", assailant, affecting), 1)
|
||||
else
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/grab/New()
|
||||
..()
|
||||
hud1 = new /obj/screen/grab( src )
|
||||
hud1.icon_state = "reinforce"
|
||||
hud1.name = "Reinforce Grab"
|
||||
hud1.id = 1
|
||||
hud1.master = src
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/grab/attack(mob/M as mob, mob/user as mob)
|
||||
if (M == affecting)
|
||||
if (state < 3)
|
||||
s_dbclick(hud1)
|
||||
else
|
||||
s_click(hud1)
|
||||
return
|
||||
if(M == assailant && state >= 2)
|
||||
if( ( ishuman(user) && (user.mutations & FAT) && ismonkey(affecting) ) || ( isalien(user) && iscarbon(affecting) ) )
|
||||
var/mob/living/carbon/attacker = user
|
||||
for(var/mob/N in viewers(user, null))
|
||||
if(N.client)
|
||||
N.show_message(text("\red <B>[user] is attempting to devour [affecting]!</B>"), 1)
|
||||
if(istype(user, /mob/living/carbon/alien/humanoid/hunter))
|
||||
if(!do_mob(user, affecting)||!do_after(user, 30)) return
|
||||
else
|
||||
if(!do_mob(user, affecting)||!do_after(user, 100)) return
|
||||
for(var/mob/N in viewers(user, null))
|
||||
if(N.client)
|
||||
N.show_message(text("\red <B>[user] devours [affecting]!</B>"), 1)
|
||||
affecting.loc = user
|
||||
attacker.stomach_contents.Add(affecting)
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/item/weapon/grab/dropped()
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/grab/Del()
|
||||
del(hud1)
|
||||
..()
|
||||
return
|
||||
232
code/modules/mob/mob_helpers.dm
Normal file
232
code/modules/mob/mob_helpers.dm
Normal file
@@ -0,0 +1,232 @@
|
||||
|
||||
// fun if you want to typecast humans/monkeys/etc without writing long path-filled lines.
|
||||
/proc/ishuman(A)
|
||||
if(istype(A, /mob/living/carbon/human))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/ismonkey(A)
|
||||
if(A && istype(A, /mob/living/carbon/monkey))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isbrain(A)
|
||||
if(A && istype(A, /mob/living/carbon/brain))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isalien(A)
|
||||
if(istype(A, /mob/living/carbon/alien))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isalienadult(A)
|
||||
if(istype(A, /mob/living/carbon/alien/humanoid))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/islarva(A)
|
||||
if(istype(A, /mob/living/carbon/alien/larva))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/ismetroid(A)
|
||||
if(istype(A, /mob/living/carbon/metroid))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isrobot(A)
|
||||
if(istype(A, /mob/living/silicon/robot))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isanimal(A)
|
||||
if(istype(A, /mob/living/simple_animal))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iscorgi(A)
|
||||
if(istype(A, /mob/living/simple_animal/corgi))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/*proc/ishivebot(A)
|
||||
if(A && istype(A, /mob/living/silicon/hivebot))
|
||||
return 1
|
||||
return 0*/
|
||||
|
||||
/*proc/ishivemainframe(A)
|
||||
if(A && istype(A, /mob/living/silicon/hive_mainframe))
|
||||
return 1
|
||||
return 0*/
|
||||
|
||||
/proc/isAI(A)
|
||||
if(istype(A, /mob/living/silicon/ai))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/ispAI(A)
|
||||
if(istype(A, /mob/living/silicon/pai))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/iscarbon(A)
|
||||
if(istype(A, /mob/living/carbon))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/issilicon(A)
|
||||
if(istype(A, /mob/living/silicon))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isliving(A)
|
||||
if(istype(A, /mob/living))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/isobserver(A)
|
||||
if(istype(A, /mob/dead/observer))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/isorgan(A)
|
||||
if(istype(A, /datum/organ/external))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/hsl2rgb(h, s, l)
|
||||
return
|
||||
|
||||
|
||||
/proc/check_zone(zone)
|
||||
if(!zone) return "chest"
|
||||
switch(zone)
|
||||
if("eyes")
|
||||
zone = "head"
|
||||
if("mouth")
|
||||
zone = "head"
|
||||
if("l_hand")
|
||||
zone = "l_arm"
|
||||
if("r_hand")
|
||||
zone = "r_arm"
|
||||
if("l_foot")
|
||||
zone = "l_leg"
|
||||
if("r_foot")
|
||||
zone = "r_leg"
|
||||
if("groin")
|
||||
zone = "chest"
|
||||
return zone
|
||||
|
||||
|
||||
/proc/ran_zone(zone, probability)
|
||||
zone = check_zone(zone)
|
||||
if(!probability) probability = 90
|
||||
if(probability == 100) return zone
|
||||
|
||||
if(zone == "chest")
|
||||
if(prob(probability)) return "chest"
|
||||
var/t = rand(1, 9)
|
||||
switch(t)
|
||||
if(1 to 3) return "head"
|
||||
if(4 to 6) return "l_arm"
|
||||
if(7 to 9) return "r_arm"
|
||||
|
||||
if(prob(probability * 0.75)) return zone
|
||||
return "chest"
|
||||
|
||||
|
||||
/proc/stars(n, pr)
|
||||
if (pr == null)
|
||||
pr = 25
|
||||
if (pr <= 0)
|
||||
return null
|
||||
else
|
||||
if (pr >= 100)
|
||||
return n
|
||||
var/te = n
|
||||
var/t = ""
|
||||
n = length(n)
|
||||
var/p = null
|
||||
p = 1
|
||||
while(p <= n)
|
||||
if ((copytext(te, p, p + 1) == " " || prob(pr)))
|
||||
t = text("[][]", t, copytext(te, p, p + 1))
|
||||
else
|
||||
t = text("[]*", t)
|
||||
p++
|
||||
return t
|
||||
|
||||
|
||||
/proc/stutter(n)
|
||||
var/te = html_decode(n)
|
||||
var/t = ""//placed before the message. Not really sure what it's for.
|
||||
n = length(n)//length of the entire word
|
||||
var/p = null
|
||||
p = 1//1 is the start of any word
|
||||
while(p <= n)//while P, which starts at 1 is less or equal to N which is the length.
|
||||
var/n_letter = copytext(te, p, p + 1)//copies text from a certain distance. In this case, only one letter at a time.
|
||||
if (prob(80) && (ckey(n_letter) in list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z")))
|
||||
if (prob(10))
|
||||
n_letter = text("[n_letter]-[n_letter]-[n_letter]-[n_letter]")//replaces the current letter with this instead.
|
||||
else
|
||||
if (prob(20))
|
||||
n_letter = text("[n_letter]-[n_letter]-[n_letter]")
|
||||
else
|
||||
if (prob(5))
|
||||
n_letter = null
|
||||
else
|
||||
n_letter = text("[n_letter]-[n_letter]")
|
||||
t = text("[t][n_letter]")//since the above is ran through for each letter, the text just adds up back to the original word.
|
||||
p++//for each letter p is increased to find where the next letter will be.
|
||||
return copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
|
||||
|
||||
/proc/ninjaspeak(n)
|
||||
/*
|
||||
The difference with stutter is that this proc can stutter more than 1 letter
|
||||
The issue here is that anything that does not have a space is treated as one word (in many instances). For instance, "LOOKING," is a word, including the comma.
|
||||
It's fairly easy to fix if dealing with single letters but not so much with compounds of letters./N
|
||||
*/
|
||||
var/te = html_decode(n)
|
||||
var/t = ""
|
||||
n = length(n)
|
||||
var/p = 1
|
||||
while(p <= n)
|
||||
var/n_letter
|
||||
var/n_mod = rand(1,4)
|
||||
if(p+n_mod>n+1)
|
||||
n_letter = copytext(te, p, n+1)
|
||||
else
|
||||
n_letter = copytext(te, p, p+n_mod)
|
||||
if (prob(50))
|
||||
if (prob(30))
|
||||
n_letter = text("[n_letter]-[n_letter]-[n_letter]")
|
||||
else
|
||||
n_letter = text("[n_letter]-[n_letter]")
|
||||
else
|
||||
n_letter = text("[n_letter]")
|
||||
t = text("[t][n_letter]")
|
||||
p=p+n_mod
|
||||
return copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
|
||||
|
||||
/proc/shake_camera(mob/M, duration, strength=1)
|
||||
if(!M || !M.client || M.shakecamera)
|
||||
return
|
||||
spawn(1)
|
||||
var/oldeye=M.client.eye
|
||||
var/x
|
||||
M.shakecamera = 1
|
||||
for(x=0; x<duration, x++)
|
||||
M.client.eye = locate(dd_range(1,M.loc.x+rand(-strength,strength),world.maxx),dd_range(1,M.loc.y+rand(-strength,strength),world.maxy),M.loc.z)
|
||||
sleep(1)
|
||||
M.shakecamera = 0
|
||||
M.client.eye=oldeye
|
||||
|
||||
|
||||
/proc/findname(msg)
|
||||
for(var/mob/M in world)
|
||||
if (M.real_name == text("[msg]"))
|
||||
return 1
|
||||
return 0
|
||||
@@ -97,6 +97,7 @@
|
||||
mob.control_object.loc = get_step(mob.control_object,direct)
|
||||
return
|
||||
|
||||
|
||||
/client/Move(n, direct)
|
||||
if(mob.control_object) Move_object(direct)
|
||||
|
||||
@@ -142,15 +143,13 @@
|
||||
if("run")
|
||||
if(mob.drowsyness > 0)
|
||||
move_delay += 6
|
||||
if(mob.organStructure && mob.organStructure.legs)
|
||||
move_delay += mob.organStructure.legs.moveRunDelay
|
||||
else
|
||||
move_delay += 1
|
||||
// if(mob.organStructure && mob.organStructure.legs)
|
||||
// move_delay += mob.organStructure.legs.moveRunDelay
|
||||
move_delay += 1
|
||||
if("walk")
|
||||
if(mob.organStructure && mob.organStructure.legs)
|
||||
move_delay += mob.organStructure.legs.moveWalkDelay
|
||||
else
|
||||
move_delay += 7
|
||||
// if(mob.organStructure && mob.organStructure.legs)
|
||||
// move_delay += mob.organStructure.legs.moveWalkDelay
|
||||
move_delay += 7
|
||||
move_delay += mob.movement_delay()
|
||||
|
||||
//We are now going to move
|
||||
|
||||
113
code/modules/mob/organ/organ.dm
Normal file
113
code/modules/mob/organ/organ.dm
Normal file
@@ -0,0 +1,113 @@
|
||||
/datum/organ
|
||||
var
|
||||
name = "organ"
|
||||
owner = null
|
||||
|
||||
|
||||
proc/process()
|
||||
return 0
|
||||
|
||||
|
||||
proc/receive_chem(chemical as obj)
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/****************************************************
|
||||
EXTERNAL ORGANS
|
||||
****************************************************/
|
||||
/datum/organ/external
|
||||
name = "external"
|
||||
var
|
||||
icon_name = null
|
||||
body_part = null
|
||||
|
||||
damage_state = "00"
|
||||
brute_dam = 0
|
||||
burn_dam = 0
|
||||
bandaged = 0
|
||||
max_damage = 0
|
||||
wound_size = 0
|
||||
max_size = 0
|
||||
|
||||
|
||||
proc/take_damage(brute, burn)
|
||||
if((brute <= 0) && (burn <= 0)) return 0
|
||||
if((src.brute_dam + src.burn_dam + brute + burn) < src.max_damage)
|
||||
src.brute_dam += brute
|
||||
src.burn_dam += burn
|
||||
else
|
||||
var/can_inflict = src.max_damage - (src.brute_dam + src.burn_dam)
|
||||
if(can_inflict)
|
||||
if (brute > 0 && burn > 0)
|
||||
brute = can_inflict/2
|
||||
burn = can_inflict/2
|
||||
var/ratio = brute / (brute + burn)
|
||||
src.brute_dam += ratio * can_inflict
|
||||
src.burn_dam += (1 - ratio) * can_inflict
|
||||
else
|
||||
if (brute > 0)
|
||||
brute = can_inflict
|
||||
src.brute_dam += brute
|
||||
else
|
||||
burn = can_inflict
|
||||
src.burn_dam += burn
|
||||
else
|
||||
return 0
|
||||
|
||||
var/result = src.update_icon()
|
||||
return result
|
||||
|
||||
|
||||
proc/heal_damage(brute, burn)
|
||||
src.brute_dam = max(0, src.brute_dam - brute)
|
||||
src.burn_dam = max(0, src.burn_dam - burn)
|
||||
return update_icon()
|
||||
|
||||
|
||||
proc/get_damage() //returns total damage
|
||||
return src.brute_dam + src.burn_dam //could use src.health?
|
||||
|
||||
|
||||
// new damage icon system
|
||||
// returns just the brute/burn damage code
|
||||
proc/damage_state_text()
|
||||
var/tburn = 0
|
||||
var/tbrute = 0
|
||||
|
||||
if(burn_dam ==0)
|
||||
tburn =0
|
||||
else if (src.burn_dam < (src.max_damage * 0.25 / 2))
|
||||
tburn = 1
|
||||
else if (src.burn_dam < (src.max_damage * 0.75 / 2))
|
||||
tburn = 2
|
||||
else
|
||||
tburn = 3
|
||||
|
||||
if (src.brute_dam == 0)
|
||||
tbrute = 0
|
||||
else if (src.brute_dam < (src.max_damage * 0.25 / 2))
|
||||
tbrute = 1
|
||||
else if (src.brute_dam < (src.max_damage * 0.75 / 2))
|
||||
tbrute = 2
|
||||
else
|
||||
tbrute = 3
|
||||
return "[tbrute][tburn]"
|
||||
|
||||
|
||||
// new damage icon system
|
||||
// adjusted to set damage_state to brute/burn code only (without r_name0 as before)
|
||||
proc/update_icon()
|
||||
var/n_is = src.damage_state_text()
|
||||
if (n_is != src.damage_state)
|
||||
src.damage_state = n_is
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
/****************************************************
|
||||
INTERNAL ORGANS
|
||||
****************************************************/
|
||||
/datum/organ/internal
|
||||
name = "internal"
|
||||
62
code/modules/mob/organ/organ_external.dm
Normal file
62
code/modules/mob/organ/organ_external.dm
Normal file
@@ -0,0 +1,62 @@
|
||||
/datum/organ/external/chest
|
||||
name = "chest"
|
||||
icon_name = "chest"
|
||||
max_damage = 150
|
||||
body_part = UPPER_TORSO
|
||||
|
||||
/*/datum/organ/external/groin
|
||||
name = "groin"
|
||||
icon_name = "groin"
|
||||
body_part = LOWER_TORSO
|
||||
*/
|
||||
/datum/organ/external/head
|
||||
name = "head"
|
||||
icon_name = "head"
|
||||
max_damage = 125
|
||||
body_part = HEAD
|
||||
|
||||
/datum/organ/external/l_arm
|
||||
name = "l_arm"
|
||||
icon_name = "l_arm"
|
||||
max_damage = 75
|
||||
body_part = ARM_LEFT
|
||||
|
||||
/datum/organ/external/l_leg
|
||||
name = "l_leg"
|
||||
icon_name = "l_leg"
|
||||
max_damage = 75
|
||||
body_part = LEG_LEFT
|
||||
|
||||
/datum/organ/external/r_arm
|
||||
name = "r_arm"
|
||||
icon_name = "r_arm"
|
||||
max_damage = 75
|
||||
body_part = ARM_RIGHT
|
||||
|
||||
/datum/organ/external/r_leg
|
||||
name = "r_leg"
|
||||
icon_name = "r_leg"
|
||||
max_damage = 75
|
||||
body_part = LEG_RIGHT
|
||||
|
||||
/*Leaving these here in case we want to use them later
|
||||
/datum/organ/external/l_foot
|
||||
name = "l foot"
|
||||
icon_name = "l_foot"
|
||||
body_part = FOOT_LEFT
|
||||
|
||||
/datum/organ/external/r_foot
|
||||
name = "r foot"
|
||||
icon_name = "r_foot"
|
||||
body_part = FOOT_RIGHT
|
||||
|
||||
/datum/organ/external/r_hand
|
||||
name = "r hand"
|
||||
icon_name = "r_hand"
|
||||
body_part = HAND_RIGHT
|
||||
|
||||
/datum/organ/external/l_hand
|
||||
name = "l hand"
|
||||
icon_name = "l_hand"
|
||||
body_part = HAND_LEFT
|
||||
*/
|
||||
47
code/modules/mob/organ/organ_internal.dm
Normal file
47
code/modules/mob/organ/organ_internal.dm
Normal file
@@ -0,0 +1,47 @@
|
||||
/datum/organ/internal/blood_vessels
|
||||
name = "blood vessels"
|
||||
var/heart = null
|
||||
var/lungs = null
|
||||
var/kidneys = null
|
||||
|
||||
/datum/organ/internal/brain
|
||||
name = "brain"
|
||||
var/head = null
|
||||
|
||||
/datum/organ/internal/excretory
|
||||
name = "excretory"
|
||||
var/excretory = 7.0
|
||||
var/blood_vessels = null
|
||||
|
||||
/datum/organ/internal/heart
|
||||
name = "heart"
|
||||
|
||||
/datum/organ/internal/immune_system
|
||||
name = "immune system"
|
||||
var/blood_vessels = null
|
||||
var/isys = null
|
||||
|
||||
/datum/organ/internal/intestines
|
||||
name = "intestines"
|
||||
var/intestines = 3.0
|
||||
var/blood_vessels = null
|
||||
|
||||
/datum/organ/internal/liver
|
||||
name = "liver"
|
||||
var/intestines = null
|
||||
var/blood_vessels = null
|
||||
|
||||
/datum/organ/internal/lungs
|
||||
name = "lungs"
|
||||
var/lungs = 3.0
|
||||
var/throat = null
|
||||
var/blood_vessels = null
|
||||
|
||||
/datum/organ/internal/stomach
|
||||
name = "stomach"
|
||||
var/intestines = null
|
||||
|
||||
/datum/organ/internal/throat
|
||||
name = "throat"
|
||||
var/lungs = null
|
||||
var/stomach = null
|
||||
@@ -1,83 +0,0 @@
|
||||
/datum/organ/proc/process()
|
||||
return
|
||||
|
||||
/datum/organ/proc/receive_chem(chemical as obj)
|
||||
return
|
||||
|
||||
/datum/organ/external/proc/take_damage(brute, burn)
|
||||
if ((brute <= 0 && burn <= 0))
|
||||
return 0
|
||||
if ((src.brute_dam + src.burn_dam + brute + burn) < src.max_damage)
|
||||
src.brute_dam += brute
|
||||
src.burn_dam += burn
|
||||
else
|
||||
var/can_inflict = src.max_damage - (src.brute_dam + src.burn_dam)
|
||||
if (can_inflict)
|
||||
if (brute > 0 && burn > 0)
|
||||
brute = can_inflict/2
|
||||
burn = can_inflict/2
|
||||
var/ratio = brute / (brute + burn)
|
||||
src.brute_dam += ratio * can_inflict
|
||||
src.burn_dam += (1 - ratio) * can_inflict
|
||||
else
|
||||
if (brute > 0)
|
||||
brute = can_inflict
|
||||
src.brute_dam += brute
|
||||
else
|
||||
burn = can_inflict
|
||||
src.burn_dam += burn
|
||||
else
|
||||
return 0
|
||||
|
||||
var/result = src.update_icon()
|
||||
|
||||
return result
|
||||
|
||||
/datum/organ/external/proc/heal_damage(brute, burn)
|
||||
src.brute_dam = max(0, src.brute_dam - brute)
|
||||
src.burn_dam = max(0, src.burn_dam - burn)
|
||||
return update_icon()
|
||||
|
||||
/datum/organ/external/proc/get_damage() //returns total damage
|
||||
return src.brute_dam + src.burn_dam //could use src.health?
|
||||
|
||||
// new damage icon system
|
||||
// returns just the brute/burn damage code
|
||||
|
||||
/datum/organ/external/proc/damage_state_text()
|
||||
|
||||
var/tburn = 0
|
||||
var/tbrute = 0
|
||||
|
||||
if(burn_dam ==0)
|
||||
tburn =0
|
||||
else if (src.burn_dam < (src.max_damage * 0.25 / 2))
|
||||
tburn = 1
|
||||
else if (src.burn_dam < (src.max_damage * 0.75 / 2))
|
||||
tburn = 2
|
||||
else
|
||||
tburn = 3
|
||||
|
||||
if (src.brute_dam == 0)
|
||||
tbrute = 0
|
||||
else if (src.brute_dam < (src.max_damage * 0.25 / 2))
|
||||
tbrute = 1
|
||||
else if (src.brute_dam < (src.max_damage * 0.75 / 2))
|
||||
tbrute = 2
|
||||
else
|
||||
tbrute = 3
|
||||
|
||||
return "[tbrute][tburn]"
|
||||
|
||||
// new damage icon system
|
||||
// adjusted to set damage_state to brute/burn code only (without r_name0 as before)
|
||||
|
||||
/datum/organ/external/proc/update_icon()
|
||||
|
||||
var/n_is = src.damage_state_text()
|
||||
if (n_is != src.damage_state)
|
||||
src.damage_state = n_is
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
return
|
||||
527
code/modules/mob/screen.dm
Normal file
527
code/modules/mob/screen.dm
Normal file
@@ -0,0 +1,527 @@
|
||||
/obj/screen
|
||||
name = "screen"
|
||||
icon = 'screen1.dmi'
|
||||
layer = 20.0
|
||||
unacidable = 1
|
||||
var/id = 0.0
|
||||
var/obj/master
|
||||
|
||||
/obj/screen/close
|
||||
name = "close"
|
||||
master = null
|
||||
|
||||
/obj/screen/grab
|
||||
name = "grab"
|
||||
master = null
|
||||
|
||||
/obj/screen/storage
|
||||
name = "storage"
|
||||
master = null
|
||||
|
||||
/obj/screen/zone_sel
|
||||
name = "Damage Zone"
|
||||
icon = 'zone_sel.dmi'
|
||||
icon_state = "blank"
|
||||
var/selecting = "chest"
|
||||
screen_loc = "EAST+1,NORTH"
|
||||
|
||||
|
||||
/obj/screen/zone_sel/MouseDown(location, control,params)
|
||||
// Changes because of 4.0
|
||||
var/list/PL = params2list(params)
|
||||
var/icon_x = text2num(PL["icon-x"])
|
||||
var/icon_y = text2num(PL["icon-y"])
|
||||
|
||||
if (icon_y < 2)
|
||||
return
|
||||
else if (icon_y < 5)
|
||||
if ((icon_x > 9 && icon_x < 23))
|
||||
if (icon_x < 16)
|
||||
selecting = "r_foot"
|
||||
else
|
||||
selecting = "l_foot"
|
||||
else if (icon_y < 11)
|
||||
if ((icon_x > 11 && icon_x < 21))
|
||||
if (icon_x < 16)
|
||||
selecting = "r_leg"
|
||||
else
|
||||
selecting = "l_leg"
|
||||
else if (icon_y < 12)
|
||||
if ((icon_x > 11 && icon_x < 21))
|
||||
if (icon_x < 14)
|
||||
selecting = "r_leg"
|
||||
else if (icon_x < 19)
|
||||
selecting = "groin"
|
||||
else
|
||||
selecting = "l_leg"
|
||||
else
|
||||
return
|
||||
else if (icon_y < 13)
|
||||
if ((icon_x > 7 && icon_x < 25))
|
||||
if (icon_x < 12)
|
||||
selecting = "r_hand"
|
||||
else if (icon_x < 13)
|
||||
selecting = "r_leg"
|
||||
else if (icon_x < 20)
|
||||
selecting = "groin"
|
||||
else if (icon_x < 21)
|
||||
selecting = "l_leg"
|
||||
else
|
||||
selecting = "l_hand"
|
||||
else
|
||||
return
|
||||
else if (icon_y < 14)
|
||||
if ((icon_x > 7 && icon_x < 25))
|
||||
if (icon_x < 12)
|
||||
selecting = "r_hand"
|
||||
else if (icon_x < 21)
|
||||
selecting = "groin"
|
||||
else
|
||||
selecting = "l_hand"
|
||||
else
|
||||
return
|
||||
else if (icon_y < 16)
|
||||
if ((icon_x > 7 && icon_x < 25))
|
||||
if (icon_x < 13)
|
||||
selecting = "r_hand"
|
||||
else if (icon_x < 20)
|
||||
selecting = "chest"
|
||||
else
|
||||
selecting = "l_hand"
|
||||
else
|
||||
return
|
||||
else if (icon_y < 23)
|
||||
if ((icon_x > 7 && icon_x < 25))
|
||||
if (icon_x < 12)
|
||||
selecting = "r_arm"
|
||||
else if (icon_x < 21)
|
||||
selecting = "chest"
|
||||
else
|
||||
selecting = "l_arm"
|
||||
else
|
||||
return
|
||||
else if (icon_y < 24)
|
||||
if ((icon_x > 11 && icon_x < 21))
|
||||
selecting = "chest"
|
||||
else
|
||||
return
|
||||
else if (icon_y < 25)
|
||||
if ((icon_x > 11 && icon_x < 21))
|
||||
if (icon_x < 16)
|
||||
selecting = "head"
|
||||
else if (icon_x < 17)
|
||||
selecting = "mouth"
|
||||
else
|
||||
selecting = "head"
|
||||
else
|
||||
return
|
||||
else if (icon_y < 26)
|
||||
if ((icon_x > 11 && icon_x < 21))
|
||||
if (icon_x < 15)
|
||||
selecting = "head"
|
||||
else if (icon_x < 18)
|
||||
selecting = "mouth"
|
||||
else
|
||||
selecting = "head"
|
||||
else
|
||||
return
|
||||
else if (icon_y < 27)
|
||||
if ((icon_x > 11 && icon_x < 21))
|
||||
if (icon_x < 15)
|
||||
selecting = "head"
|
||||
else if (icon_x < 16)
|
||||
selecting = "eyes"
|
||||
else if (icon_x < 17)
|
||||
selecting = "mouth"
|
||||
else if (icon_x < 18)
|
||||
selecting = "eyes"
|
||||
else
|
||||
selecting = "head"
|
||||
else
|
||||
return
|
||||
else if (icon_y < 28)
|
||||
if ((icon_x > 11 && icon_x < 21))
|
||||
if (icon_x < 14)
|
||||
selecting = "head"
|
||||
else if (icon_x < 19)
|
||||
selecting = "eyes"
|
||||
else
|
||||
selecting = "head"
|
||||
else
|
||||
return
|
||||
else if (icon_y < 29)
|
||||
if ((icon_x > 11 && icon_x < 21))
|
||||
if (icon_x < 15)
|
||||
selecting = "head"
|
||||
else if (icon_x < 16)
|
||||
selecting = "eyes"
|
||||
else if (icon_x < 17)
|
||||
selecting = "head"
|
||||
else if (icon_x < 18)
|
||||
selecting = "eyes"
|
||||
else
|
||||
selecting = "head"
|
||||
else
|
||||
return
|
||||
else if (icon_y < 31)
|
||||
if ((icon_x > 11 && icon_x < 21))
|
||||
selecting = "head"
|
||||
else
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
overlays = null
|
||||
overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", selecting))
|
||||
|
||||
return
|
||||
|
||||
/obj/screen/grab/Click()
|
||||
master:s_click(src)
|
||||
return
|
||||
|
||||
/obj/screen/grab/DblClick()
|
||||
master:s_dbclick(src)
|
||||
return
|
||||
|
||||
/obj/screen/grab/attack_hand()
|
||||
return
|
||||
|
||||
/obj/screen/grab/attackby()
|
||||
return
|
||||
|
||||
/obj/screen/Click(location, control, params)
|
||||
|
||||
var/list/pa = params2list(params)
|
||||
|
||||
switch(name)
|
||||
if("map")
|
||||
|
||||
usr.clearmap()
|
||||
if("maprefresh")
|
||||
var/obj/machinery/computer/security/seccomp = usr.machine
|
||||
|
||||
if(seccomp!=null)
|
||||
seccomp.drawmap(usr)
|
||||
else
|
||||
usr.clearmap()
|
||||
|
||||
if("other")
|
||||
if (usr.hud_used.show_otherinventory)
|
||||
usr.hud_used.show_otherinventory = 0
|
||||
usr.client.screen -= usr.hud_used.other
|
||||
else
|
||||
usr.hud_used.show_otherinventory = 1
|
||||
usr.client.screen += usr.hud_used.other
|
||||
|
||||
usr.hud_used.other_update()
|
||||
|
||||
|
||||
if("act_intent")
|
||||
if(pa.Find("left"))
|
||||
switch(usr.a_intent)
|
||||
if("help")
|
||||
usr.a_intent = "disarm"
|
||||
usr.hud_used.action_intent.icon_state = "disarm"
|
||||
if("disarm")
|
||||
usr.a_intent = "hurt"
|
||||
usr.hud_used.action_intent.icon_state = "harm"
|
||||
if("hurt")
|
||||
usr.a_intent = "grab"
|
||||
usr.hud_used.action_intent.icon_state = "grab"
|
||||
if("grab")
|
||||
usr.a_intent = "help"
|
||||
usr.hud_used.action_intent.icon_state = "help"
|
||||
else
|
||||
switch(usr.a_intent)
|
||||
if("help")
|
||||
usr.a_intent = "grab"
|
||||
usr.hud_used.action_intent.icon_state = "grab"
|
||||
if("disarm")
|
||||
usr.a_intent = "help"
|
||||
usr.hud_used.action_intent.icon_state = "help"
|
||||
if("hurt")
|
||||
usr.a_intent = "disarm"
|
||||
usr.hud_used.action_intent.icon_state = "disarm"
|
||||
if("grab")
|
||||
usr.a_intent = "hurt"
|
||||
usr.hud_used.action_intent.icon_state = "harm"
|
||||
|
||||
if("arrowleft")
|
||||
switch(usr.a_intent)
|
||||
if("help")
|
||||
if(issilicon(usr))
|
||||
usr.a_intent = "hurt"
|
||||
usr.hud_used.action_intent.icon_state = "harm"
|
||||
else
|
||||
usr.a_intent = "grab"
|
||||
usr.hud_used.action_intent.icon_state = "grab"
|
||||
|
||||
if("disarm")
|
||||
usr.a_intent = "help"
|
||||
usr.hud_used.action_intent.icon_state = "help"
|
||||
|
||||
if("hurt")
|
||||
if(issilicon(usr))
|
||||
usr.a_intent = "help"
|
||||
usr.hud_used.action_intent.icon_state = "help"
|
||||
else
|
||||
usr.a_intent = "disarm"
|
||||
usr.hud_used.action_intent.icon_state = "disarm"
|
||||
|
||||
if("grab")
|
||||
usr.a_intent = "hurt"
|
||||
usr.hud_used.action_intent.icon_state = "harm"
|
||||
|
||||
if("arrowright")
|
||||
switch(usr.a_intent)
|
||||
if("help")
|
||||
if(issilicon(usr))
|
||||
usr.a_intent = "hurt"
|
||||
usr.hud_used.action_intent.icon_state = "harm"
|
||||
else
|
||||
usr.a_intent = "disarm"
|
||||
usr.hud_used.action_intent.icon_state = "disarm"
|
||||
|
||||
if("disarm")
|
||||
usr.a_intent = "hurt"
|
||||
usr.hud_used.action_intent.icon_state = "harm"
|
||||
|
||||
if("hurt")
|
||||
if(issilicon(usr))
|
||||
usr.a_intent = "help"
|
||||
usr.hud_used.action_intent.icon_state = "help"
|
||||
else
|
||||
usr.a_intent = "grab"
|
||||
usr.hud_used.action_intent.icon_state = "grab"
|
||||
|
||||
if("grab")
|
||||
usr.a_intent = "help"
|
||||
usr.hud_used.action_intent.icon_state = "help"
|
||||
|
||||
if("mov_intent")
|
||||
switch(usr.m_intent)
|
||||
if("run")
|
||||
usr.m_intent = "walk"
|
||||
usr.hud_used.move_intent.icon_state = "walking"
|
||||
if("walk")
|
||||
usr.m_intent = "run"
|
||||
usr.hud_used.move_intent.icon_state = "running"
|
||||
|
||||
if("intent")
|
||||
if (!( usr.intent ))
|
||||
switch(usr.a_intent)
|
||||
if("help")
|
||||
usr.intent = "13,15"
|
||||
if("disarm")
|
||||
usr.intent = "14,15"
|
||||
if("hurt")
|
||||
usr.intent = "15,15"
|
||||
if("grab")
|
||||
usr.intent = "12,15"
|
||||
else
|
||||
usr.intent = null
|
||||
if("m_intent")
|
||||
if (!( usr.m_int ))
|
||||
switch(usr.m_intent)
|
||||
if("run")
|
||||
usr.m_int = "13,14"
|
||||
if("walk")
|
||||
usr.m_int = "14,14"
|
||||
if("face")
|
||||
usr.m_int = "15,14"
|
||||
else
|
||||
usr.m_int = null
|
||||
if("walk")
|
||||
usr.m_intent = "walk"
|
||||
usr.m_int = "14,14"
|
||||
if("face")
|
||||
usr.m_intent = "face"
|
||||
usr.m_int = "15,14"
|
||||
if("run")
|
||||
usr.m_intent = "run"
|
||||
usr.m_int = "13,14"
|
||||
if("hurt")
|
||||
usr.a_intent = "hurt"
|
||||
usr.intent = "15,15"
|
||||
if("grab")
|
||||
usr.a_intent = "grab"
|
||||
usr.intent = "12,15"
|
||||
if("disarm")
|
||||
if (istype(usr, /mob/living/carbon/human))
|
||||
var/mob/M = usr
|
||||
M.a_intent = "disarm"
|
||||
M.intent = "14,15"
|
||||
if("help")
|
||||
usr.a_intent = "help"
|
||||
usr.intent = "13,15"
|
||||
if("Reset Machine")
|
||||
usr.machine = null
|
||||
if("internal")
|
||||
if ((!( usr.stat ) && usr.canmove && !( usr.restrained() )))
|
||||
if (usr.internal)
|
||||
usr.internal = null
|
||||
if (usr.internals)
|
||||
usr.internals.icon_state = "internal0"
|
||||
else
|
||||
if (!( istype(usr.wear_mask, /obj/item/clothing/mask) ))
|
||||
return
|
||||
else
|
||||
if (istype(usr.back, /obj/item/weapon/tank))
|
||||
usr.internal = usr.back
|
||||
else if (ishuman(usr) && istype(usr:s_store, /obj/item/weapon/tank))
|
||||
usr.internal = usr:s_store
|
||||
else if (ishuman(usr) && istype(usr:belt, /obj/item/weapon/tank))
|
||||
usr.internal = usr:belt
|
||||
else if (istype(usr.l_hand, /obj/item/weapon/tank))
|
||||
usr.internal = usr.l_hand
|
||||
else if (istype(usr.r_hand, /obj/item/weapon/tank))
|
||||
usr.internal = usr.r_hand
|
||||
if (usr.internal)
|
||||
//for(var/mob/M in viewers(usr, 1))
|
||||
// M.show_message(text("[] is now running on internals.", usr), 1)
|
||||
usr << "You are now running on internals."
|
||||
if (usr.internals)
|
||||
usr.internals.icon_state = "internal1"
|
||||
if("pull")
|
||||
usr.pulling = null
|
||||
if("sleep")
|
||||
usr.sleeping = !( usr.sleeping )
|
||||
if("rest")
|
||||
usr.resting = !( usr.resting )
|
||||
if("throw")
|
||||
if (!usr.stat && isturf(usr.loc) && !usr.restrained())
|
||||
usr:toggle_throw_mode()
|
||||
if("drop")
|
||||
usr.drop_item_v()
|
||||
if("swap")
|
||||
usr:swap_hand()
|
||||
if("hand")
|
||||
usr:swap_hand()
|
||||
if("resist")
|
||||
if (usr.next_move < world.time)
|
||||
return
|
||||
usr.next_move = world.time + 20
|
||||
if ((!( usr.stat ) && usr.canmove && !( usr.restrained() )))
|
||||
for(var/obj/O in usr.requests)
|
||||
del(O)
|
||||
for(var/obj/item/weapon/grab/G in usr.grabbed_by)
|
||||
if (G.state == 1)
|
||||
del(G)
|
||||
else
|
||||
if (G.state == 2)
|
||||
if (prob(25))
|
||||
for(var/mob/O in viewers(usr, null))
|
||||
O.show_message(text("\red [] has broken free of []'s grip!", usr, G.assailant), 1)
|
||||
del(G)
|
||||
else
|
||||
if (G.state == 3)
|
||||
if (prob(5))
|
||||
for(var/mob/O in viewers(usr, null))
|
||||
O.show_message(text("\red [] has broken free of []'s headlock!", usr, G.assailant), 1)
|
||||
del(G)
|
||||
for(var/mob/O in viewers(usr, null))
|
||||
O.show_message(text("\red <B>[] resists!</B>", usr), 1)
|
||||
|
||||
if(usr:handcuffed && usr:canmove && (usr.last_special <= world.time))
|
||||
usr.next_move = world.time + 100
|
||||
usr.last_special = world.time + 100
|
||||
if(isalienadult(usr) || usr.mutations & HULK)//Don't want to do a lot of logic gating here.
|
||||
usr << "\green You attempt to break your handcuffs. (This will take around 5 seconds and you need to stand still)"
|
||||
for(var/mob/O in viewers(usr))
|
||||
O.show_message(text("\red <B>[] is trying to break the handcuffs!</B>", usr), 1)
|
||||
spawn(0)
|
||||
if(do_after(usr, 50))
|
||||
if(!usr:handcuffed) return
|
||||
for(var/mob/O in viewers(usr))
|
||||
O.show_message(text("\red <B>[] manages to break the handcuffs!</B>", usr), 1)
|
||||
usr << "\green You successfully break your handcuffs."
|
||||
del(usr:handcuffed)
|
||||
usr:handcuffed = null
|
||||
else
|
||||
usr << "\red You attempt to remove your handcuffs. (This will take around 2 minutes and you need to stand still)"
|
||||
for(var/mob/O in viewers(usr))
|
||||
O.show_message(text("\red <B>[] attempts to remove the handcuffs!</B>", usr), 1)
|
||||
spawn(0)
|
||||
if(do_after(usr, 1200))
|
||||
if(!usr:handcuffed) return
|
||||
for(var/mob/O in viewers(usr))
|
||||
O.show_message(text("\red <B>[] manages to remove the handcuffs!</B>", usr), 1)
|
||||
usr << "\blue You successfully remove your handcuffs."
|
||||
usr:handcuffed:loc = usr:loc
|
||||
usr:handcuffed = null
|
||||
|
||||
if(usr:handcuffed && (usr.last_special <= world.time) && usr:buckled)
|
||||
usr.next_move = world.time + 100
|
||||
usr.last_special = world.time + 100
|
||||
usr << "\red You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)"
|
||||
for(var/mob/O in viewers(usr))
|
||||
O.show_message(text("\red <B>[] attempts to unbuckle themself!</B>", usr), 1)
|
||||
spawn(0)
|
||||
if(do_after(usr, 1200))
|
||||
if(!usr:buckled) return
|
||||
for(var/mob/O in viewers(usr))
|
||||
O.show_message(text("\red <B>[] manages to unbuckle themself!</B>", usr), 1)
|
||||
usr << "\blue You successfully unbuckle yourself."
|
||||
usr:buckled.manual_unbuckle_all(usr)
|
||||
if("module")
|
||||
if(issilicon(usr))
|
||||
if(usr:module)
|
||||
return
|
||||
usr:pick_module()
|
||||
|
||||
if("radio")
|
||||
if(issilicon(usr))
|
||||
usr:radio_menu()
|
||||
if("panel")
|
||||
if(issilicon(usr))
|
||||
usr:installed_modules()
|
||||
|
||||
if("store")
|
||||
if(issilicon(usr))
|
||||
usr:uneq_active()
|
||||
|
||||
if("module1")
|
||||
if(usr:module_state_1)
|
||||
if(usr:module_active != usr:module_state_1)
|
||||
usr:inv1.icon_state = "inv1 +a"
|
||||
usr:inv2.icon_state = "inv2"
|
||||
usr:inv3.icon_state = "inv3"
|
||||
usr:module_active = usr:module_state_1
|
||||
else
|
||||
usr:inv1.icon_state = "inv1"
|
||||
usr:module_active = null
|
||||
|
||||
if("module2")
|
||||
if(usr:module_state_2)
|
||||
if(usr:module_active != usr:module_state_2)
|
||||
usr:inv1.icon_state = "inv1"
|
||||
usr:inv2.icon_state = "inv2 +a"
|
||||
usr:inv3.icon_state = "inv3"
|
||||
usr:module_active = usr:module_state_2
|
||||
else
|
||||
usr:inv2.icon_state = "inv2"
|
||||
usr:module_active = null
|
||||
|
||||
if("module3")
|
||||
if(usr:module_state_3)
|
||||
if(usr:module_active != usr:module_state_3)
|
||||
usr:inv1.icon_state = "inv1"
|
||||
usr:inv2.icon_state = "inv2"
|
||||
usr:inv3.icon_state = "inv3 +a"
|
||||
usr:module_active = usr:module_state_3
|
||||
else
|
||||
usr:inv3.icon_state = "inv3"
|
||||
usr:module_active = null
|
||||
|
||||
else
|
||||
DblClick()
|
||||
return
|
||||
|
||||
/obj/screen/attack_hand(mob/user as mob, using)
|
||||
user.db_click(name, using)
|
||||
return
|
||||
|
||||
/obj/screen/attack_paw(mob/user as mob, using)
|
||||
user.db_click(name, using)
|
||||
return
|
||||
Reference in New Issue
Block a user