Files
CHOMPStation2/code/modules/critters/defenses.dm
mport2004@gmail.com 3cae06c9c3 Fixed the signpost shuttle bug.
Critters have been added and livestock removed
Xbow damage raised to 30 a shot
Centcom Survival Kit is once again a box
Sec uniforms moved into their own locker

After IRC talk
Guns that are created in the protolathe now spawn inside of a lockbox
They can be unlocked by an ID with Armory access or an Emag.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2045 316c924e-a436-60f5-8080-3fe189b3f50e
2011-08-24 04:00:45 +00:00

96 lines
2.0 KiB
Plaintext

/*
Contains the procs that control attacking critters
*/
/obj/critter
attackby(obj/item/weapon/W as obj, mob/living/user as mob)
..()
if (!src.alive) return
var/damage = 0
switch(W.damtype)
if("fire") damage = W.force * firevuln
if("brute") damage = W.force * brutevuln
TakeDamage(damage)
if(src.defensive) Target_Attacker(user)
return
attack_hand(var/mob/user as mob)
if (!src.alive) ..()
if (user.a_intent == "hurt")
TakeDamage(rand(1,2) * brutevuln)
for(var/mob/O in viewers(src, null))
O.show_message("\red <b>[user]</b> punches [src]!", 1)
playsound(src.loc, pick('punch1.ogg','punch2.ogg','punch3.ogg','punch4.ogg'), 100, 1)
if(src.defensive) Target_Attacker(user)
else
for(var/mob/O in viewers(src, null))
O.show_message("\red <b>[user]</b> touches [src]!", 1)
Target_Attacker(var/target)
if(!target) return
src.target = target
src.oldtarget_name = target:name
for(var/mob/O in viewers(src, null))
O.show_message("\red <b>[src]</b> [src.angertext] [target:name]!", 1)
src.task = "chasing"
return
TakeDamage(var/damage = 0)
var/tempdamage = (damage-armor)
if(tempdamage > 0)
src.health -= tempdamage
else
src.health--
if(src.health <= 0)
src.Die()
Die()//Might be more effective to del them and create a dummy item of some sorts
if (!src.alive) return
src.icon_state += "-dead"
src.alive = 0
src.anchored = 0
src.density = 0
walk_to(src,0)
src.visible_message("<b>[src]</b> dies!")
bullet_act(var/obj/item/projectile/Proj)
TakeDamage(Proj.damage)
ex_act(severity)
switch(severity)
if(1.0)
src.Die()
return
if(2.0)
TakeDamage(20)
return
return
emp_act(serverity)
switch(serverity)
if(1.0)
src.Die()
return
if(2.0)
TakeDamage(20)
return
return
meteorhit()
src.Die()
return
blob_act()
if(prob(25))
src.Die()
return