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

Dead king can trample mobs. #6464

Open
cm13-issue-bot opened this issue Jun 14, 2024 · 3 comments
Open

Dead king can trample mobs. #6464

cm13-issue-bot opened this issue Jun 14, 2024 · 3 comments
Labels
Oversight Test your code rigorously only for you to overlook something ultra obvious

Comments

@cm13-issue-bot
Copy link

Testmerges

#6071: '[V] Sorokyne Strata: fixes and changes .' by Venuska1117 at commit 77b1ffb107
#6304: 'STEEL DIVISON (Re-introduces 200 pop locked tank) [CODE BOUNTY]' by Red-byte3D at commit b51bd40abe
#6355: 'ID Mod computer biometrics' by realforest2001 at commit bd4cb15883
#6383: 'Replaces the ARC interior & ARC tweaks' by Zonespace27 at commit 4df6e6ea75
#6363: 'First Drop Protections: Gas and Static Turrets' by Drulikar at commit bb9a7df8e2
#6388: 'gayons' by 567Turtle at commit 4f9151f1ba
#6334: 'Xenomorph Endgame' by Git-Nivrak at commit 25f3f77ada
#6039: 'Project ARES TM Holder (v5)' by realforest2001 at commit 9f4c76c456
#6392: 'Adds in-game bug reports without needing a GitHub account' by vero5123 at commit 9e65823834

Round ID

22638

Description of the bug

When dragged over mobs, dead king can still trample them and deal damage as if it was alive.

What's the difference with what should have happened?

It shouldn't do this.

How do we reproduce this bug?

  1. Kill king.
  2. Drag it over a mob, even yourself.
  3. Get trampled, receive damage, laugh.

Attached logs

N/A

Additional details

  • Author: Nettle
  • Admin: SmellyHippie
  • Note: None
@cm13-issue-bot cm13-issue-bot added the Bug Admin events aren't bugs label Jun 14, 2024
@vero5123
Copy link
Contributor

vero5123 commented Jun 14, 2024

once it's dead you should maybe unregister this, or just return if it's dead however you wanna do it.@Git-Nivrak

/mob/living/carbon/xenomorph/king/Initialize()
	. = ..()
	AddComponent(/datum/component/footstep, 2 , 35, 11, 4, "alien_footstep_large")
	RegisterSignal(src, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(check_block))

/mob/living/carbon/xenomorph/king/proc/check_block(mob/king, turf/new_loc)
	SIGNAL_HANDLER
	for(var/mob/living/carbon/carbon in new_loc.contents)
		if(isxeno(carbon))
			var/mob/living/carbon/xenomorph/xeno = carbon
			if(xeno.hivenumber == src.hivenumber)
				xeno.KnockDown((5 DECISECONDS) / GLOBAL_STATUS_MULTIPLIER)
			else
				xeno.KnockDown((1 SECONDS) / GLOBAL_STATUS_MULTIPLIER)
		else
			if(carbon.stat != DEAD)
				carbon.apply_armoured_damage(20)
				carbon.KnockDown((1 SECONDS) / GLOBAL_STATUS_MULTIPLIER)

		playsound(src, 'sound/weapons/alien_knockdown.ogg', 25, 1)

@vero5123
Copy link
Contributor

maybe it also shouldn't play the trample sound if it walks over a dead mob?

@vero5123
Copy link
Contributor

vero5123 commented Jun 14, 2024

so like

/mob/living/carbon/xenomorph/king/proc/check_block(mob/king, turf/new_loc)
	SIGNAL_HANDLER
	for(var/mob/living/carbon/carbon in new_loc.contents)
                if(carbon.is_dead())
                        continue
		if(isxeno(carbon))
			var/mob/living/carbon/xenomorph/xeno = carbon
			if(xeno.hivenumber == hivenumber)
				xeno.KnockDown((5 DECISECONDS) / GLOBAL_STATUS_MULTIPLIER)
			else
				xeno.KnockDown((1 SECONDS) / GLOBAL_STATUS_MULTIPLIER)
		else
			carbon.apply_armoured_damage(20)
			carbon.KnockDown((1 SECONDS) / GLOBAL_STATUS_MULTIPLIER)

		playsound(src, 'sound/weapons/alien_knockdown.ogg', 25, 1)

@ItsVyzo ItsVyzo added Oversight Test your code rigorously only for you to overlook something ultra obvious and removed Bug Admin events aren't bugs labels Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Oversight Test your code rigorously only for you to overlook something ultra obvious
Projects
None yet
Development

No branches or pull requests

3 participants