Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion code/datums/outfits/jobs/civilian.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
backpack_contents = list(/obj/item/reagent_containers/food/pie = 1,
/obj/item/bananapeel = 1,
/obj/item/reagent_containers/spray/waterflower = 1,
/obj/item/balloon_box = 1)
/obj/item/balloon_box = 1,
/obj/item/device/clowntaperecorder = 1)

/decl/hierarchy/outfit/job/clown/New()
..()
Expand Down
58 changes: 57 additions & 1 deletion code/game/objects/items/weapons/clown_items.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Clown Items
* Contains:
* Bike Horns
* Bike Horns and C-Taperecorder
*/

/*
Expand Down Expand Up @@ -73,3 +73,59 @@
spawn(50)
spam_flag = 0
return

//Ha-ha-ha
/obj/item/device/clowntaperecorder
var/honk_sound = 'sound/items/sitcom_laugh.ogg'
name = "clown taperecorder"
desc = "A funny-looking tiny taperecorder. It smells like bananas."
icon = 'icons/obj/device.dmi'
icon_state = "stereo"
item_state = "stereo"
throwforce = 5
w_class = ITEM_SIZE_SMALL
mod_weight = 0.5
mod_reach = 0.5
mod_handy = 0.5
throw_range = 15
attack_verb = list("HONKED")
var/spam_flag = 0
var/active = FALSE

/obj/item/device/clowntaperecorder/attack_self(mob/user as mob)
Copy link
Contributor

Choose a reason for hiding this comment

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

as вроде тоже выпиливаем

if(spam_flag)
to_chat(user, "<span class='warning'>The tape recorder needs a moment to rewind.</span>")
Copy link
Contributor

Choose a reason for hiding this comment

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

Спаны

Copy link
Collaborator

Choose a reason for hiding this comment

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

Используй макрос SPAN.

return
spam_flag = 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Проанализировав код пришел к выводу, что spam_flag - обычная булева переменная, замени 1 и 0, на TRUE и FALSE.

Copy link
Author

Choose a reason for hiding this comment

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

Макс, погоди, я-то переделаю, а почему код выше моего, в недавно добавленной Типсом штуке, тоже 1 и 0 использует, и об этом ничего не говорили? Как и спавн(50) там же имеется, блин блять.

Copy link
Author

Choose a reason for hiding this comment

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

Я ни в коем случае не отвлекаю внимание, не перемещаю вину или что-либо другое. Просто на фоне остальных штук из файла, именно моя будет смотреться вычурно, потому что один ревьювер решил, что надо по другому

Copy link
Member

Choose a reason for hiding this comment

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

Макс, погоди, я-то переделаю, а почему код выше моего, в недавно добавленной Типсом штуке, тоже 1 и 0 использует, и об этом ничего не говорили? Как и спавн(50) там же имеется, блин блять.

Отвечу немного за Макса, надеюсь не обидится

По поводу 1 и 0, переменная древняя как говно мамонта, а у типса в пуле просто не доглядели что он тоже юзает 1 и 0, так что это не лично к тебе претензия, а просто просьба привести файлик к код стайлу

По поводу спавна, аналогично

Если я не прав Макс поправит 😄

Copy link
Author

Choose a reason for hiding this comment

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

Ме.

playsound(src.loc, honk_sound, 100, 0)
src.add_fingerprint(user)

active = !active
if(active)
icon_state = "stereo_playing"
else
icon_state = "stereo"

update_icon()

spawn(30)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Вместо spawn у нас принято использовать add_think_ctx.

if(active)
active = FALSE
icon_state = "stereo"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Обновляй иконку явно в проке on_update_icon в зависимости от состояния объекта.

desc = initial(desc)
spam_flag = 0

/obj/item/device/clowntaperecorder/verb/change_sound()
set name = "Change sound"
set category = "IC"
set src in usr

var/mob/M = usr

if(M.stat || M.incapacitated())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Почитай подробнее как проверять жив ли перс по ссылке.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ого нихуя у нас и такое оказывается есть, когда я спросил у разработочки пару месяцев назад - ответа не получил.

return

if(honk_sound == 'sound/items/sitcom_laugh.ogg')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Это какой-то стыд, во-первых. Во-вторых, переделай так, чтобы код ниже использовал макрос GET_SFX.

honk_sound = 'sound/items/ba_dum_tss.ogg'
else
honk_sound = 'sound/items/sitcom_laugh.ogg'
Binary file modified icons/obj/device.dmi
Binary file not shown.
Binary file added sound/items/ba_dum_tss.ogg
Binary file not shown.
Binary file added sound/items/sitcom_laugh.ogg
Binary file not shown.
Loading