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

Refactors ghost-role sentience #11897

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

PowerfulBacon
Copy link
Member

@PowerfulBacon PowerfulBacon commented Nov 17, 2024

I encountered an issue where diona nymphs could bypass the ghost-role cooldown, allowing for you to have infinite lives in combat scenarios. Simple fix right, wrong. This uncovered one hell of a mob spawning rabbit hole that goes deeper than you could have ever imagined.

About The Pull Request

  • Converts ghost role sentience into a component.
  • Refactors most ghost role spawns to use this component, and erases the many different implementations of ghost role sentience that we had.

Things are now standardised:

  • All sentience spawns will appear in the spawner menu
  • Nymphs now respect the ghost role cooldown

There are 2 types of ghost sentience options:

  • Unique: Will appear as its own unique entry inside the spawners menu
  • Grouped: Will concatenate mobs with the same non-unique name into the same category and will spawn the player in the closest mob to their ghost when they click spawn

Makes the spawn message when you enter a body more clear:

image

Also ghosting will now give you a ghost role cooldown.

The following sentience spawns are affected:

  • Transform disease (replacing banned players)
  • Pyro anomaly slimes
  • Spiders (Structures can be given the ghost spawner too, though spiders use their own unique spawning behaviour to setup teams)
  • Mass sentience secret
  • Ghostize smite
  • Antagonists replacing banned players (Only if nobody accepts the prompt)
  • Blob zombies
  • Xeno larvae (They require a ghost to spawn, so this only really affects if a larvae ghosts)
  • Nymphs
  • Light pink slime potioned slimes
  • Replace banned cyborg (Only if nobody accepts the prompt)
  • Exploration ghost roles

Other changes:

  • Spawners menu will always show flavour text

Note that this doesn't quite convert everything, only the stuff that was previously going through the sentience system. Convertnig mob_spawner would be a lot of work.

Why It's Good For The Game

Things being standard is good, it means that any issues will be shared across all ghost spawners making them much easier to fix.

Testing Photographs and Procedure

Nymphs

image

1 alert for all nymphs

image

Clicking on a specific message gives you that specific mob

image

Spawner menu:

image

image

Pyro Slime

image

image

image

Ghosting:

image

Spiders

image

image

image

image

image

Changelog

🆑
fix: Nymphs now appear in the ghost menu and respect respawn delay.
add: Adds a message for ghost role spawning
fix: Standardises ghost sentience spawning and ensures that enslaving works for all spawned mobs.
/:cl:

@github-actions github-actions bot added Administration TGUI-Changes Contains changes to TGUI. Make sure its up to date with TGUI 4.0 labels Nov 17, 2024
@PowerfulBacon PowerfulBacon marked this pull request as ready for review November 17, 2024 13:25
@llol111
Copy link
Contributor

llol111 commented Nov 17, 2024

Does this also affect sentience baloons?

@PowerfulBacon
Copy link
Member Author

No, it affects everything listed in the PR body and those things only

Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

return TRUE
if(href_list["activate"])
var/mob/dead/observer/ghost = usr
if(istype(ghost))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if(istype(ghost))
if(isdead(ghost))

istype is not sufficient to prevent href exploit.

Comment on lines +163 to +169
var/mob/living/parent_mob = target
if (istype(parent_mob))
if (can_become_role(player.client, parent_mob) != GHOST_SPAWN_ABLE)
return
else
if (can_become_role(player.client, null) != GHOST_SPAWN_ABLE)
return
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why you check istype().
does it mean there can be null or path?

Comment on lines +39 to +40
/// If set
/// Have we alerted already?
Copy link
Member

Choose a reason for hiding this comment

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

two lines, mistake? also, instead of questioning sentence, please describe normally.

  • /// If set, implies the spawner is alerted already

/// mobs for that type (A unique alert will not appear if another exists at the
/// same time, which prevents spamming)
var/unique = FALSE
/// If we are using a spawned type, should we delete the parent after spawning?
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// If we are using a spawned type, should we delete the parent after spawning?
/// Decides if the parent should be deleted after spawning (When we use a spawned type)

Questioning tone is bad to read.

Comment on lines +71 to +75
/datum/component/ghost_spawner/UnregisterFromParent()
var/mob/living/parent_mob = parent
parent_mob.RemoveElement(/datum/element/point_of_interest)
remove_from_spawner_menu()
UnregisterSignal(parent_mob, COMSIG_ATOM_ATTACK_GHOST)
Copy link
Member

Choose a reason for hiding this comment

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

I see some missing unregister signals:

  • COMSIG_LIVING_DEATH,
  • COMSIG_MOB_GHOSTIZE

I am not certain if it's not necessary.

Comment on lines +94 to +95
/// When the mob dies, remove from the spawner menu but don't remove this
/// component.
Copy link
Member

Choose a reason for hiding this comment

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

two lines?

Copy link
Member

Choose a reason for hiding this comment

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

the component is missing of on_mob_revival() proc that reenables a mob's ghost spawner that reverts the effect of on_mob_death()

Comment on lines +37 to +38
/// If set, we will become bound to this mob upon spawning
var/datum/mind/master = null
Copy link
Member

Choose a reason for hiding this comment

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

this should be weakref

@EvilDragonfiend
Copy link
Member

EvilDragonfiend commented Nov 26, 2024

ah, also ghostize shouldn't be counted for all cases. There are 2 cases of ghostize:

  • Ghostize to skip last breath
  • Ghostize when you're dead already.

The first one makes sense to send signals to make things restricted, but the second one doing restrictions isn't fair.
but also, the second one means you can send multiple signals even if a thing doesn't need to handle stuff anymore.
I am not particularly sure if doing ghostize when you're dead already is a thing, but I think it was.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Administration Feature Fix Merge Conflict Removal TGUI-Changes Contains changes to TGUI. Make sure its up to date with TGUI 4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants