mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-07-12 08:42:49 +01: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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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) )))
|
||||
|
||||
@@ -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
|
||||
@@ -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*/
|
||||
Reference in New Issue
Block a user