Files
Bubberstation/code/modules/paperwork/desk_bell.dm
T
John Willard b4f19a7e0f Greatly increases Pun Pun's abilities and strengths (using desk bells, cross stun immunity) (#68870)
About The Pull Request

Pun Pun has a new AI, with it they received the following:

    Instead of screeching/roaring/scratching/jumping/rolling, Pun Pun will instead sing/dance/bow/clear throat/sign.
    Pun Pun now rings desk bells instead of finding random shit to pick up, and doesn't intentionally seek out weapons.
    Pun Pun has a higher chance of giving people stuff in their hand, so the Bartender can give them a drink and let them go walking around.

Additionally:

    Pun Pun is now immune to being hardstunned by walking into them, giving them a little more bite for greytiders beating them up.
    Monkeys can now use desk bells.

Why It's Good For The Game

I like Pun Pun and when Monkey AIs were originally added, there was a note about giving them a unique AI. Since we're slowly turning the poor monkey into an actual Bartender assistant, I find it thematic that they would ring the bell and give out drinks in their hand, as if the Bartender taught them themselves.

For the hardstun immunity, I mostly did it because I find it annoying for a Bartender to have to carefully navigate around Pun Pun to not knock them over and make them drop an instrument (or anything else) in their hand, but it also works as a buff to people trying to kill them. Pun pun is a unique monkey so I don't believe they should be as easy to kill as any other.

Desk bell addition was necessary for Pun Pun to use it.
Changelog

cl
add: Pun Pun now gives stuff in their hand frequently and rings desk bells.
add: Pun Pun now has gentleman-like emotes, rather than screeching and roaring.
balance: Pun Pun no longer looks for weapons in their off time.
balance: Pun Pun is no longer vulnerable to stuns by being walked into.
qol: Monkeys can now use desk bells.
/cl
2022-08-05 12:38:59 +12:00

127 lines
4.4 KiB
Plaintext

// A receptionist's bell
/obj/structure/desk_bell
name = "desk bell"
desc = "The cornerstone of any customer service job. You feel an unending urge to ring it."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "desk_bell"
layer = OBJ_LAYER
anchored = FALSE
pass_flags = PASSTABLE // Able to place on tables
max_integrity = 5000 // To make attacking it not instantly break it
/// The amount of times this bell has been rang, used to check the chance it breaks
var/times_rang = 0
/// Is this bell broken?
var/broken_ringer = FALSE
/// The cooldown for ringing the bell
COOLDOWN_DECLARE(ring_cooldown)
/// The length of the cooldown. Setting it to 0 will skip all cooldowns alltogether.
var/ring_cooldown_length = 0.3 SECONDS // This is here to protect against tinnitus.
/// The sound the bell makes
var/ring_sound = 'sound/machines/microwave/microwave-end.ogg'
/obj/structure/desk_bell/Initialize(mapload)
. = ..()
register_context()
/obj/structure/desk_bell/add_context(atom/source, list/context, obj/item/held_item, mob/user)
. = ..()
if(held_item?.tool_behaviour == TOOL_WRENCH)
context[SCREENTIP_CONTEXT_RMB] = "Disassemble"
return CONTEXTUAL_SCREENTIP_SET
if(broken_ringer)
if(held_item?.tool_behaviour == TOOL_SCREWDRIVER)
context[SCREENTIP_CONTEXT_LMB] = "Fix"
else
var/click_context = "Ring"
if(prob(1))
click_context = "Annoy"
context[SCREENTIP_CONTEXT_LMB] = click_context
return CONTEXTUAL_SCREENTIP_SET
/obj/structure/desk_bell/attack_hand(mob/living/user, list/modifiers)
. = ..()
if(!COOLDOWN_FINISHED(src, ring_cooldown) && ring_cooldown_length)
return TRUE
if(!ring_bell(user))
to_chat(user, span_notice("[src] is silent. Some idiot broke it."))
if(ring_cooldown_length)
COOLDOWN_START(src, ring_cooldown, ring_cooldown_length)
return TRUE
/obj/structure/desk_bell/attack_paw(mob/user, list/modifiers)
return attack_hand(user, modifiers)
/obj/structure/desk_bell/attackby(obj/item/weapon, mob/living/user, params)
. = ..()
times_rang += weapon.force
ring_bell(user)
// Fix the clapper
/obj/structure/desk_bell/screwdriver_act(mob/living/user, obj/item/tool)
if(broken_ringer)
balloon_alert(user, "repairing...")
tool.play_tool_sound(src)
if(tool.use_tool(src, user, 5 SECONDS))
balloon_alert_to_viewers("repaired")
playsound(user, 'sound/items/change_drill.ogg', 50, vary = TRUE)
broken_ringer = FALSE
times_rang = 0
return TOOL_ACT_TOOLTYPE_SUCCESS
return FALSE
return ..()
// Deconstruct
/obj/structure/desk_bell/wrench_act_secondary(mob/living/user, obj/item/tool)
balloon_alert(user, "taking apart...")
tool.play_tool_sound(src)
if(tool.use_tool(src, user, 5 SECONDS))
balloon_alert(user, "disassembled")
playsound(user, 'sound/items/deconstruct.ogg', 50, vary = TRUE)
if(!broken_ringer) // Drop 2 if it's not broken.
new/obj/item/stack/sheet/iron(drop_location())
new/obj/item/stack/sheet/iron(drop_location())
qdel(src)
return TOOL_ACT_TOOLTYPE_SUCCESS
return ..()
/// Check if the clapper breaks, and if it does, break it
/obj/structure/desk_bell/proc/check_clapper(mob/living/user)
if(((times_rang >= 10000) || prob(times_rang/100)) && ring_cooldown_length)
to_chat(user, span_notice("You hear [src]'s clapper fall off of its hinge. Nice job, you broke it."))
broken_ringer = TRUE
/// Ring the bell
/obj/structure/desk_bell/proc/ring_bell(mob/living/user)
if(broken_ringer)
return FALSE
check_clapper(user)
// The lack of varying is intentional. The only variance occurs on the strike the bell breaks.
playsound(src, ring_sound, 70, vary = broken_ringer, extrarange = SHORT_RANGE_SOUND_EXTRARANGE)
flick("desk_bell_ring", src)
times_rang++
return TRUE
// A warning to all who enter; the ringing sound STACKS. It won't be deafening because it only goes every decisecond,
// but I did feel like my ears were going to start bleeding when I tested it with my autoclicker.
/obj/structure/desk_bell/speed_demon
desc = "The cornerstone of any customer service job. This one's been modified for hyper-performance."
ring_cooldown_length = 0
/obj/structure/desk_bell/MouseDrop(obj/over_object, src_location, over_location)
if(!istype(over_object, /obj/vehicle/ridden/wheelchair))
return
if(!Adjacent(over_object) || !Adjacent(usr))
return
var/obj/vehicle/ridden/wheelchair/target = over_object
if(target.bell_attached)
usr.balloon_alert(usr, "already has a bell!")
return
usr.balloon_alert(usr, "attaching bell...")
if(!do_after(usr, 0.5 SECONDS))
return
target.attach_bell(src)
return ..()