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

prevent initating fast travel during day with damage-from-sunlight disadvantage #1853

Merged
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions Assets/Scripts/Game/DaggerfallUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class DaggerfallUI : MonoBehaviour
const string parchmentBorderRCIFile = "SPOP.RCI";
const string splashVideo = "ANIM0001.VID";
const string deathVideo = "ANIM0012.VID";
const string textDatabase = "ClassicEffects";

public static Color DaggerfallDefaultTextColor = new Color32(243, 239, 44, 255);
public static Color DaggerfallDefaultInputTextColor = new Color32(227, 223, 0, 255);
Expand Down Expand Up @@ -523,6 +524,16 @@ void ProcessMessages()
{
if (!GiveOffer())
{
if (GameManager.Instance.PlayerEntity.Career.DamageFromSunlight && DaggerfallUnity.Instance.WorldTime.Now.IsDay)
{
DaggerfallMessageBox mb = new DaggerfallMessageBox(DaggerfallUI.Instance.UserInterfaceManager);
mb.PreviousWindow = DaggerfallUI.Instance.UserInterfaceManager.TopWindow;
mb.ClickAnywhereToClose = true;
mb.SetText(TextManager.Instance.GetText(textDatabase, "sunlightDamageFastTravelDay"));
mb.Show();
return;
}

racialOverride = GameManager.Instance.PlayerEffectManager.GetRacialOverrideEffect(); // Allow custom race to block fast travel (e.g. vampire during day)
if (racialOverride != null && !racialOverride.CheckFastTravel(GameManager.Instance.PlayerEntity))
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public override bool CheckFastTravel(PlayerEntity playerEntity)
DaggerfallMessageBox mb = new DaggerfallMessageBox(DaggerfallUI.Instance.UserInterfaceManager);
mb.PreviousWindow = DaggerfallUI.Instance.UserInterfaceManager.TopWindow;
mb.ClickAnywhereToClose = true;
mb.SetText(TextManager.Instance.GetText(textDatabase, "vampireFastTravelDay"));
mb.SetText(TextManager.Instance.GetText(textDatabase, "sunlightDamageFastTravelDay"));
mb.Show();
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/StreamingAssets/Text/ClassicEffects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ doorLocked, Door is now locked.
doorAlreadyLocked, Door already locked.
openFailed, Lock is too powerful.
noSpellbook, You have no spellbook!
vampireFastTravelDay, You cannot initiate fast travel during the day.
sunlightDamageFastTravelDay, You cannot initiate fast travel during the day.
trapActive, Trap active.
trapHumanoid, Trap will not work on humanoids.
trapSuccess, Trapped soul.
Expand Down