Skip to content

Commit

Permalink
ЕБАТЬ ТУТ ОПТИМИЗАЦИИ НИХУЯ АХУЕТЬ
Browse files Browse the repository at this point in the history
  • Loading branch information
Discozavisim committed Feb 6, 2025
1 parent 18c1b39 commit 26f5d3d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 26 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/cooldowns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#define COOLDOWN_MECHA_ARMOR "mecha_armor"
#define COOLDOWN_MECHA_MELEE_ATTACK "mecha_melee"
#define COOLDOWN_MECHA_SMOKE "mecha_smoke"

#define COOLDOWN_MOB_AUDIO "mob_audio_cooldown"
//TIMER COOLDOWN MACROS

#define COMSIG_CD_STOP(cd_index) "cooldown_[cd_index]"
Expand Down
17 changes: 11 additions & 6 deletions code/datums/emotes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
var/stat_allowed = CONSCIOUS
var/sound //Sound to play when emote is called
var/vary = FALSE //used for the honk borg emote
var/only_forced_audio = FALSE //can only code call this event instead of the player.
// var/only_forced_audio = FALSE //can only code call this event instead of the player.
var/cooldown = 0.8 SECONDS
var/audio_cooldown = 10 SECONDS

/datum/emote/New()
if (ispath(mob_type_allowed_typecache))
Expand All @@ -50,10 +51,10 @@

msg = replace_pronoun(user, msg)

if(isliving(user))
var/mob/living/L = user
for(var/obj/item/implant/I in L.implants)
I.trigger(key, L)
// if(isliving(user))
// var/mob/living/L = user
// for(var/obj/item/implant/I in L.implants)
// I.trigger(key, L)

if(!msg)
return
Expand All @@ -62,7 +63,11 @@
// var/dchatmsg = "<b>[user]</b> [msg]"

var/tmp_sound = get_sound(user)
if(tmp_sound && (!only_forced_audio || !intentional))
if(tmp_sound)
if(TIMER_COOLDOWN_CHECK(user, COOLDOWN_MOB_AUDIO))
return
TIMER_COOLDOWN_START(user, type, audio_cooldown)
S_TIMER_COOLDOWN_START(user, COOLDOWN_MOB_AUDIO, 10 SECONDS)
playsound(user, tmp_sound, 50, vary)
/* // [ChillRaccoon] - ghosts shouldn't see emotes if they arent see emoting object
for(var/mob/M in GLOB.dead_mob_list)
Expand Down
10 changes: 4 additions & 6 deletions code/modules/mob/living/carbon/human/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
message = "screams!"
message_mime = "acts out a scream!"
emote_type = EMOTE_AUDIBLE
only_forced_audio = TRUE
// only_forced_audio = TRUE
vary = TRUE

/datum/emote/living/carbon/human/scream/get_sound(mob/living/user)
Expand All @@ -59,15 +59,13 @@
var/mob/living/carbon/human/H = user
if(H.mind?.miming)
return
if(ishumanbasic(H) || isfelinid(H))
if(ishuman(H))
if(user.gender == FEMALE)
return pick('sound/voice/human/femalescream_1.ogg', 'sound/voice/human/femalescream_2.ogg', 'sound/voice/human/femalescream_3.ogg', 'sound/voice/human/femalescream_4.ogg', 'sound/voice/human/femalescream_5.ogg')
else
if(prob(1))
return 'sound/voice/human/wilhelm_scream.ogg'
// if(prob(1))
// return 'sound/voice/human/wilhelm_scream.ogg'
return pick('sound/voice/human/malescream_1.ogg', 'sound/voice/human/malescream_2.ogg', 'sound/voice/human/malescream_3.ogg', 'sound/voice/human/malescream_4.ogg', 'sound/voice/human/malescream_5.ogg', 'sound/voice/human/malescream_6.ogg')
else if(ismoth(H))
return 'sound/voice/moth/scream_moth.ogg'
else if(ismonkey(user)) //If its a monkey, override it.
return pick('sound/creatures/monkey/monkey_screech_1.ogg',
'sound/creatures/monkey/monkey_screech_2.ogg',
Expand Down
31 changes: 18 additions & 13 deletions code/modules/wod13/npcroles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1311,25 +1311,30 @@
my_weapon = new /obj/item/gun/ballistic/automatic/vampire/m1911(src)
AssignSocialRole(/datum/socialrole/guard)

/mob/living/carbon/human/npc/walkby/club/Life()
/mob/living/carbon/human/npc/walkby/club/Initialize()
. = ..()
for(var/obj/machinery/jukebox/Juke in range(7, src))
if(Juke)
MyJuke = Juke

/mob/living/carbon/human/npc/walkby/club/handle_automated_action()
. = ..()
if(staying && stat < 2)
if(prob(5))
var/hasjukebox = FALSE
for(var/obj/machinery/jukebox/J in range(5, src))
if(J)
hasjukebox = TRUE
if(J.active)
if(prob(50))
dancefirst(src)
else
dancesecond(src)
if(!hasjukebox)
staying = FALSE
if(MyJuke)
if(MyJuke.active)
if(prob(10))
if(prob(50))
dancefirst(src)
else
dancesecond(src)
else
staying = FALSE
MyJuke = null

/mob/living/carbon/human/npc/walkby/club
vampire_faction = "City"
staying = TRUE
var/obj/machinery/jukebox/MyJuke

/datum/socialrole/stripfemale
s_tones = list("albino",
Expand Down

0 comments on commit 26f5d3d

Please sign in to comment.