From 28c15dcc263a6d7642cb237f28a7a77a453f3434 Mon Sep 17 00:00:00 2001 From: SamCroswell Date: Sat, 8 Nov 2014 14:12:11 -0500 Subject: [PATCH] ESword Changes - All weapons now have a 'no_embed' var. If this var is set to 1 (It is 0 by default) the item will bypass checks to embed into people during melee combat and when thrown. This is intended to be used for items such as the esword, where it is physically impossible for it to be embedded into someone, as opposed to something like the telebaton, where it's simply improbably that would get embedded into anyone. - All energy-based melee weapons have no_embed set to 1. - All energy-based melee weapons now have a more appropriate hitsound when active. See: blade1.ogg --- code/game/objects/items.dm | 1 + code/game/objects/items/weapons/melee/energy.dm | 5 ++++- code/game/objects/items/weapons/swords_axes_etc.dm | 4 ++++ code/game/objects/items/weapons/twohanded.dm | 8 ++++++++ code/modules/mob/living/carbon/human/human_defense.dm | 4 ++-- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index a4b8ea018dc..d5ce9a990fe 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -2,6 +2,7 @@ name = "item" icon = 'icons/obj/items.dmi' var/discrete = 0 // used in item_attack.dm to make an item not show an attack message to viewers + var/no_embed = 0 // For use in item_attack.dm var/icon/blood_overlay = null //this saves our blood splatter overlay, which will be processed not to go over the edges of the sprite var/blood_overlay_color = null var/abstract = 0 diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index c21cad72fed..ac63824ee10 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -1,6 +1,7 @@ /obj/item/weapon/melee/energy var/active = 0 - + no_embed = 1 // Physically impossible for energy weapons to embed themselves into people, this should fix that. -- Dave + hitsound = 'sound/weapons/blade1.ogg' // Probably more appropriate than the previous hitsound. -- Dave /obj/item/weapon/melee/energy/suicide_act(mob/user) viewers(user) << pick("[user] is slitting \his stomach open with the [src.name]! It looks like \he's trying to commit seppuku.", \ @@ -16,6 +17,7 @@ throw_speed = 1 throw_range = 5 w_class = 3.0 + hitsound = "swing_hit" flags = FPRINT | CONDUCT | NOSHIELD | TABLEPASS origin_tech = "combat=3" attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut") @@ -37,6 +39,7 @@ throw_speed = 1 throw_range = 5 w_class = 2.0 + hitsound = "swing_hit" flags = FPRINT | TABLEPASS | NOSHIELD origin_tech = "magnets=3;syndicate=4" attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm index 9769ce6478d..a0614213ba0 100644 --- a/code/game/objects/items/weapons/swords_axes_etc.dm +++ b/code/game/objects/items/weapons/swords_axes_etc.dm @@ -39,6 +39,7 @@ icon_state = "sword[_color]" w_class = 4 playsound(user, 'sound/weapons/saberon.ogg', 50, 1) + hitsound = 'sound/weapons/blade1.ogg' user << "\blue [src] is now active." else force = 3 @@ -48,6 +49,7 @@ icon_state = "sword0" w_class = 2 playsound(user, 'sound/weapons/saberoff.ogg', 50, 1) + hitsound = "swing_hit" user << "\blue [src] can now be concealed." if(istype(user,/mob/living/carbon/human)) var/mob/living/carbon/human/H = user @@ -250,11 +252,13 @@ src.force = 150 src.icon_state = "axe1" src.w_class = 5 + hitsound = 'sound/weapons/blade1.ogg' else user << "\blue The axe can now be concealed." src.force = 40 src.icon_state = "axe0" src.w_class = 5 + hitsound = "swing_hit" src.add_fingerprint(user) return diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index f3faedcb39b..0f24c096e1f 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -196,6 +196,7 @@ obj/item/weapon/twohanded/ attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") sharp = 1 edge = 1 + no_embed = 1 // Like with the single-handed esword, this shouldn't be embedding in people. /obj/item/weapon/twohanded/dualsaber/update_icon() icon_state = "dualsaber[wielded]" @@ -227,6 +228,13 @@ obj/item/weapon/twohanded/ New() color = "red" +/obj/item/weapon/twohanded/dualsaber/unwield() + ..() + hitsound = "swing_hit" + +/obj/item/weapon/twohanded/dualsaber/wield() + ..() + hitsound = 'sound/weapons/blade1.ogg' //spears /obj/item/weapon/twohanded/spear diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index aa97abc7111..73b840d96c4 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -311,7 +311,7 @@ emp_act var/embed_threshold = weapon_sharp? 5*I.w_class : 15*I.w_class //Sharp objects will always embed if they do enough damage. - if((weapon_sharp && damage > (10*I.w_class)) || (damage > embed_threshold && prob(embed_chance))) + if(((weapon_sharp && damage > (10*I.w_class)) || (damage > embed_threshold && prob(embed_chance))) && (I.no_embed == 0) ) affecting.embed(I) return 1 @@ -381,7 +381,7 @@ emp_act //Sharp objects will always embed if they do enough damage. //Thrown sharp objects have some momentum already and have a small chance to embed even if the damage is below the threshold - if((sharp && prob(damage/(10*I.w_class)*100)) || (damage > embed_threshold && prob(embed_chance))) + if(((sharp && prob(damage/(10*I.w_class)*100)) || (damage > embed_threshold && prob(embed_chance))) && (I.no_embed == 0)) affecting.embed(I) // Begin BS12 momentum-transfer code.