devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

Check quest status instead of settings when spawning hellfire quest items

Open AJenbo opened this issue 10 months ago • 2 comments

https://github.com/diasurgical/DevilutionX/blob/0c381798087dee4ce1d989e1569bc8d66068f2f6/Source/items.cpp#L2473

During the Save & Raid event we noticed that the brown suit didn't spawn, this seems to be because the person that entered the level didn't have the cow quest enabled unlike the other players.

This is also an issue for the Theo quest: https://github.com/diasurgical/DevilutionX/blob/0c381798087dee4ce1d989e1569bc8d66068f2f6/Source/monster.cpp#L867

AJenbo avatar Feb 22 '25 14:02 AJenbo

I kinda thought this was a feature. In Single Player, you can get the Rune Bomb from Lester and complete his quest, then switch to cow quest and complete both in the same game.

But now that you mention it, we don't actually set quest._qactive = QUEST_NOTAVAIL for any Hellfire quests during InitQuests(), and neither does vanilla Hellfire. That possibility of activating both quests in the same game must be vanilla behavior. So there's not really a clearly reliable way to handle this based on quest state.

This might require a brainstorming session to come up with a proper strategy.

StephenCWills avatar Feb 23 '25 03:02 StephenCWills

After sleeping on it, I believe I came up with a strategy that could work.

  1. Modify InitQuests() to disable inactive Hellfire quests based on settings.
  2. Update ResyncQuests()... a. If Q_FARMER is active/done and Q_JERSEY is init, set Q_JERSEY to unavailable. b. If Q_FARMER is init and Q_JERSEY is active/done, set Q_FARMER to unavailable. c. If both Q_FARMER and Q_JERSEY are init, disable the inactive one based on the setting.
  3. If both Q_FARMER and Q_JERSEY are active/done, enable Q_JERSEY.

This will change things so that you can't do Q_FARMER and Q_JERSEY in the same Single Player game session. Also, when it comes to Q_GIRL, we can simply trust the quest state. This means all vanilla Hellfire saves will have Q_GIRL enabled when moving to DevilutionX, even if it wasn't enabled via command.txt. Such is life.

Also note that when I say "active/done", I am including the special quest states for those quests.

https://github.com/diasurgical/DevilutionX/blob/0c381798087dee4ce1d989e1569bc8d66068f2f6/Source/quests.h#L75-L78

StephenCWills avatar Feb 23 '25 14:02 StephenCWills