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

2430 fix %god macro for fighters guild #2478

Merged
merged 2 commits into from Jan 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 21 additions & 6 deletions Assets/Scripts/Game/Questing/QuestMCP.cs
Expand Up @@ -209,17 +209,16 @@ public override string God()
factionId = (int)GameManager.Instance.PlayerEnterExit.FactionID;
}
else
{
{
factionId = GameManager.Instance.PlayerGPS.GetTempleOfCurrentRegion();
}

if (factionId == 0)
if (factionId == 0 || factionId == (int)FactionFile.FactionIDs.The_Fighters_Guild)
{
// Classic returns "BLANK" if no temple is found, here we return a random deity name
const int minGodID = 21;
const int maxGodID = 35;
// Classic returns "BLANK" if no temple is found, here we return a random deity name.
// We do the same for Fighters Guild halls, which are are considered temples in some areas.
var god = GetRandomDivine();

FactionFile.FactionIDs god = (FactionFile.FactionIDs)UnityEngine.Random.Range(minGodID, maxGodID + 1);
return god.ToString();
}

Expand Down Expand Up @@ -258,6 +257,22 @@ public override string Direction()

return TextManager.Instance.GetLocalizedText("resolvingError");
}

private static FactionFile.FactionIDs GetRandomDivine()
{
switch (UnityEngine.Random.Range(0, 9))
{
case 0: return FactionFile.FactionIDs.Arkay;
case 1: return FactionFile.FactionIDs.Zen;
case 2: return FactionFile.FactionIDs.Mara;
case 3: return FactionFile.FactionIDs.Ebonarm;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure about Ebonarm being in the random selection.
We could go full "Daggerfall urban legend" and make Ebonarm the "FG with Temple building type" deity, instead of a random selection. Having a random deity there might get them confused with religious knight orders

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not familiar enough with the lore to be able to say which divines would be inappropriate to mention in a Fighters Guild hall.

I went with the original code comment "Better just to provide something than let let game loop crash".

case 4: return FactionFile.FactionIDs.Akatosh;
case 5: return FactionFile.FactionIDs.Julianos;
case 6: return FactionFile.FactionIDs.Dibella;
case 7: return FactionFile.FactionIDs.Stendarr;
default: return FactionFile.FactionIDs.Kynareth;
}
}
}
}
}