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

Добавлено задание на dehead #2008

Merged
merged 6 commits into from Nov 27, 2017
Merged

Добавлено задание на dehead #2008

merged 6 commits into from Nov 27, 2017

Conversation

Filatelele
Copy link
Contributor

@Filatelele Filatelele commented Nov 25, 2017

Добавил задание на dehead. Отличается от дебрейна тем, что надо не просто унести мозг с собой, но унести голову в банке с биогелем.

Отдельное спасибо Ajajumbo123 за спрайты.

  • Банка очень хрупкая. Разбивается при броске.

  • Голова в банке находится в сознании и может говорить

  • Если аккуратно достать голову из банки, то таймер смерти на голове ставится на текущее время, а значит - ее можно пришить к телу и реанимировать.

  • Банку можно купить в аплинке за один тк. Если у трейтора есть задание на дебрейн по старту - она выдается ему в рюкзак.

🆑

  • rscadd: Трейторам добавлено задание на похищение головы.

  • rscadd: Для выполнения нового задания добавлена банка с биогелем, которая покупается в аплинке за один ТК.

@TauKitty TauKitty added Feature Новая фича Sprites Tweak labels Nov 25, 2017
@Zmey25
Copy link
Contributor

Zmey25 commented Nov 25, 2017

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
Copy link
Contributor

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))
Copy link
Contributor

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
Copy link
Contributor

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)
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
Contributor Author

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 ")
Copy link
Contributor

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)
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Опять же, сперва ты используешь headobj. Потом проверяешь его наличие. А потом выясняется, что в нормальной ситуации мозга без головы не должно быть в банке.

Copy link
Contributor

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 ..()
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Удаляешь, а потом вызываешь родителя, который определенно будет использовать этот уже удаленный (ну или на очереди) объект.

@volas
Copy link
Member

volas commented Nov 25, 2017

Идея хорошая, но только в теории debrain может выпадать не только агентам... как минимум встретил сейчас упоминание у нинжи.
Еще отчасти дублирует MMI, может его проапдейтить? (не призыв к действию, просто на обсуждение)

Вернул задание на debrain, добавил задание на dehead
@Filatelele Filatelele changed the title Переработка задания на debrain Добавлено задание на dehead Nov 25, 2017
else
explanation_text = "Free Objective"
return target


find_target_by_role(role, role_type=0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ух, ох. Я понимаю, что выше там не полный путь. Но хотя бы удостой чести дать полные пути новым прокам.
А именно /datum/objective/proc_name и так далее.

else
explanation_text = "Free Objective"
return target


find_target_by_role(role, role_type=0)
..(role, role_type)
Copy link
Contributor

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))
Copy link
Contributor

Choose a reason for hiding this comment

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

Добавь так же, пожалуйста, is_busy. Чтобы люди не могли спамить.

Copy link
Contributor Author

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())?

Copy link
Contributor

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))

@Unforg1v3n
Copy link
Contributor

Отрезал голову и спрятал в банке > голова из банки спалила тебя первому прошедшему офицеру.

@@ -249,6 +249,35 @@ datum/objective/debrain//I want braaaainssss
return 1
return 0

/datum/objective/deheading
/datum/objective/deheading/find_target()
Copy link
Member

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 должны быть абсолютный, но учитывая что весь файл через отступы, сойдут и они.

return target

/datum/objective/deheading/find_target_by_role(role, role_type=0)
..()
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Проблема в том, что без role_type=0 выбивается ошибка при компиляции. Можно оставить этот параметр?

Copy link
Member

Choose a reason for hiding this comment

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

не совсем тебя понял, но должно быть что-то вроде ..(role, role_type) (как выше и ниже)

Copy link
Member

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)
Copy link
Member

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()
Copy link
Member

Choose a reason for hiding this comment

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

Было бы наверно неплохо еще иметь сообщение для моба в банке, или, возможно, для всех окружающих.
Есть

/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>")
Copy link
Member

Choose a reason for hiding this comment

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

Тут и ниже: если hear, то правильнее может было бы воспользоваться

/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>")
Copy link
Member

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'>

Починил баг с отсутствием мозга в голове после неаккуратного доставания.
Привел обжективесы к стайлгайду, починил say, везде заменил deheading на
dehead.
display_headobj.pixel_y = 0
display_headobj.pixel_x = 0
display_headobj.layer = FLOAT_LAYER
display_headobj.plane = -32767
Copy link
Member

Choose a reason for hiding this comment

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

тут нужно использовать FLOAT_PLANE константу

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Новая фича Sprites Tweak
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants