2021-12-23 13:29:14 -08:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.WorldSync;
|
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
namespace QSB.Player.Messages;
|
|
|
|
|
|
|
|
|
|
internal class LaunchCodesMessage : QSBMessage
|
2021-12-23 13:29:14 -08:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override bool ShouldReceive => QSBWorldSync.AllObjectsReady;
|
2021-12-23 13:29:14 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override void OnReceiveRemote()
|
|
|
|
|
{
|
|
|
|
|
var flag = false;
|
|
|
|
|
if (!PlayerData._currentGameSave.PersistentConditionExists("LAUNCH_CODES_GIVEN"))
|
2022-02-24 22:04:54 -08:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
flag = true;
|
|
|
|
|
}
|
|
|
|
|
else if (!PlayerData._currentGameSave.GetPersistentCondition("LAUNCH_CODES_GIVEN"))
|
|
|
|
|
{
|
|
|
|
|
flag = true;
|
|
|
|
|
}
|
2022-02-27 04:40:44 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
if (flag)
|
|
|
|
|
{
|
|
|
|
|
DialogueConditionManager.SharedInstance.SetConditionState("SCIENTIST_3", true);
|
|
|
|
|
PlayerData._currentGameSave.SetPersistentCondition("LAUNCH_CODES_GIVEN", true);
|
|
|
|
|
GlobalMessenger.FireEvent("LearnLaunchCodes");
|
2021-12-23 13:29:14 -08:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-02-24 22:04:54 -08:00
|
|
|
|
}
|