From 2162dbfa0b14214dff642cfc76ead1c613de73c2 Mon Sep 17 00:00:00 2001 From: Atermonera Date: Tue, 27 Aug 2019 21:23:52 -0800 Subject: [PATCH 1/2] Merge pull request #6418 from MisterLayne/glass_shard_self_harm Shards Do Damage to Holder --- .../objects/items/weapons/material/shards.dm | 52 +++++++++++++++++++ .../MisterLayne - glass_shard_self_harm.yml | 36 +++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 html/changelogs/MisterLayne - glass_shard_self_harm.yml diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm index ba7438a685..937391737a 100644 --- a/code/game/objects/items/weapons/material/shards.dm +++ b/code/game/objects/items/weapons/material/shards.dm @@ -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("[user] hit \the [target] with \the [src], shattering it!", "You shatter \the [src] in your hand!") + 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, "\The [src] partially cuts into your hand through your gloves as you hit \the [target]!") + if(will_break) + user.visible_message("[user] hit \the [target] with \the [src], shattering it!", "You shatter \the [src] in your hand!") + 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, "\The [src] cuts into your hand as you hit \the [target]!") + if(will_break) + user.visible_message("[user] hit \the [target] with \the [src], shattering it!", "You shatter \the [src] in your hand!") + 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)) diff --git a/html/changelogs/MisterLayne - glass_shard_self_harm.yml b/html/changelogs/MisterLayne - glass_shard_self_harm.yml new file mode 100644 index 0000000000..dd0c47bf85 --- /dev/null +++ b/html/changelogs/MisterLayne - glass_shard_self_harm.yml @@ -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."