mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
- Made throwing log and factor armor. The attack_log (Both server and mob) will show who last touched the object as the 'assailant', even if they didn't directly hit them.
Fixes Issue 1033 git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4965 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -23,10 +23,7 @@
|
|||||||
/atom/proc/throw_impact(atom/hit_atom)
|
/atom/proc/throw_impact(atom/hit_atom)
|
||||||
if(istype(hit_atom,/mob/living))
|
if(istype(hit_atom,/mob/living))
|
||||||
var/mob/living/M = hit_atom
|
var/mob/living/M = hit_atom
|
||||||
M.visible_message("\red [hit_atom] has been hit by [src].")
|
M.hitby(src)
|
||||||
if(isobj(src))//Hate typecheckin for a child object but this is just fixing crap another guy broke so if someone wants to put the time in and make this proper feel free.
|
|
||||||
M.take_organ_damage(src:throwforce)
|
|
||||||
|
|
||||||
|
|
||||||
else if(isobj(hit_atom))
|
else if(isobj(hit_atom))
|
||||||
var/obj/O = hit_atom
|
var/obj/O = hit_atom
|
||||||
|
|||||||
@@ -52,3 +52,26 @@
|
|||||||
apply_damage((P.damage/(absorb+1)), P.damage_type, def_zone)
|
apply_damage((P.damage/(absorb+1)), P.damage_type, def_zone)
|
||||||
P.on_hit(src, absorb)
|
P.on_hit(src, absorb)
|
||||||
return absorb
|
return absorb
|
||||||
|
|
||||||
|
/mob/living/hitby(atom/movable/AM as mob|obj)//Standardization and logging -Sieve
|
||||||
|
if(istype(AM,/obj/))
|
||||||
|
var/obj/O = AM
|
||||||
|
var/zone = ran_zone("chest",75)//Hits a random part of the body, geared towards the chest
|
||||||
|
var/dtype = BRUTE
|
||||||
|
if(istype(O,/obj/item/weapon))
|
||||||
|
var/obj/item/weapon/W = O
|
||||||
|
dtype = W.damtype
|
||||||
|
src.visible_message("\red [src] has been hit by [O].")
|
||||||
|
var/armor = run_armor_check(zone, "melee", "Your armor has protected your [zone].", "Your armor has softened hit to your [zone].")
|
||||||
|
if(armor < 2)
|
||||||
|
apply_damage(O.throwforce, dtype, zone, armor, O)
|
||||||
|
if(!O.fingerprintslast)
|
||||||
|
return
|
||||||
|
var/mob/assailant = null
|
||||||
|
for(var/mob/living/M in player_list)//Finds the name of whoever threw it (This is required unless thrown objects are COMPLETELY reworked
|
||||||
|
if(M.key == O.fingerprintslast)
|
||||||
|
assailant = M
|
||||||
|
continue
|
||||||
|
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been hit with [O], last touched by [assailant.name] ([assailant.ckey])</font>")
|
||||||
|
assailant.attack_log += text("\[[time_stamp()]\] <font color='red'>Hit [src.name] ([src.ckey]) with [O]</font>")
|
||||||
|
log_attack("<font color='red'>[src.name] ([src.ckey]) was hit by [O], last touched by [assailant.name] ([assailant.ckey])</font>")
|
||||||
Reference in New Issue
Block a user