Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes horns less awful #442

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions code/game/objects/items/weapons/clown_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,31 +105,31 @@
throw_speed = 3
throw_range = 7
attack_verb = list("HONKED")
var/spam_flag = 0
var/next_honk = 1
var/honksound = 'sound/items/bikehorn.ogg'
var/cooldowntime = 20
var/cooldowntime = 20 //Add 1 since you cannot honk at the same world.time
var/stephonk = TRUE

/obj/item/weapon/bikehorn/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] solemnly points the horn at [user.p_their()] temple! It looks like [user.p_theyre()] trying to commit suicide!</span>")
playsound(src.loc, honksound, 50, 1)
return (BRUTELOSS)

/obj/item/weapon/bikehorn/attack(mob/living/carbon/M, mob/living/carbon/user)
if(!spam_flag)
if(next_honk < world.time)
playsound(loc, honksound, 50, 1, -1) //plays instead of tap.ogg!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you need next_honk = world.time + cooldowntime here as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shh))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually going to be affected by melee cooldown I think

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can probably attack more often than the length of the sound

return ..()

/obj/item/weapon/bikehorn/attack_self(mob/user)
if(!spam_flag)
spam_flag = 1
if(next_honk < world.time)
next_honk = world.time + cooldowntime
playsound(src.loc, honksound, 50, 1)
src.add_fingerprint(user)
spawn(cooldowntime)
spam_flag = 0
return

/obj/item/weapon/bikehorn/Crossed(mob/living/L)
if(isliving(L))
if(isliving(L) && stephonk && (next_honk < world.time))
next_honk = world.time + cooldowntime
playsound(loc, honksound, 50, 1, -1)
..()

Expand All @@ -140,6 +140,7 @@
honksound = 'sound/items/AirHorn2.ogg'
cooldowntime = 50
origin_tech = "materials=4;engineering=4"
stephonk = FALSE

/obj/item/weapon/bikehorn/golden
name = "golden bike horn"
Expand All @@ -156,7 +157,7 @@
..()

/obj/item/weapon/bikehorn/golden/proc/flip_mobs(mob/living/carbon/M, mob/user)
if (!spam_flag)
if (next_honk < world.time)
var/turf/T = get_turf(src)
for(M in ohearers(7, T))
if(ishuman(M))
Expand Down