mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-11 07:04:01 +01:00
Merge pull request #5726 from VOREStation/upstream-merge-6418
[MIRROR] Shards Do Damage to Holder
This commit is contained in:
@@ -61,6 +61,58 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/material/shard/afterattack(var/atom/target, mob/living/carbon/human/user as mob)
|
||||
var/active_hand //hand the shard is in
|
||||
var/will_break
|
||||
var/gloves_are_heavy = FALSE//this is a fucking mess
|
||||
var/break_damage = 4
|
||||
var/light_glove_d = rand(2, 4)
|
||||
var/no_glove_d = rand(4, 6)
|
||||
var/list/h_gloves = list(/obj/item/clothing/gloves/captain, /obj/item/clothing/gloves/cyborg,
|
||||
/obj/item/clothing/gloves/swat, /obj/item/clothing/gloves/combat,
|
||||
/obj/item/clothing/gloves/botanic_leather, /obj/item/clothing/gloves/duty,
|
||||
/obj/item/clothing/gloves/tactical, /obj/item/clothing/gloves/vox,
|
||||
/obj/item/clothing/gloves/gauntlets)
|
||||
|
||||
if(istype(user.l_hand, src))
|
||||
active_hand = BP_L_HAND
|
||||
else
|
||||
active_hand = BP_R_HAND
|
||||
|
||||
if(prob(75))
|
||||
will_break = TRUE
|
||||
else
|
||||
will_break = FALSE
|
||||
|
||||
if(user.gloves && (user.gloves.body_parts_covered & HANDS))
|
||||
var/obj/item/clothing/gloves/UG = user.gloves.type
|
||||
for(var/I in h_gloves)
|
||||
if(UG == I)
|
||||
gloves_are_heavy = TRUE
|
||||
if(will_break)
|
||||
user.visible_message("<span class='danger'>[user] hit \the [target] with \the [src], shattering it!</span>", "<span class='warning'>You shatter \the [src] in your hand!</span>")
|
||||
playsound(user, pick('sound/effects/Glassbr1.ogg', 'sound/effects/Glassbr2.ogg', 'sound/effects/Glassbr3.ogg'), 30, 1)
|
||||
qdel(src)
|
||||
|
||||
if(gloves_are_heavy == FALSE)
|
||||
to_chat(user, "<span class='warning'>\The [src] partially cuts into your hand through your gloves as you hit \the [target]!</span>")
|
||||
if(will_break)
|
||||
user.visible_message("<span class='danger'>[user] hit \the [target] with \the [src], shattering it!</span>", "<span class='warning'>You shatter \the [src] in your hand!</span>")
|
||||
user.apply_damage(light_glove_d + break_damage, BRUTE, active_hand, 0 ,0, src, src.sharp, src.edge)
|
||||
playsound(user, pick('sound/effects/Glassbr1.ogg', 'sound/effects/Glassbr2.ogg', 'sound/effects/Glassbr3.ogg'), 30, 1)
|
||||
qdel(src)
|
||||
else
|
||||
user.apply_damage(light_glove_d, BRUTE, active_hand, 0 ,0, src, src.sharp, src.edge)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>\The [src] cuts into your hand as you hit \the [target]!</span>")
|
||||
if(will_break)
|
||||
user.visible_message("<span class='danger'>[user] hit \the [target] with \the [src], shattering it!</span>", "<span class='warning'>You shatter \the [src] in your hand!</span>")
|
||||
user.apply_damage(no_glove_d + break_damage, BRUTE, active_hand, 0 ,0, src, src.sharp, src.edge)
|
||||
playsound(user, pick('sound/effects/Glassbr1.ogg', 'sound/effects/Glassbr2.ogg', 'sound/effects/Glassbr3.ogg'), 30, 1)
|
||||
qdel(src)
|
||||
else
|
||||
user.apply_damage(no_glove_d, BRUTE, active_hand, 0 ,0, src, src.sharp, src.edge)
|
||||
|
||||
/obj/item/weapon/material/shard/Crossed(AM as mob|obj)
|
||||
..()
|
||||
if(isliving(AM))
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
################################
|
||||
# Example Changelog File
|
||||
#
|
||||
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||
#
|
||||
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||
# When it is, any changes listed below will disappear.
|
||||
#
|
||||
# Valid Prefixes:
|
||||
# bugfix
|
||||
# wip (For works in progress)
|
||||
# tweak
|
||||
# soundadd
|
||||
# sounddel
|
||||
# rscadd (general adding of nice things)
|
||||
# rscdel (general deleting of nice things)
|
||||
# imageadd
|
||||
# imagedel
|
||||
# maptweak
|
||||
# spellcheck (typo fixes)
|
||||
# experiment
|
||||
#################################
|
||||
|
||||
# Your name.
|
||||
author: MisterLayne
|
||||
|
||||
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||
delete-after: True
|
||||
|
||||
# Any changes you've made. See valid prefix list above.
|
||||
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||
# SCREW THIS UP AND IT WON'T WORK.
|
||||
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
|
||||
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
|
||||
changes:
|
||||
- tweak: "Glass shards now do damage when you attack with them, based on the type of gloves you are wearing."
|
||||
Reference in New Issue
Block a user