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

Wake up the whole pack of Gargoyles when disturbed #7449

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

StephenCWills
Copy link
Member

@StephenCWills StephenCWills commented Oct 1, 2024

Not tested, but this looks like the right place to reintroduce the logic.

This resolves #7448

@StephenCWills
Copy link
Member Author

StephenCWills commented Oct 2, 2024

I'm testing now, and this doesn't work right. Switching to draft.

@StephenCWills StephenCWills marked this pull request as draft October 2, 2024 00:08
@StephenCWills StephenCWills marked this pull request as ready for review October 2, 2024 00:31
@StephenCWills
Copy link
Member Author

StephenCWills commented Oct 2, 2024

The trick is that GroupUnity() only gets called when monster.mode transitions from one state to another.

Gargoyles start with MonsterMode::SpecialMeleeAttack and MFLAG_ALLOW_SPECIAL. This particular combination makes them stay in stone form until they're disturbed by the player. When they are awoken, the MFLAG_ALLOW_SPECIAL flag is removed. If they ever go back into stone form, they will be given MFLAG_ALLOW_SPECIAL with MonsterMode::Heal. That mode will eventually wake them when their hp is full.

Since GroupUnity() only gets called when monster.mode transitions, the first time it gets called is when the Gargoyle first transitions from MonsterMode::SpecialMeleeAttack to MonsterMode::Stand. You can see this as a delay, where the first monster that wakes up will wake up the leader at the end of his first animation, then the leader will wake up the pack at the end of his first animation.

On the other hand, FollowTheLeader() gets called unconditionally on every frame. We can't move the logic to this function unless we explicitly check whether the leader is dormant or not. Note that the behavior is slightly different from vanilla. If you wake up the leader, all the other Gargoyles will immediately wake up with him. If you wake up a minion, the rest of the pack will wake up simultaneously at the end of its first animation.

@StephenCWills
Copy link
Member Author

I should probably mention I consider this ready now, in case it wasn't clear.

@StephenCWills
Copy link
Member Author

Tweaked to better match vanilla behavior. It only checks leader->mode == MonsterMode::SpecialMeleeAttack without checking leader->flags & MFLAG_ALLOW_SPECIAL to ensure that the leader of the pack has fully finished his waking animation before waking the rest of the pack.

@AJenbo AJenbo merged commit 6318c55 into diasurgical:master Oct 30, 2024
22 of 23 checks passed
@StephenCWills StephenCWills deleted the wake-gargoyle-pack branch October 30, 2024 01:53
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.

[Issue Report]: Blood Claw Unique Pack Wakeup Issue
2 participants