-
-
Notifications
You must be signed in to change notification settings - Fork 420
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
Добавлено задание на dehead #2008
Conversation
Viva la futurama |
var/obj/item/weapon/organ/head/headobj = null | ||
var/image/display_headobj = null | ||
var/mob/living/carbon/brain/brainmob = null//The current occupant. | ||
var/atom/dest = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не вижу, где используется эта переменная
|
||
/obj/item/device/biocan/attack_self(mob/user) | ||
visible_message("<cpan class='red'>\The [src.name] contents has been splashed over the floor. </span>", "<span class='rose'> You hear a splash. </span>") | ||
headobj.forceMove(get_turf(src)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сперва вызываешь forcemove() у headobj, потом делаешь проверку, а есть ли вообще у тебя headobj на 76 строчке и повторно форсмувишь.
if(istype(container, /obj/item/device/biocan)) | ||
var/obj/item/device/biocan/B = container | ||
if(B.commutator_enabled) | ||
..(message, sanitize = 0) | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В бьенде не обязательно заканчивать методы ретёрнами. Эти три строчки избыточны, не критично, естесна.
if(istype(container, /obj/item/device/mmi/radio_enabled)) | ||
var/obj/item/device/mmi/radio_enabled/R = container | ||
if(R.radio) | ||
spawn(0) R.radio.hear_talk(src, message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А нужен ли тут спавн?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут - старый код, в который я не полез, но его таки гитхаб отобразил как изменившийся.
|
||
if(commutator_enabled) | ||
commutator_enabled = FALSE | ||
to_chat(usr, "\red You disable text to speech device, preventing [src.name]'s occupant from shouting ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Спаны бы.
headobj = W | ||
user.drop_item() | ||
headobj.loc = src | ||
if(headobj.brainmob && !brainmob) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А как у нас может возникнуть ситуация, что отсутствует голова в банке, но мозг на месте? Благодаря рантаймам?
|
||
if(brainmob) | ||
brainmob.container = null | ||
brainmob.loc = headobj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Опять же, сперва ты используешь headobj. Потом проверяешь его наличие. А потом выясняется, что в нормальной ситуации мозга без головы не должно быть в банке.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну и я бы добавил do_after какой-нибудь. Чтобы с имитировать АККУРАТНОЕ доставание.
if(display_headobj) | ||
QDEL_NULL(display_headobj) | ||
underlays.Cut() | ||
return ..() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У родителя нет никакого кода, нет нужды вызывать его.
headobj = null | ||
new /obj/item/weapon/shard(loc) | ||
playsound(src, "shatter", 50, 1) | ||
qdel(src) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Удаляешь, а потом вызываешь родителя, который определенно будет использовать этот уже удаленный (ну или на очереди) объект.
Идея хорошая, но только в теории debrain может выпадать не только агентам... как минимум встретил сейчас упоминание у нинжи. |
Вернул задание на debrain, добавил задание на dehead
code/game/gamemodes/objective.dm
Outdated
else | ||
explanation_text = "Free Objective" | ||
return target | ||
|
||
|
||
find_target_by_role(role, role_type=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ух, ох. Я понимаю, что выше там не полный путь. Но хотя бы удостой чести дать полные пути новым прокам.
А именно /datum/objective/proc_name и так далее.
code/game/gamemodes/objective.dm
Outdated
else | ||
explanation_text = "Free Objective" | ||
return target | ||
|
||
|
||
find_target_by_role(role, role_type=0) | ||
..(role, role_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вписывать аргументы в вызов родительского прока нужно только тогда. когда ты изменяешь их в самом оверрайднутом методе.
if(display_headobj) | ||
QDEL_NULL(display_headobj) | ||
underlays.Cut() | ||
if(do_after(usr, 20)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавь так же, пожалуйста, is_busy. Чтобы люди не могли спамить.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я же правильно понял, что ты хочешь if(do_after(usr, 20) && usr.is_busy())?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nyet. is_busy нужно ставить раньше do_after. А в твоём случае if(!usr.is_busy() && do_after(usr, 20))
Отрезал голову и спрятал в банке > голова из банки спалила тебя первому прошедшему офицеру. |
code/game/gamemodes/objective.dm
Outdated
@@ -249,6 +249,35 @@ datum/objective/debrain//I want braaaainssss | |||
return 1 | |||
return 0 | |||
|
|||
/datum/objective/deheading | |||
/datum/objective/deheading/find_target() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отступы поехали, должен быть либо абсолютный пусть с начала строки (и строку 252 можно убрать), либо короткий пусть с отступом (как в обжективах ниже-выше).
ДримМейкеру похоже побоку, но лучше поправить.
В соответствии с https://github.com/TauCetiStation/TauCetiClassic/wiki/Code-Convention должны быть абсолютный, но учитывая что весь файл через отступы, сойдут и они.
code/game/gamemodes/objective.dm
Outdated
return target | ||
|
||
/datum/objective/deheading/find_target_by_role(role, role_type=0) | ||
..() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В родительский прок не передаются параметры
если что, это вызов /datum/objective/find_target_by_role
https://github.com/Filatelele/TauCetiClassic/blob/a54b46e351e843dd2063a3bfee0f2efce1dd087d/code/game/gamemodes/objective.dm#L32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Проблема в том, что без role_type=0 выбивается ошибка при компиляции. Можно оставить этот параметр?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не совсем тебя понял, но должно быть что-то вроде ..(role, role_type)
(как выше и ниже)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SpaiR поправляет тут меня, ..()
по дефолту вызовется с этими параметрами, так что не важно по идее.
if(istype(container, /obj/item/device/biocan)) | ||
var/obj/item/device/biocan/B = container | ||
if(B.commutator_enabled) | ||
..(message, sanitize = 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
должно быть
..(trim(sanitize_plus_chat(message)), sanitize = 0)
(можешь не углубляться, это долгая и грустная история)
QDEL_NULL(display_headobj) | ||
underlays.Cut() | ||
|
||
/obj/item/device/biocan/verb/toggle_speech() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Было бы наверно неплохо еще иметь сообщение для моба в банке, или, возможно, для всех окружающих.
Есть
TauCetiClassic/code/modules/mob/mob.dm
Line 81 in 19df54a
/atom/proc/visible_message(message, blind_message) |
update_icon() | ||
|
||
/obj/item/device/biocan/attack_self(mob/user) | ||
visible_message("<cpan class='red'>\The [src.name] contents has been splashed over the floor. </span>", "<span class='rose'> You hear a splash. </span>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут и ниже: если hear, то правильнее может было бы воспользоваться
TauCetiClassic/code/modules/mob/mob.dm
Line 108 in 19df54a
/atom/proc/audible_message(message, deaf_message, hearing_distance) |
Т.к. есть глухие персонажи, и для них подобное сообщение будет выглядить странно.
update_icon() | ||
|
||
/obj/item/device/biocan/attack_self(mob/user) | ||
visible_message("<cpan class='red'>\The [src.name] contents has been splashed over the floor. </span>", "<span class='rose'> You hear a splash. </span>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<cpan class='red'>
-> <span class='red'>
display_headobj.pixel_y = 0 | ||
display_headobj.pixel_x = 0 | ||
display_headobj.layer = FLOAT_LAYER | ||
display_headobj.plane = -32767 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут нужно использовать FLOAT_PLANE
константу
Добавил задание на dehead. Отличается от дебрейна тем, что надо не просто унести мозг с собой, но унести голову в банке с биогелем.
Отдельное спасибо Ajajumbo123 за спрайты.
Банка очень хрупкая. Разбивается при броске.
Голова в банке находится в сознании и может говорить
Если аккуратно достать голову из банки, то таймер смерти на голове ставится на текущее время, а значит - ее можно пришить к телу и реанимировать.
Банку можно купить в аплинке за один тк. Если у трейтора есть задание на дебрейн по старту - она выдается ему в рюкзак.
🆑
rscadd: Трейторам добавлено задание на похищение головы.
rscadd: Для выполнения нового задания добавлена банка с биогелем, которая покупается в аплинке за один ТК.