diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 25bdb748302..7fbfbc1377a 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -560,6 +560,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_LIVING_HEART "living_heart" /// Prevents the same person from being chosen multiple times for kidnapping objective #define TRAIT_HAS_BEEN_KIDNAPPED "has_been_kidnapped" +/// An item still plays its hitsound even if it has 0 force, instead of the tap +#define TRAIT_CUSTOM_TAP_SOUND "no_tap_sound" //quirk traits #define TRAIT_ALCOHOL_TOLERANCE "alcohol_tolerance" @@ -732,6 +734,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define MAFIA_TRAIT "mafia" /// Trait associated with highlander #define HIGHLANDER_TRAIT "highlander" +/// Trait given from playing pretend with baguettes +#define SWORDPLAY_TRAIT "swordplay" ///generic atom traits /// Trait from [/datum/element/rust]. Its rusty and should be applying a special overlay to denote this. diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 3e29015cec6..882d08dbc77 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -185,7 +185,8 @@ if(force && HAS_TRAIT(user, TRAIT_PACIFISM)) to_chat(user, span_warning("You don't want to harm other living beings!")) return - if(!force) + + if(!force && !HAS_TRAIT(src, TRAIT_CUSTOM_TAP_SOUND)) playsound(loc, 'sound/weapons/tap.ogg', get_clamped_volume(), TRUE, -1) else if(hitsound) playsound(loc, hitsound, get_clamped_volume(), TRUE, extrarange = stealthy_audio ? SILENCED_SOUND_EXTRARANGE : -1, falloff_distance = 0) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index be7f3619346..c2b2e9f908a 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -802,7 +802,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons itempush = 0 //too light to push anything if(isliving(hit_atom)) //Living mobs handle hit sounds differently. var/volume = get_volume_by_throwforce_and_or_w_class() - if (throwforce > 0) + if (throwforce > 0 || HAS_TRAIT(src, TRAIT_CUSTOM_TAP_SOUND)) if (mob_throw_hit_sound) playsound(hit_atom, mob_throw_hit_sound, volume, TRUE, -1) else if(hitsound) diff --git a/code/game/objects/items/food/bread.dm b/code/game/objects/items/food/bread.dm index b1449ae95d5..93e95b14f21 100644 --- a/code/game/objects/items/food/bread.dm +++ b/code/game/objects/items/food/bread.dm @@ -270,15 +270,15 @@ /obj/item/food/baguette/add_context(atom/source, list/context, obj/item/held_item, mob/user) . = ..() if (user.mind?.miming && held_item == src) - context[SCREENTIP_CONTEXT_RMB] = "Toggle Swordplay" + context[SCREENTIP_CONTEXT_LMB] = "Toggle Swordplay" return CONTEXTUAL_SCREENTIP_SET /obj/item/food/baguette/examine(mob/user) var/examine_list = ..() if(user.mind?.miming) - examine_list += span_notice("You can wield this like a sword by right clicking it.") + examine_list += span_notice("You can wield this like a sword by using it in your hand.") -/obj/item/food/baguette/attack_self_secondary(mob/user, modifiers) +/obj/item/food/baguette/attack_self(mob/user, modifiers) . = ..() if(!user.mind?.miming) return @@ -292,9 +292,11 @@ span_notice("[user] begins wielding [src] like a sword!"), span_notice("You begin wielding [src] like a sword, with a firm grip on the bottom as an imaginary handle.") ) + ADD_TRAIT(src, TRAIT_CUSTOM_TAP_SOUND, SWORDPLAY_TRAIT) attack_verb_continuous = list("slashes", "cuts") attack_verb_simple = list("slash", "cut") hitsound = 'sound/weapons/rapierhit.ogg' + fake_swordplay = TRUE RegisterSignal(src, COMSIG_ITEM_EQUIPPED, .proc/on_sword_equipped) RegisterSignal(src, COMSIG_ITEM_DROPPED, .proc/on_sword_dropped) @@ -302,14 +304,16 @@ /obj/item/food/baguette/proc/end_swordplay(mob/user) UnregisterSignal(src, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED)) + REMOVE_TRAIT(src, TRAIT_CUSTOM_TAP_SOUND, SWORDPLAY_TRAIT) attack_verb_continuous = initial(attack_verb_continuous) attack_verb_simple = initial(attack_verb_simple) hitsound = initial(hitsound) + fake_swordplay = FALSE if(user) - visible_message( \ - span_notice("[user] no longer holds [src] like a sword!"), \ - span_notice("You go back to holding [src] normally.") \ + visible_message( + span_notice("[user] no longer holds [src] like a sword!"), + span_notice("You go back to holding [src] normally.") ) /obj/item/food/baguette/proc/on_sword_dropped(datum/source, mob/user)