mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 10:33:30 +01:00
Merge pull request #10032 from variableundefined/SqueakComponent
Add in squeak component & refactor bikehorn, mouse to use it.
This commit is contained in:
@@ -18,35 +18,21 @@
|
||||
hitsound = null
|
||||
throwforce = 3
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
var/list/honk_sounds = list('sound/items/bikehorn.ogg' = 1)
|
||||
throw_speed = 3
|
||||
throw_range = 15
|
||||
attack_verb = list("HONKED")
|
||||
var/spam_flag = 0
|
||||
var/honk_sound = 'sound/items/bikehorn.ogg'
|
||||
var/cooldowntime = 20
|
||||
|
||||
/obj/item/bikehorn/attack(mob/living/carbon/M, mob/living/carbon/user)
|
||||
if(!spam_flag)
|
||||
playsound(loc, honk_sound, 50, 1, -1) //plays instead of tap.ogg!
|
||||
return ..()
|
||||
|
||||
/obj/item/bikehorn/attack_self(mob/user)
|
||||
if(!spam_flag)
|
||||
spam_flag = 1
|
||||
playsound(src.loc, honk_sound, 50, 1)
|
||||
src.add_fingerprint(user)
|
||||
spawn(cooldowntime)
|
||||
spam_flag = 0
|
||||
return
|
||||
|
||||
/obj/item/bikehorn/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/squeak, honk_sounds, 50)
|
||||
|
||||
/obj/item/bikehorn/airhorn
|
||||
name = "air horn"
|
||||
desc = "Damn son, where'd you find this?"
|
||||
icon_state = "air_horn"
|
||||
honk_sound = 'sound/items/AirHorn2.ogg'
|
||||
cooldowntime = 50
|
||||
origin_tech = "materials=4;engineering=4"
|
||||
honk_sounds = list('sound/items/airhorn2.ogg' = 1)
|
||||
|
||||
/obj/item/bikehorn/golden
|
||||
name = "golden bike horn"
|
||||
@@ -63,11 +49,10 @@
|
||||
..()
|
||||
|
||||
/obj/item/bikehorn/golden/proc/flip_mobs(mob/living/carbon/M, mob/user)
|
||||
if(!spam_flag)
|
||||
var/turf/T = get_turf(src)
|
||||
for(M in ohearers(7, T))
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!H.can_hear())
|
||||
continue
|
||||
M.emote("flip")
|
||||
var/turf/T = get_turf(src)
|
||||
for(M in ohearers(7, T))
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!H.can_hear())
|
||||
continue
|
||||
M.emote("flip")
|
||||
|
||||
Reference in New Issue
Block a user