mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-25 21:19:44 +01:00
Taser cleanup and fixes
Fixes cloaking devices and deadman switches being included in taser code somehow.
This commit is contained in:
@@ -10,23 +10,29 @@ emp_act
|
||||
|
||||
/mob/living/carbon/human/bullet_act(var/obj/item/projectile/P, var/def_zone)
|
||||
|
||||
// BEGIN TASER NERF
|
||||
/* Commenting out new-old taser nerf.
|
||||
if(C.siemens_coefficient == 0) //If so, is that clothing shock proof?
|
||||
if(prob(deflectchance))
|
||||
visible_message("\red <B>The [P.name] gets deflected by [src]'s [C.name]!</B>") //DEFLECT!
|
||||
visible_message("\red <B> Taser hit for [P.damage] damage!</B>")
|
||||
del P
|
||||
*/
|
||||
/* Commenting out old Taser nerf
|
||||
if(wear_suit && istype(wear_suit, /obj/item/clothing/suit/armor))
|
||||
if(istype(P, /obj/item/projectile/energy/electrode))
|
||||
visible_message("\red <B>The [P.name] gets deflected by [src]'s [wear_suit.name]!</B>")
|
||||
del P
|
||||
return -1
|
||||
*/
|
||||
// END TASER NERF
|
||||
var/datum/organ/external/organ = get_organ(check_zone(def_zone))
|
||||
|
||||
//Being hit while using a cloaking device
|
||||
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
|
||||
update_icons()
|
||||
src << "\blue Your [C.name] was disrupted!"
|
||||
Stun(2)
|
||||
|
||||
//Being hit while using a deadman switch
|
||||
if(istype(equipped(),/obj/item/device/assembly/signaler))
|
||||
var/obj/item/device/assembly/signaler/signaler = equipped()
|
||||
if(signaler.deadman && prob(80))
|
||||
src.visible_message("\red [src] triggers their deadman's switch!")
|
||||
signaler.signal()
|
||||
|
||||
//Shields
|
||||
if(check_shields(P.damage, "the [P.name]"))
|
||||
P.on_hit(src, 2, def_zone)
|
||||
return 2
|
||||
|
||||
//Laserproof armour
|
||||
if(wear_suit && istype(wear_suit, /obj/item/clothing/suit/armor/laserproof))
|
||||
if(istype(P, /obj/item/projectile/energy) || istype(P, /obj/item/projectile/beam))
|
||||
var/reflectchance = 40 - round(P.damage/3)
|
||||
@@ -50,54 +56,35 @@ emp_act
|
||||
P.xo = new_x - curloc.x
|
||||
|
||||
return -1 // complete projectile permutation
|
||||
|
||||
//BEGIN BOOK'S TASER NERF.
|
||||
|
||||
//BEGIN BOOK'S TASER NERF.
|
||||
if(istype(P, /obj/item/projectile/beam/stun))
|
||||
var/datum/organ/external/select_area = get_organ(def_zone) // We're checking the outside, buddy!
|
||||
var/list/body_parts = list(head, wear_mask, wear_suit, w_uniform, gloves, shoes) // What all are we checking?
|
||||
// var/deflectchance=90 //Is it a CRITICAL HIT with that taser?
|
||||
for(var/bp in body_parts) //Make an unregulated var to pass around.
|
||||
if(!bp)
|
||||
continue //Does this thing we're shooting even exist?
|
||||
if(bp && istype(bp ,/obj/item/clothing)) // If it exists, and it's clothed
|
||||
var/obj/item/clothing/C = bp // Then call an argument C to be that clothing!
|
||||
if(C.body_parts_covered & select_area.body_part) // Is that body part being targeted covered?
|
||||
P.agony=P.agony*C.siemens_coefficient
|
||||
var/list/clothing_items = list(head, wear_mask, wear_suit, w_uniform, gloves, shoes) // What all are we checking?
|
||||
|
||||
for(var/obj/item/clothing/CL in clothing_items) //Make an unregulated var to pass around.
|
||||
if(!istype(CL)) //This isn't necessary, is it?
|
||||
continue
|
||||
if(CL.body_parts_covered & select_area.body_part) // Is that body part being targeted covered by CL?
|
||||
P.agony *= CL.siemens_coefficient
|
||||
|
||||
//blocked = 0 here as we've already adjused based on siemens_coefficient.
|
||||
apply_effect(P.agony,AGONY,0)
|
||||
flash_pain()
|
||||
src <<"\red You have been shot!"
|
||||
src <<"\red You have been hit by [P]!"
|
||||
del P
|
||||
|
||||
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
|
||||
update_icons()
|
||||
src << "\blue Your [C.name] was disrupted!"
|
||||
Stun(2)
|
||||
|
||||
if(istype(equipped(),/obj/item/device/assembly/signaler))
|
||||
var/obj/item/device/assembly/signaler/signaler = equipped()
|
||||
if(signaler.deadman && prob(80))
|
||||
src.visible_message("\red [src] triggers their deadman's switch!")
|
||||
signaler.signal()
|
||||
|
||||
return
|
||||
//END TASER NERF
|
||||
//END TASER NERF
|
||||
|
||||
if(check_shields(P.damage, "the [P.name]"))
|
||||
P.on_hit(src, 2, def_zone)
|
||||
return 2
|
||||
|
||||
var/datum/organ/external/organ = get_organ(check_zone(def_zone))
|
||||
|
||||
var/armor = getarmor_organ(organ, "bullet")
|
||||
|
||||
if((P.embed && prob(20 + max(P.damage - armor, -10))) && P.damage_type == BRUTE)
|
||||
var/obj/item/weapon/shard/shrapnel/SP = new()
|
||||
(SP.name) = "[P.name] shrapnel"
|
||||
(SP.desc) = "[SP.desc] It looks like it was fired from [P.shot_from]."
|
||||
(SP.loc) = organ
|
||||
organ.embed(SP)
|
||||
//Shrapnel
|
||||
if (P.damage_type == BRUTE)
|
||||
var/armor = getarmor_organ(organ, "bullet")
|
||||
if((P.embed && prob(20 + max(P.damage - armor, -10))))
|
||||
var/obj/item/weapon/shard/shrapnel/SP = new()
|
||||
(SP.name) = "[P.name] shrapnel"
|
||||
(SP.desc) = "[SP.desc] It looks like it was fired from [P.shot_from]."
|
||||
(SP.loc) = organ
|
||||
organ.embed(SP)
|
||||
|
||||
return (..(P , def_zone))
|
||||
|
||||
@@ -186,6 +173,7 @@ emp_act
|
||||
..()
|
||||
|
||||
|
||||
//Returns 1 if the attack hit, 0 if it missed.
|
||||
/mob/living/carbon/human/proc/attacked_by(var/obj/item/I, var/mob/living/user, var/def_zone)
|
||||
if(!I || !user) return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user