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

Синди мыло стирает фибры и отпечатки с объекта #13711

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Changes from 4 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4265ca3
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
59f3ef5
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
a3838c1
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
f1ee209
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
80ae3b6
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
1d6188e
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
98270f2
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
c0ae3e8
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
efffba9
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
5151846
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
a8f3120
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
ea43475
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
c28d750
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
d49da34
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
3de8ba3
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
4c44a5f
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
3a638fc
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
072be17
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
7451840
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
736e622
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
51e9532
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
8fedeae
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
012e423
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
8ad704e
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
39d85cf
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
60d5093
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
43695fd
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
999d0fd
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
e0b1f7f
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
b6776dc
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
ca538fa
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
56c205f
Update clown_items.dm
TheDratutiHyDa Jan 10, 2025
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
15 changes: 15 additions & 0 deletions code/game/objects/items/weapons/clown_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@
target.clean_blood()
return

/obj/item/weapon/reagent_containers/food/snacks/soap/syndie/afterattack(atom/target, mob/user, proximity, params)
if(!proximity || ishuman(target)) return
if(user.client && (target in user.client.screen))
to_chat(user, "<span class='notice'>You need to take that [target.name] off before cleaning it.</span>")
Copy link
Member

Choose a reason for hiding this comment

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

Проверять на клиентский screen не очень корректно - итем на нем может оказаться даже если сам предмет не в инвентаре.

Тут несколько вариантов, самое простое наверно проверять, что итем находится на тайле, а не где-то еще

Suggested change
if(user.client && (target in user.client.screen))
to_chat(user, "<span class='notice'>You need to take that [target.name] off before cleaning it.</span>")
if(!isturf(target.loc))
to_chat(user, "<span class='notice'>You need to take that [target.name] off before cleaning it.</span>")

else if(istype(target,/obj/effect/decal/cleanable))
to_chat(user, "<span class='notice'>You scrub \the [target.name] out.</span>")
qdel(target)
Copy link
Member

Choose a reason for hiding this comment

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

это точно что-то лишнее, тут ты удаляешь итем который чистишь из игры.

if(target.fingerprints)
target.fingerprints = null
if(target.suit_fibers)
target.suit_fibers = null
target.clean_blood()
to_chat(user, "<span class='notice'>You FULLY clean \the [target.name].</span>")
Copy link
Member

Choose a reason for hiding this comment

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

Сейчас тут нет задержки в действии, и два сообщения
You scrub \the [target.name] out
You FULLY clean \the [target.name]

просто сразу появятся друг за другом. Если хочется добавить задержку - посмотри в коде билда примеры использования do_after()

return
Copy link
Member

Choose a reason for hiding this comment

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

Я еще рекомендую не строить лесенки из if-else, и воспользоваться ранним возвратом, так код будет читаймее. Что-то вроде

if(!isturf(target.loc))
	to_chat(user, "<span class='notice'>You need to take that [target.name] off before cleaning it.</span>")
	return
if(!istype(target,/obj/effect/decal/cleanable))
	to_chat(user, "<span class='notice'>....</span>")
	return

...тут остальной код...


/obj/item/weapon/reagent_containers/food/snacks/soap/attack(mob/target, mob/user, def_zone)
if(user.a_intent == INTENT_HARM)
..()
Expand Down
Loading