mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 04:57:57 +01:00
Mimes can now hold a baguette like a sword by right clicking it (#69592)
* hon hon on your guard hon hon * Update bread.dm * yaey * didn't annotate lints....
This commit is contained in:
@@ -256,6 +256,68 @@
|
||||
tastes = list("bread" = 1)
|
||||
foodtypes = GRAIN
|
||||
venue_value = FOOD_PRICE_CHEAP
|
||||
/// whether this is in fake swordplay mode or not
|
||||
var/fake_swordplay = FALSE
|
||||
|
||||
/obj/item/food/baguette/Initialize()
|
||||
. = ..()
|
||||
register_context()
|
||||
|
||||
/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"
|
||||
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.")
|
||||
|
||||
/obj/item/food/baguette/attack_self_secondary(mob/user, modifiers)
|
||||
. = ..()
|
||||
if(!user.mind?.miming)
|
||||
return
|
||||
if(fake_swordplay)
|
||||
end_swordplay(user)
|
||||
else
|
||||
begin_swordplay(user)
|
||||
|
||||
/obj/item/food/baguette/proc/begin_swordplay(mob/user)
|
||||
visible_message(
|
||||
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.")
|
||||
)
|
||||
attack_verb_continuous = list("slashes", "cuts")
|
||||
attack_verb_simple = list("slash", "cut")
|
||||
hitsound = 'sound/weapons/rapierhit.ogg'
|
||||
|
||||
RegisterSignal(src, COMSIG_ITEM_EQUIPPED, .proc/on_sword_equipped)
|
||||
RegisterSignal(src, COMSIG_ITEM_DROPPED, .proc/on_sword_dropped)
|
||||
|
||||
/obj/item/food/baguette/proc/end_swordplay(mob/user)
|
||||
UnregisterSignal(src, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED))
|
||||
|
||||
attack_verb_continuous = initial(attack_verb_continuous)
|
||||
attack_verb_simple = initial(attack_verb_simple)
|
||||
hitsound = initial(hitsound)
|
||||
|
||||
if(user)
|
||||
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)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
end_swordplay()
|
||||
|
||||
/obj/item/food/baguette/proc/on_sword_equipped(datum/source, mob/equipper, slot)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(slot != ITEM_SLOT_HANDS)
|
||||
end_swordplay()
|
||||
|
||||
/obj/item/food/garlicbread
|
||||
name = "garlic bread"
|
||||
|
||||
Reference in New Issue
Block a user