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

add: shuttle now gibs objects and mobs #4840

Closed
wants to merge 2 commits into from

Conversation

Ksaikok46
Copy link
Contributor

@Ksaikok46 Ksaikok46 commented Apr 9, 2024

Описание

Теперь шаттлы гибают всех гуманоидов в зоне своего прилёта, также закрывает дыру, из-за которой сидя в шкафу или мехе можно было выжить под прилетающим шаттлом (мех ломался, человек выпадал живым и здоровым)

Ссылка на предложение/Причина создания ПР

https://discord.com/channels/617003227182792704/755125334097133628/1187384861493829733 и здравый смысл

Демонстрация изменений

2024-04-09.18-51-13.mp4

@Ksaikok46 Ksaikok46 requested a review from Gottfrei April 18, 2024 17:06
Comment on lines +617 to +623
for(var/obj/things in T1)
if(is_type_in_list(things, GLOB.ungibbable_items_types) || istype(things, /obj/docking_port) || istype(things, /obj/effect))
continue
else
things.visible_message(span_warning("\The [things] gets crushed to dust!"))
qdel(things)

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

@Gottfrei Gottfrei Apr 22, 2024

Choose a reason for hiding this comment

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

/obj/docking_port/mobile/proc/roadkill(list/mobile_turfs, list/stationary_turfs, mobile_dir)
	var/list/viewers_by_turf = list()
	var/list/things_by_turf = list()

	for(var/i in 1 to length(mobile_turfs))
		var/turf/mobile_turf = mobile_turfs[i]
		var/turf/stationary_turf = stationary_turfs[i]
		if(!mobile_turf || !stationary_turf)
			continue

		for(var/atom/movable/movable in stationary_turf.contents)
			movable.pulledby?.stop_pulling()
			if(isliving(movable))
				var/mob/living/victim = movable
				victim.buckled?.unbuckle_mob(victim, force = TRUE)
				to_chat(victim, span_userdanger("You feel an immense crushing pressure as the space around you ripples."))

				if(!length(viewers_by_turf[stationary_turf]))
					viewers_by_turf[stationary_turf] = get_mobs_in_view(7, stationary_turf) - victim
				else
					viewers_by_turf[stationary_turf] -= victim

				if(!things_by_turf[stationary_turf])
					things_by_turf[stationary_turf] = list()
				things_by_turf[stationary_turf] += "[victim.name]"

				victim.drop_ungibbable_items(stationary_turf)
				victim.gib()
				continue

			if(!QDELETED(movable) && !is_type_in_list(movable, GLOB.ungibbable_items_types) && !istype(movable, /obj/docking_port) && !iseffect(movable))
				if(!length(viewers_by_turf[stationary_turf]))
					viewers_by_turf[stationary_turf] = get_mobs_in_view(7, stationary_turf)

				if(!things_by_turf[stationary_turf])
					things_by_turf[stationary_turf] = list()
				things_by_turf[stationary_turf] += "[movable.name]"
				qdel(movable)
				continue

			// Move unanchored atoms
			if(!movable.anchored)
				step(movable, mobile_dir)
			else if(!QDELETED(movable) && movable.simulated) // Don't qdel lighting overlays, they are static
				qdel(movable)

			CHECK_TICK

	for(var/turf/turf as anything in viewers_by_turf)
		if(!viewers_by_turf[turf] || !things_by_turf[turf])
			continue
		var/destroyed = capitalize(english_list(things_by_turf[turf]))
		// we cant use `as anything` since dumb radios is in the list
		for(var/mob/viewer in viewers_by_turf[turf])
			viewer.show_message(span_warning("[destroyed] gets crushed by a hyperspace ripple!"), EMOTE_VISIBLE)

Copy link
Contributor

Choose a reason for hiding this comment

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

это сильно оптимизирует работу с вызовами view() и спамом красными сообщениями в чат игры.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

это сильно оптимизирует работу с вызовами view() и спамом красными сообщениями в чат игры.

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

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

Choose a reason for hiding this comment

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

не против если я перехвачу PR?

Copy link
Contributor Author

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.

а нам нужно гарантированно убивать мобов внутри любого содержимого?

если этого не будет происходить, то будет довольно странно, что сидя в шкафу можно пережить приземление на тебя шаттла

Copy link
Contributor Author

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.

@Ksaikok46 Ksaikok46 closed this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants