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

Фикс блюспейс рюкзака и пересмотренное возвращение механики неисправности интерфейса #13724

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
13 changes: 13 additions & 0 deletions code/game/objects/effects/anomalies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,18 @@
warp = new(src)
vis_contents += warp

START_PROCESSING(SSobj, src)
anomalyEffect()

/obj/effect/anomaly/grav/Destroy()
vis_contents -= warp
STOP_PROCESSING(SSobj, src)
QDEL_NULL(warp)
return ..()

/obj/effect/anomaly/grav/process() // Thanks to DarkWater
anomalyEffect()

/obj/effect/anomaly/grav/anomalyEffect()
..()

Expand Down Expand Up @@ -175,6 +182,12 @@
/obj/effect/anomaly/bhole/atom_init()
. = ..()
aSignal.origin_tech = "materials=8;combat=4;engineering=4"

START_PROCESSING(SSobj, src)
anomalyEffect()

/obj/effect/anomaly/bhole/process() // Thanks to DarkWater
anomalyEffect()

/obj/effect/anomaly/bhole/anomalyEffect()
..()
Expand Down
23 changes: 21 additions & 2 deletions code/game/objects/items/weapons/storage/backpack.dm
Copy link
Member

Choose a reason for hiding this comment

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

у тебя довольно странный нейминг функций (да и переменных, но бог с ними). Пиши лучше так, как написано в коде рядом, а рядом снейк кейс, соблюдай похожесть кода.

Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,32 @@
to_chat(user, "<span class='red'>The Bluespace generator isn't working.</span>")
return

if(istype(I, /obj/item/weapon/storage/backpack/holding) && !I.crit_fail)
if(istype(I, /obj/item/weapon/storage/backpack/holding) && !I.crit_fail && !(I == src))
to_chat(user, "<span class='red'>The Bluespace interfaces of the two devices conflict and malfunction.</span>")
qdel(I)
return
Make_Anomaly(150 SECONDS, /obj/effect/anomaly/bhole)

return ..()

/obj/item/weapon/storage/backpack/holding/handle_item_insertion(obj/item/W, prevent_warning = FALSE, NoUpdate = FALSE)
. = ..()
if(W == src)
Destroy(W) // in my opinion, it is most effective to remove an object with a total cut of its action menu, because in addition to this action, qdel occurs
to_chat(usr, "<span class='red'>Рюкзак засасывается сам в себя и исчезает.</span>")
return FALSE
if(istype(W, /obj/item/weapon/storage/backpack/holding))
to_chat(usr, "<span class='red'>The Bluespace interfaces of the two devices conflict and malfunction.</span>")
Make_Anomaly(150 SECONDS, /obj/effect/anomaly/bhole)
return FALSE
return TRUE

/obj/item/weapon/storage/backpack/holding/proc/Make_Anomaly(delay_time, current_anomaly)
Copy link
Member

Choose a reason for hiding this comment

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

Функцию бы вызывать асинхронно, так как есть слип. А я не очень хочу, чтобы attackby и handle_item_insertion останавливались

Copy link
Contributor

Choose a reason for hiding this comment

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

лучше сам слип заменить на QDEL_IN(current_anomaly, delay_time

Copy link
Member

Choose a reason for hiding this comment

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

А еще, грав аномалия как-то скучно, надо бы че-то пожосче

var/turf/targloc = get_turf(src)
var/obj/effect/anomaly/anomaly = new current_anomaly(targloc)
anomaly.anomalyEffect()
sleep(delay_time)
qdel(current_anomaly)

/obj/item/weapon/storage/backpack/holding/proc/failcheck(mob/user)
if (prob(src.reliability))
return 1 //No failure
Expand Down
Loading