Advertisement
Guest User

File "r4game.ws"

a guest
Aug 28th, 2018
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 67.88 KB | None | 0 0
  1. /***********************************************************************/
  2. /**     © 2016 CD PROJEKT S.A. All rights reserved.
  3. /**     THE WITCHER® is a trademark of CD PROJEKT S. A.
  4. /**     The Witcher game is based on the prose of Andrzej Sapkowski.
  5. /***********************************************************************/
  6.  
  7. import struct SSavegameInfo
  8. {
  9.     import var filename : string;           // filename is auto-generated, can be custom on PC, if save is done in editor ar renamed manually.
  10.     import var slotType : ESaveGameType;    // valid values are: SGT_AutoSave, SGT_QuickSave, SGT_Manual, SGT_CheckPoint
  11.     import var slotIndex : int;             // -1 means: no slot assigned (PC will always have -1 here). Remember that consoleas share the same slot numbers for quicksaves and manual saves.
  12.                                             // ATM there are 2 slots for AutoSaves, 2 for checkpoints and 8 for all others, meaning (on consoles) this value have range from 0 to 1 for autosaves and checkpoints and from 0 to 7 otherwise.
  13. };
  14.  
  15. //#J should match enum EPlatform in configVarSystem.h
  16. enum Platform
  17. {
  18.     Platform_PC = 0,
  19.     Platform_Xbox1 = 1,
  20.     Platform_PS4 = 2,
  21.     Platform_Unknown = 3
  22. }
  23.  
  24. struct SPostponedPreAttackEvent
  25. {
  26.     var entity      : CGameplayEntity;
  27.     var eventName   : name;
  28.     var eventType   : EAnimationEventType;
  29.     var data        : CPreAttackEventData;
  30.     var animInfo    : SAnimationEventAnimInfo;
  31. };
  32.  
  33. import class CR4Game extends CCommonGame
  34. {
  35.     saved var zoneName : EZoneName;     //cached game area name updated when entering different areas
  36.     private var gamerProfile : W3GamerProfile;
  37.     private var isDialogOrCutscenePlaying : bool;                   //is dialogue or cutscene currently playing
  38.     private saved var recentDialogOrCutsceneEndGameTime : GameTime;     //time (as game time) of most recent dialog or cutscene end
  39.     public var isCutscenePlaying : bool;
  40.     public var isDialogDisplayDisabled : bool;
  41.     default isDialogDisplayDisabled = false;
  42.     public var witcherLog : W3GameLog;
  43.     public var deathSaveLockId : int;
  44.     private var currentPresence : name;
  45.     private var restoreUsableItemL : bool;
  46.    
  47.     private saved var savedEnchanterFunds           : int;
  48.     private saved var gameplayFactsForRemoval       : array<SGameplayFactRemoval>;
  49.     private saved var gameplayFacts                 : array<SGameplayFact>;
  50.     private saved var tutorialManagerHandle         : EntityHandle;         //to get tutorial manager entity after loading a game
  51.     private saved var diffChangePostponed           : EDifficultyMode;      //postponed difficulty mode change - due to missing thePlayer object   
  52.     private saved var dynamicallySpawnedBoats       : array<EntityHandle>;      //list of dynamically spawned boats that we keep
  53.     private saved var dynamicallySpawnedBoatsToDestroy : array<EntityHandle>;   //list of dynamically spawned boats that we will destroy as not needed anymore
  54.    
  55.     private saved var uberMovement : bool;  default uberMovement = false;
  56.    
  57.     //SXPM+
  58.     public var mSXPM    : CSXPM;
  59.     //SXPM-
  60.    
  61.     function EnableUberMovement( flag : bool )
  62.     {
  63.         uberMovement = flag;
  64.     }
  65.    
  66.     public function IsUberMovementEnabled() : bool
  67.     {
  68.         return uberMovement;
  69.     }  
  70.    
  71.         default diffChangePostponed = EDM_NotSet;
  72.    
  73.     // Returns true if opened the Steam controller overlay to configure bindings. Otherwise returns false.
  74.     import final function ShowSteamControllerBindingPanel() : bool;
  75.    
  76.     import final function ActivateHorseCamera( activate : bool, blendTime : float, optional instantMount : bool );
  77.    
  78.     import final function GetFocusModeController() : CFocusModeController;
  79.    
  80.     public var isRespawningInLastCheckpoint : bool;
  81.     default isRespawningInLastCheckpoint = false;
  82.     private var environmentID : int;
  83.    
  84.     public function SetIsRespawningInLastCheckpoint()
  85.     {
  86.         isRespawningInLastCheckpoint = true;
  87.     }
  88.    
  89.     event /* C++ */ OnGameSaveListUpdated()
  90.     {
  91.         var menuBase    : CR4MenuBase;
  92.         var ingameMenu  : CR4IngameMenu;
  93.        
  94.         menuBase = (CR4MenuBase)(theGame.GetGuiManager().GetRootMenu());
  95.        
  96.         if (menuBase)
  97.         {
  98.             ingameMenu = (CR4IngameMenu)(menuBase.GetSubMenu());
  99.            
  100.             if (ingameMenu)
  101.             {
  102.                 ingameMenu.HandleSaveListUpdate();
  103.             }
  104.         }
  105.     }
  106.    
  107.     event /* C++ */ OnGameLoadInitFinished()
  108.     {
  109.         var requiredContent : array< name >;
  110.         var blockedContentTag : name;
  111.         var i : int;
  112.         var progress : float;
  113.         var loadResult : ELoadGameResult;
  114.         var ingameMenu : CR4IngameMenu;
  115.         var menuBase : CR4MenuBase;
  116.    
  117.         loadResult = GetLoadGameProgress();
  118.         blockedContentTag = 'launch0';
  119.        
  120.         if ( loadResult != LOAD_MissingContent && loadResult != LOAD_Error )
  121.         {
  122.             theSound.SoundEvent("stop_music"); // If theres an error, don't stop the music. Otherwise, stop it!
  123.             theSound.SoundEvent("gui_global_game_start");
  124.             theGame.GetGuiManager().RequestMouseCursor(false);
  125.         }
  126.        
  127.         if ( loadResult == LOAD_NotInitialized || loadResult == LOAD_Initializing || loadResult == LOAD_Loading )
  128.         {
  129.             LogChannel( 'Save', "Event OnGameLoadInitFinished() called, but load not initialized / not ready / already loading. DEBUG THIS!" );
  130.             isRespawningInLastCheckpoint = false;
  131.             return true; // event handled
  132.         }
  133.        
  134.         if ( loadResult == LOAD_MissingContent )
  135.         {
  136.             GetContentRequiredByLastSave( requiredContent );
  137.            
  138.             theSound.SoundEvent("gui_global_denied");
  139.            
  140.             for ( i = ( requiredContent.Size() - 1 ); i >= 0; i -= 1 )
  141.             {
  142.                 if ( !IsContentAvailable( requiredContent[ i ] ) )
  143.                 {
  144.                     blockedContentTag = requiredContent[ i ];
  145.                     break;
  146.                 }
  147.             }
  148.            
  149.             progress = ProgressToContentAvailable( blockedContentTag );
  150.             GetGuiManager().ShowProgressDialog( UMID_MissingContentOnLoadError, "", "error_message_new_game_not_ready", true, UDB_Ok, progress, UMPT_Content, blockedContentTag );
  151.             isRespawningInLastCheckpoint = false;
  152.            
  153.             menuBase = (CR4MenuBase)(theGame.GetGuiManager().GetRootMenu());
  154.             if (menuBase)
  155.             {
  156.                 ingameMenu = (CR4IngameMenu)(menuBase.GetSubMenu());
  157.                
  158.                 if (ingameMenu)
  159.                 {
  160.                     ingameMenu.HandleLoadGameFailed();
  161.                 }
  162.             }
  163.            
  164.             return true; // event handled
  165.         }
  166.        
  167.         if ( loadResult == LOAD_Error )
  168.         {
  169.             menuBase = (CR4MenuBase)(theGame.GetGuiManager().GetRootMenu());
  170.            
  171.             theSound.SoundEvent("gui_global_denied");
  172.            
  173.             if (menuBase)
  174.             {
  175.                 ingameMenu = (CR4IngameMenu)(menuBase.GetSubMenu());
  176.                
  177.                 if (ingameMenu)
  178.                 {
  179.                     ingameMenu.HandleLoadGameFailed();
  180.                 }
  181.             }
  182.         }
  183.  
  184.         if ( loadResult != LOAD_MissingContent && loadResult != LOAD_Error && isRespawningInLastCheckpoint )
  185.         {
  186.             ReleaseNoSaveLock( deathSaveLockId );
  187.             theInput.RestoreContext( 'Exploration', true );
  188.             isRespawningInLastCheckpoint = false;
  189.         }
  190.     }
  191.    
  192.     event /* C++ */ OnGameLoadInitFinishedSuccess()
  193.     {
  194.         GetGuiManager().GetRootMenu().CloseMenu();
  195.     }
  196.    
  197.     public function IsFocusModeActive() : bool
  198.     {
  199.         var focusModeController : CFocusModeController;
  200.         focusModeController = GetFocusModeController();
  201.         if ( focusModeController )
  202.         {
  203.             return focusModeController.IsActive();
  204.         }
  205.         return false;
  206.     }
  207.    
  208.     var logEnabled  : bool;
  209.     default logEnabled = true;
  210.    
  211.     public function EnableLog( enable : bool )
  212.     {
  213.         logEnabled = enable;
  214.     }
  215.    
  216.     public function CanLog() : bool
  217.     {
  218.         return logEnabled && !IsFinalBuild();
  219.     }
  220.        
  221.     import final function GetSurfacePostFX() : CGameplayFXSurfacePost;
  222.    
  223.     import final function GetCommonMapManager() : CCommonMapManager;
  224.  
  225.     import final function GetJournalManager() : CWitcherJournalManager;
  226.  
  227.     import final function GetLootManager() : CR4LootManager;
  228.    
  229.     import final function GetInteractionsManager() : CInteractionsManager;
  230.    
  231.     import final function GetCityLightManager() : CCityLightManager;   
  232.    
  233.     import final function GetSecondScreenManager() : CR4SecondScreenManagerScriptProxy;
  234.        
  235.     import final function GetGuiManager() : CR4GuiManager;
  236.  
  237.     import final function GetGlobalEventsScriptsDispatcher() : CR4GlobalEventsScriptsDispatcher;
  238.    
  239.     import final function GetFastForwardSystem() : CGameFastForwardSystem;
  240.    
  241.     import final function NotifyOpeningJournalEntry( jorunalEntry : CJournalBase );
  242.    
  243.     var globalEventsScriptsDispatcherInternal : CR4GlobalEventsScriptsDispatcher;
  244.     public function GetGlobalEventsManager() : CR4GlobalEventsScriptsDispatcher
  245.     {
  246.         if ( !globalEventsScriptsDispatcherInternal )
  247.         {
  248.             globalEventsScriptsDispatcherInternal = GetGlobalEventsScriptsDispatcher();
  249.         }
  250.         return globalEventsScriptsDispatcherInternal;
  251.     }
  252.        
  253.     // Start sepia effect
  254.     import final function StartSepiaEffect( fadeInTime: float ) : bool;
  255.    
  256.     // Start sepia effect
  257.     import final function StopSepiaEffect( fadeOutTime: float ) : bool;
  258.    
  259.     // Get the calculated wind value for point, accounting global wind and all the wind emitters in range
  260.     import final function GetWindAtPoint( point : Vector ) : Vector;
  261.     // Get the calculated wind value for point for visuals, accounting global wind and all the wind emitters in range
  262.     import final function GetWindAtPointForVisuals( point : Vector ) : Vector;
  263.    
  264.     import final function GetGameCamera() : CCustomCamera;
  265.    
  266.     //temp here
  267.     import final function GetBuffImmunitiesForActor( actor : CActor ) : CBuffImmunity;
  268.     import final function GetMonsterParamsForActor( actor : CActor, out monsterCategory : EMonsterCategory, out soundMonsterName : CName, out isTeleporting : bool, out canBeTargeted : bool, out canBeHitByFists : bool ) : bool;
  269.     import final function GetMonsterParamForActor( actor : CActor, out val : CMonsterParam ) : bool;
  270.    
  271.     // get the volume path manager
  272.     import final function GetVolumePathManager() : CVolumePathManager;
  273.    
  274.     // spawn player horse or teleport if exists, the horse will be tagged with 'PLAYER_horse'
  275.     import final function SummonPlayerHorse( teleportToSafeSpot : bool, createEntityHelper : CR4CreateEntityHelper );
  276.  
  277.     // toggle vs for menus
  278.     import final function ToggleMenus();
  279.     import final function ToggleInput();
  280.    
  281.     import final function GetResourceAliases( out aliases : array< string > );
  282.    
  283.     //kinect
  284.     import final function GetKinectSpeechRecognizer() : CR4KinectSpeechRecognizerListenerScriptProxy;
  285.    
  286.     // tutorial system access
  287.     import final function GetTutorialSystem() : CR4TutorialSystem;
  288.    
  289.     // User profile
  290.     import final function DisplaySystemHelp();
  291.     import final function DisplayUserProfileSystemDialog();
  292.     import final function SetRichPresence( presence : name );
  293.  
  294.     // callback to c++ from user ui box
  295.     import final function OnUserDialogCallback( message, action : int );
  296.    
  297.     // Save user settings
  298.     import final function SaveUserSettings();
  299.    
  300.     public final function UpdateRichPresence(presence : name)
  301.     {
  302.         SetRichPresence(presence);
  303.         currentPresence = presence;
  304.     }
  305.    
  306.     public final function ClearRichPresence(presence : name)
  307.     {
  308.         var manager: CCommonMapManager;
  309.         var currentArea : EAreaName;
  310.        
  311.         //don't clear if some other area has already changed presence setting
  312.         if(currentPresence == presence)
  313.         {
  314.             manager = theGame.GetCommonMapManager();
  315.             currentArea = manager.GetCurrentJournalArea();
  316.             currentPresence =  manager.GetLocalisationNameFromAreaType( currentArea );
  317.             SetRichPresence(currentPresence);
  318.             /*
  319.             SetRichPresence('location_outside_all');
  320.             currentPresence = 'location_outside_all';
  321.             */
  322.         }
  323.     }
  324.    
  325.     //game globals
  326.     import var params : W3GameParams;
  327.  
  328.     private var minimapSettings : C2dArray; //#B
  329.     public var playerStatisticsSettings : C2dArray; //#B
  330.     public var hudSettings : C2dArray; //#B
  331.  
  332.     // this handles all damage dealing
  333.     public var damageMgr : W3DamageManager;
  334.  
  335.     // this instance holds cached effects for further use
  336.     public var effectMgr : W3GameEffectManager;
  337.    
  338.     // timescale management
  339.     private var timescaleSources : array<STimescaleSource>;
  340.  
  341.     // updates environments
  342.     public saved var envMgr : W3EnvironmentManager;
  343.    
  344.     public var runewordMgr : W3RunewordManager;
  345.    
  346.     private var questLevelsFilePaths : array<string>;
  347.     public var questLevelsContainer : array<C2dArray>;
  348.     public var expGlobalModifiers : C2dArray;
  349.     public var expGlobalMod_kills : float;
  350.     public var expGlobalMod_quests : float;
  351.    
  352.     //sync anims
  353.     private var syncAnimManager : W3SyncAnimationManager;
  354.     public function GetSyncAnimManager() : W3SyncAnimationManager
  355.     {
  356.         if( !syncAnimManager )
  357.         {
  358.             syncAnimManager = new W3SyncAnimationManager in this;
  359.         }
  360.        
  361.         return syncAnimManager;
  362.     }
  363.    
  364.     //drinking minigame
  365.     /* REMOVED_DRINKING
  366.     public var drinkingMinigameMananger : W3DrinkingManager;   
  367.     public function CreateDrinkingManager() { drinkingMinigameMananger = new W3DrinkingManager in this; }
  368.     public function DeleteDrinkingManager() { delete drinkingMinigameMananger; }
  369.     */
  370.    
  371.     public function SetEnvironmentID( id : int )
  372.     {
  373.         environmentID = id;
  374.     }
  375.    
  376.     private function SetTimescaleSources()
  377.     {
  378.         timescaleSources.Clear();
  379.         timescaleSources.Grow( EnumGetMax('ETimescaleSource') + 1 );
  380.  
  381.         //ETS_PotionBlizzard
  382.         timescaleSources[ ETS_PotionBlizzard ].sourceType = ETS_PotionBlizzard;
  383.         timescaleSources[ ETS_PotionBlizzard ].sourceName = 'PotionBlizzard';
  384.         timescaleSources[ ETS_PotionBlizzard ].sourcePriority = 10;
  385.        
  386.         //ETS_SlowMoTask
  387.         timescaleSources[ ETS_SlowMoTask ].sourceType = ETS_SlowMoTask;
  388.         timescaleSources[ ETS_SlowMoTask ].sourceName = 'SlowMotionTask';
  389.         timescaleSources[ ETS_SlowMoTask ].sourcePriority = 15;
  390.        
  391.         //ETS_HeavyAttack
  392.         timescaleSources[ ETS_HeavyAttack ].sourceType = ETS_HeavyAttack;
  393.         timescaleSources[ ETS_HeavyAttack ].sourceName = 'HeavyAttack';
  394.         timescaleSources[ ETS_HeavyAttack ].sourcePriority = 15;
  395.        
  396.         //ETS_ThrowingAim
  397.         timescaleSources[ ETS_ThrowingAim ].sourceType = ETS_ThrowingAim;
  398.         timescaleSources[ ETS_ThrowingAim ].sourceName = 'ThrowingAim';
  399.         timescaleSources[ ETS_ThrowingAim ].sourcePriority = 15;
  400.        
  401.         //ETS_RaceSlowMo
  402.         timescaleSources[ ETS_RaceSlowMo ].sourceType = ETS_RaceSlowMo;
  403.         timescaleSources[ ETS_RaceSlowMo ].sourceName = 'RaceSlowMo';
  404.         timescaleSources[ ETS_RaceSlowMo ].sourcePriority = 10;
  405.        
  406.         //ETS_RadialMenu
  407.         timescaleSources[ ETS_RadialMenu ].sourceType = ETS_RadialMenu;
  408.         timescaleSources[ ETS_RadialMenu ].sourceName = 'RadialMenu';
  409.         timescaleSources[ ETS_RadialMenu ].sourcePriority = 20;
  410.        
  411.         //ETS_CFM_PlayAnim
  412.         timescaleSources[ ETS_CFM_PlayAnim ].sourceType = ETS_CFM_PlayAnim;
  413.         timescaleSources[ ETS_CFM_PlayAnim ].sourceName = 'CFM_PlayAnim';
  414.         timescaleSources[ ETS_CFM_PlayAnim ].sourcePriority = 25;
  415.        
  416.         //ETS_CFM_On
  417.         timescaleSources[ ETS_CFM_On ].sourceType = ETS_CFM_On;
  418.         timescaleSources[ ETS_CFM_On ].sourceName = 'CFM_On';
  419.         timescaleSources[ ETS_CFM_On ].sourcePriority = 20;
  420.        
  421.         //ETS_DebugInput
  422.         timescaleSources[ ETS_DebugInput ].sourceType = ETS_DebugInput;
  423.         timescaleSources[ ETS_DebugInput ].sourceName = 'debug_input';
  424.         timescaleSources[ ETS_DebugInput ].sourcePriority = 30;
  425.        
  426.         //ETS_SkillFrenzy
  427.         timescaleSources[ ETS_SkillFrenzy ].sourceType = ETS_SkillFrenzy;
  428.         timescaleSources[ ETS_SkillFrenzy ].sourceName = 'skill_frenzy';
  429.         timescaleSources[ ETS_SkillFrenzy ].sourcePriority = 15;
  430.        
  431.         //ETS_HorseMelee
  432.         timescaleSources[ ETS_HorseMelee ].sourceType = ETS_HorseMelee;
  433.         timescaleSources[ ETS_HorseMelee ].sourceName = 'horse_melee';
  434.         timescaleSources[ ETS_HorseMelee ].sourcePriority = 15;
  435.        
  436.         //ETS_FinisherInput
  437.         timescaleSources[ ETS_FinisherInput ].sourceType = ETS_FinisherInput;
  438.         timescaleSources[ ETS_FinisherInput ].sourceName = 'finisher_input';
  439.         timescaleSources[ ETS_FinisherInput ].sourcePriority = 15;
  440.        
  441.         //ETS_TutorialFight
  442.         timescaleSources[ ETS_TutorialFight ].sourceType = ETS_TutorialFight;
  443.         timescaleSources[ ETS_TutorialFight ].sourceName = 'tutorial_fight';
  444.         timescaleSources[ ETS_TutorialFight ].sourcePriority = 25;
  445.        
  446.         //ETS_InstantKill
  447.         timescaleSources[ ETS_InstantKill ].sourceType = ETS_InstantKill;
  448.         timescaleSources[ ETS_InstantKill ].sourceName = 'instant_kill';
  449.         timescaleSources[ ETS_InstantKill ].sourcePriority = 5;
  450.     }
  451.    
  452.     public function GetTimescaleSource(src : ETimescaleSource) : name
  453.     {
  454.         return timescaleSources[src].sourceName;
  455.     }
  456.    
  457.     public function GetTimescalePriority(src : ETimescaleSource) : int
  458.     {
  459.         return timescaleSources[src].sourcePriority;
  460.     }
  461.    
  462.     private function UpdateSecondScreen()
  463.     {
  464.         var areaMapPins             : array< SAreaMapPinInfo >;
  465.         var areaMapPinsCount        : int;
  466.         var index_areas             : int;
  467.         var worldPath               : string;
  468.         var localMapPins            : array< SCommonMapPinInstance >;
  469.         var globalMapPins           : array< SCommonMapPinInstance >;
  470.         var mapPin                  : SCommonMapPinInstance;
  471.    
  472.         areaMapPins         = GetCommonMapManager().GetAreaMapPins();
  473.         areaMapPinsCount    = areaMapPins.Size();
  474.         for ( index_areas = 0; index_areas < areaMapPinsCount; index_areas += 1 )
  475.         {      
  476.             mapPin.id = areaMapPins[ index_areas ].areaType;
  477.             mapPin.tag = '0';
  478.             mapPin.type = 'WorldMap';
  479.             mapPin.position = areaMapPins[ index_areas ].position;
  480.             mapPin.isDiscovered = true;
  481.             globalMapPins.PushBack( mapPin );
  482.            
  483.             localMapPins    = GetCommonMapManager().GetMapPinInstances( areaMapPins[ index_areas ].worldPath );
  484.             GetSecondScreenManager().SendAreaMapPins( areaMapPins[ index_areas ].areaType, localMapPins );         
  485.         }      
  486.        
  487.         GetSecondScreenManager().SendGlobalMapPins( globalMapPins );   
  488.     }
  489.    
  490.     // #J Values should match enum Platform defined at top of file
  491.     import final function GetPlatform():int;
  492.    
  493.     private var isSignedIn:bool;
  494.     default isSignedIn = false;
  495.    
  496.     public function isUserSignedIn():bool
  497.     {
  498.         if (GetPlatform() == Platform_PC)
  499.         {
  500.             return true;
  501.         }
  502.         else
  503.         {
  504.             return isSignedIn;
  505.         }
  506.     }
  507.    
  508.     event OnUserSignedIn()
  509.     {
  510.         isSignedIn = true;
  511.        
  512.         GetGuiManager().OnSignIn();
  513.     }
  514.    
  515.     event OnUserSignedOut()
  516.     {
  517.         isSignedIn = false;
  518.        
  519.         GetGuiManager().OnSignOut();
  520.     }
  521.    
  522.     event OnSignInStarted()
  523.     {
  524.         GetGuiManager().OnSignInStarted();
  525.     }
  526.    
  527.     event OnSignInCancelled()
  528.     {
  529.         GetGuiManager().OnSignInCancelled();
  530.     }
  531.    
  532.     import final function SetActiveUserPromiscuous();
  533.    
  534.     import final function ChangeActiveUser();
  535.    
  536.     import final function GetActiveUserDisplayName() : string;
  537.    
  538.     // returns if all content up to the specified tag is properly installed
  539.     import final function IsContentAvailable( content : name ) : bool;
  540.    
  541.     // returns the percentage of the install process towards reaching that content tag 10 = 10 percent
  542.     import final function ProgressToContentAvailable( content : name ) : int;
  543.    
  544.     import final function ShouldForceInstallVideo() : bool;
  545.    
  546.     import final function IsDebugQuestMenuEnabled() : bool;
  547.    
  548.     // this is for the quest to mark a point, where we start doing saves with NGP enabled
  549.     import final function EnableNewGamePlus( enable : bool );
  550.    
  551.     /* this is defined on C++ side:
  552.     enum ENewGamePlusStatus
  553.     {
  554.         NGP_Success,                // when everything went fine
  555.         NGP_Invalid,                // when passed SSavegameInfo is not a valid one
  556.         NGP_CantLoad,               // when save data cannot be loaded (like: corrupted save data or missing DLC)
  557.         NGP_TooOld,                 // when save data is made on unpatched game version and needs to be resaved
  558.         NGP_RequirementsNotMet,     // when player didn't finish the game or have too low level
  559.         NGP_InternalError,          // shouldn't happen at all, means that we have internal problems with the game
  560.         NGP_ContentRequired,        // when the game is not fully installed
  561.     };
  562.     call StartNewGamePlus() and check the result. Then display appropriate message if needed. */
  563.     import final function StartNewGamePlus( save : SSavegameInfo ) : ENewGamePlusStatus;
  564.    
  565.     public function OnConfigValueChanged( varName : name, value : string ) : void
  566.     {
  567.         var kinect : CR4KinectSpeechRecognizerListenerScriptProxy;
  568.         kinect = GetKinectSpeechRecognizer();
  569.        
  570.         if ( varName == 'Kinect' )
  571.         {
  572.             if ( value == "true" )
  573.                 kinect.SetEnabled( true );
  574.             else
  575.                 kinect.SetEnabled( false );
  576.         }
  577.     }
  578.    
  579.     public function LoadQuestLevels( filePath: string ) : void
  580.     {  
  581.         var index : int;   
  582.         index = questLevelsFilePaths.FindFirst( filePath );    
  583.         if( index == -1 )
  584.         {      
  585.             questLevelsFilePaths.PushBack( filePath ); 
  586.             questLevelsContainer.PushBack( LoadCSV( filePath ) );
  587.         }
  588.     }
  589.    
  590.     public function UnloadQuestLevels( filePath: string ) : void
  591.     {  
  592.         var index : int;   
  593.         index = questLevelsFilePaths.FindFirst( filePath );    
  594.         if( index != -1 )
  595.         {
  596.             questLevelsFilePaths.Erase( index );   
  597.             questLevelsContainer.Erase( index );
  598.         }        
  599.     }
  600.    
  601.     event OnGameStarting(restored : bool )
  602.     {
  603.         var diff : int;
  604.    
  605.         mSXPM = new CSXPM in this;
  606.         mSXPM.InitSXPM();
  607.    
  608.         if(!restored)
  609.         {
  610.             //because when you launch the game there is some memory corruption (?). In any case: variables are not reset but instead hold their values from previous session
  611.             gameplayFacts.Clear();
  612.             gameplayFactsForRemoval.Clear();
  613.         }
  614.        
  615.         if (!FactsDoesExist("lowest_difficulty_used") || GetLowestDifficultyUsed() == EDM_NotSet)
  616.         {
  617.             SetLowestDifficultyUsed(GetDifficultyLevel());
  618.         }
  619.            
  620.         SetHoursPerMinute(0.25);    //this is actually set somewhere in C++ but we need to reset it with each new game session as editor fails to do that  
  621.         thePlayer.SetRealHoursPerMinutesDN(this.GetHoursPerMinute()); //Shaedhen - Atmospheric Nights
  622.         SetTimescaleSources();
  623.        
  624.         //reset since theGame object does not reset properly on game launch
  625.         isDialogOrCutscenePlaying = false;
  626.    
  627.         // params object is already created in c++
  628.         params.Init();
  629.        
  630.         //combat log
  631.         witcherLog = new W3GameLog in this;
  632.                
  633.         InitGamerProfile();
  634.            
  635.         // initializing damage manager
  636.         damageMgr = new W3DamageManager in this;
  637.  
  638.         tooltipSettings = LoadCSV("gameplay\globals\tooltip_settings.csv");
  639.         minimapSettings = LoadCSV("gameplay\globals\minimap_settings.csv"); //#B
  640.         LoadHudSettings();
  641.         playerStatisticsSettings = LoadCSV("gameplay\globals\player_statistics_settings.csv"); //#B
  642.                    
  643.         LoadQuestLevels( "gameplay\globals\quest_levels.csv" );      
  644.        
  645.         expGlobalModifiers = LoadCSV("gameplay\globals\exp_mods.csv");
  646.         expGlobalMod_kills = StringToFloat( expGlobalModifiers.GetValueAt(0,0) );
  647.         expGlobalMod_quests = StringToFloat( expGlobalModifiers.GetValueAt(1,0) );
  648.        
  649.         //SXPM+
  650.         HandleXPMultipliers();
  651.         //SXPM-
  652.        
  653.         InitializeEffectManager();
  654.  
  655.         envMgr = new W3EnvironmentManager in this;
  656.         envMgr.Initialize();
  657.        
  658.         runewordMgr = new W3RunewordManager in this;
  659.         runewordMgr.Init();
  660.        
  661.         theGame.RequestPopup( 'OverlayPopup' );
  662.        
  663.         theSound.Initialize(); 
  664.         if(IsLoadingScreenVideoPlaying())
  665.         {
  666.             theSound.EnterGameState(ESGS_Movie);
  667.         }
  668.     }
  669.        
  670.     //SXPM+
  671.     private function HandleXPMultipliers()
  672.     {
  673.         var currXPMult : float;
  674.        
  675.         currXPMult = mSXPM.GetxpmultiplierK();
  676.        
  677.         if(mSXPM.GetisModOnK())
  678.         {
  679.             expGlobalMod_kills = currXPMult;
  680.         }
  681.         else
  682.         {
  683.             expGlobalMod_kills = StringToFloat( expGlobalModifiers.GetValueAt(0,0) );
  684.         }
  685.     }
  686.    
  687.     public function SetKillXPMultiplier( killmult : float)
  688.     {
  689.         if(mSXPM.GetisModOnK())
  690.         {
  691.             expGlobalMod_kills = killmult;
  692.         }
  693.         else
  694.         {
  695.             expGlobalMod_kills = StringToFloat( expGlobalModifiers.GetValueAt(0,0) );
  696.         }  
  697.     }
  698.    
  699.     public function ShowKillXPMultiplier()
  700.     {
  701.         thePlayer.DisplayHudMessage(expGlobalMod_kills);
  702.     }
  703.     //SXPM-
  704.        
  705.     private function InitGamerProfile()
  706.     {
  707.         gamerProfile = new W3GamerProfile in this;
  708.         gamerProfile.Init();
  709.     }
  710.    
  711.     public function GetGamerProfile() : W3GamerProfile
  712.     {
  713.         //because objects are created randomly on game start and might be created before the game is created
  714.         if(!gamerProfile)
  715.             InitGamerProfile();
  716.        
  717.         return gamerProfile;
  718.     }
  719.    
  720.     public function OnTick()
  721.     {
  722.         if(envMgr)
  723.             envMgr.Update();
  724.            
  725.         //if player finally spawned we can update scheduled difficulty change
  726.         if(diffChangePostponed != EDM_NotSet && thePlayer)
  727.         {
  728.             OnDifficultyChanged(diffChangePostponed);
  729.             diffChangePostponed = EDM_NotSet;
  730.         }
  731.        
  732.         FirePostponedPreAttackEvents();
  733.     }  
  734.    
  735.     event OnGameStarted(restored : bool)
  736.     {
  737.         var focusModeController : CFocusModeController;
  738.        
  739.         focusModeController = GetFocusModeController();
  740.        
  741.         if( !restored )
  742.         {
  743.             //call this only once at the start of new game to clear VALUES FROM PREVIOUS GAME SESSIONS BECAUSE ENGINE DOESN'T CLEAR THEM
  744.             if(FactsQuerySum("started_new_game") <= 0)
  745.             {
  746.                 thePlayer.displayedQuestsGUID.Clear();
  747.  
  748.                 dynamicallySpawnedBoats.Clear();
  749.                 FactsAdd("started_new_game", 1);
  750.             }
  751.         }
  752.        
  753.         if ( focusModeController )
  754.         {
  755.             focusModeController.OnGameStarted();
  756.         }
  757.    
  758.         GetCommonMapManager().OnGameStarted();
  759.        
  760.         //rich presence
  761.         ClearRichPresence(currentPresence);    
  762.  
  763.         theSound.InitializeAreaMusic( GetCommonMapManager().GetCurrentArea() );
  764.         UpdateSecondScreen();
  765.        
  766.         if( thePlayer && thePlayer.teleportedOnBoatToOtherHUB )
  767.         {
  768.             thePlayer.SetTeleportedOnBoatToOtherHUB( false );
  769.             thePlayer.AddTimer( 'DelayedSpawnAndMountBoat', 0.001f, false );
  770.         }
  771.     }
  772.    
  773.     event OnHandleWorldChange()
  774.     {
  775.         thePlayer.SetTeleportedOnBoatToOtherHUB( true );
  776.         thePlayer.CheckDayNightCycle(); //Shaedhen - Atmospheric Nights
  777.     }
  778.  
  779.    
  780.     event OnBeforeWorldChange( worldName : string )
  781.     {
  782.         // force setting loading screen video
  783.         var manager : CCommonMapManager = theGame.GetCommonMapManager();
  784.         if ( manager )
  785.         {
  786.             manager.CacheMapPins();
  787.             manager.ForceSettingLoadingScreenVideoForWorld( worldName );
  788.         }
  789.  
  790.         // clear used vehicle handle so it's empty when player is spawned in new world
  791.         thePlayer.SetUsedVehicle( NULL );
  792.     }
  793.    
  794.     event OnAfterLoadingScreenGameStart()
  795.     {
  796.         var tut : STutorialMessage;
  797.        
  798.         // Try to change the game state in case we were in a movie loading screen.
  799.         theSound.LeaveGameState(ESGS_Movie);
  800.         // If we entered constrained mode when in main menu or alt tabbed, we can be now in Menu mixing state.
  801.         // We fire the system_resume in order to get out of it.
  802.         theSound.SoundEvent("system_resume");
  803.        
  804.         //show stash tutorial message if game loaded and it's a pre-stash playthrough
  805.         if(ShouldProcessTutorial('TutorialStash') && FactsQuerySum("tut_stash_fresh_playthrough") <= 0)
  806.         {          
  807.             //fill tutorial object data
  808.             tut.type = ETMT_Message;
  809.             tut.tutorialScriptTag = 'TutorialStash';
  810.             tut.canBeShownInMenus = false;
  811.             tut.glossaryLink = false;
  812.             tut.markAsSeenOnShow = true;
  813.            
  814.             //show tutorial
  815.             theGame.GetTutorialSystem().DisplayTutorial(tut);
  816.         }
  817.     }
  818.    
  819.     event /* C++ */ OnSaveStarted( type : ESaveGameType )
  820.     {
  821.         LogChannel( 'Savegame', "OnSaveStarted " + type );
  822.         //theGame.GetGuiManager().ShowSavingIndicator(); // #Y disable for cert version
  823.     }
  824.  
  825.     event /* C++ */ OnSaveCompleted( type : ESaveGameType, succeeded : bool )
  826.     {
  827.         var hud : CR4ScriptedHud;
  828.         var text : string;
  829.  
  830.         LogChannel( 'Savegame', "OnSaveCompleted " + type + " " + succeeded );
  831.        
  832.         if ( succeeded )
  833.         {
  834.             theGame.GetGuiManager().ShowSavingIndicator();
  835.             theGame.GetGuiManager().HideSavingIndicator();
  836.        
  837.             if (theGame.GetPlatform() == Platform_Xbox1)
  838.             {
  839.                 text = "panel_hud_message_gamesaved_X1";
  840.             }
  841.             else if (theGame.GetPlatform() == Platform_PS4)
  842.             {
  843.                 text = "panel_hud_message_gamesaved_PS4";
  844.             }
  845.             else
  846.             {
  847.                 text = "panel_hud_message_gamesaved";
  848.             }
  849.            
  850.             if ( type == SGT_AutoSave || type == SGT_CheckPoint || type == SGT_ForcedCheckPoint )
  851.             {
  852.                 hud = ( CR4ScriptedHud )GetHud();
  853.                 if ( hud )
  854.                 {
  855.                     hud.HudConsoleMsg( GetLocStringByKeyExt(text) );
  856.                 }
  857.             }
  858.             else
  859.             {
  860.                 thePlayer.DisplayHudMessage( text );
  861.             }
  862.         }
  863.         else if ( type == SGT_QuickSave || type == SGT_Manual )
  864.         {
  865.             if (theGame.GetPlatform() == Platform_Xbox1)
  866.             {
  867.                 text = "panel_hud_message_gamesavedfailed_X1"; 
  868.             }
  869.             else if (theGame.GetPlatform() == Platform_PS4)
  870.             {
  871.                 text = "panel_hud_message_gamesavedfailed_PS4";
  872.             }
  873.             else
  874.             {
  875.                 text = "panel_hud_message_gamesavedfailed";
  876.             }
  877.            
  878.             theGame.GetGuiManager().ShowUserDialog(0, "", text, UDB_Ok);
  879.         }
  880.     }
  881.  
  882.     event OnControllerReconnected()
  883.     {
  884.         if(!theGame.IsBlackscreen() && theGame.IsActive())
  885.         {
  886.             if(theGame.GetGuiManager().IsAnyMenu())
  887.             {//if we are in a menu we resume music only
  888.                 theSound.SoundEvent("system_resume_music_only");
  889.             }
  890.             else
  891.             {
  892.                 theSound.SoundEvent("system_resume");
  893.             }
  894.         }
  895.        
  896.         GetGuiManager().OnControllerReconnected();
  897.     }
  898.    
  899.     event OnControllerDisconnected()
  900.     {
  901.         if(!theGame.IsBlackscreen() && theGame.IsActive() && !theGame.GetGuiManager().IsAnyMenu())
  902.         {
  903.             //we dont want to pause sounds if game is loading or is inactive or is already paused cos of Menu
  904.             theSound.SoundEvent("system_pause");
  905.         }
  906.        
  907.         GetGuiManager().OnControllerDisconnected();
  908.     }
  909.    
  910.     //called when a quest reward is given
  911.     event OnGiveReward( target : CEntity, rewardName : name, rewrd : SReward )
  912.     {
  913.         var i                       : int;
  914.         var itemCount               : int;
  915.         var gameplayEntity          : CGameplayEntity;
  916.         var inv                     : CInventoryComponent;
  917.         var goldMultiplier          : float;
  918.         var itemMultiplier          : float;
  919.         var itemsCount              : int;
  920.         var ids                     : array<SItemUniqueId>;
  921.         var itemCategory            : name;
  922.         var lvlDiff                 : int;
  923.         var moneyWon                : int;
  924.         var expModifier             : float;
  925.         var difficultyMode          : EDifficultyMode;
  926.         var rewardNameS             : string;
  927.         var ep1Content              : bool;
  928.         var rewardMultData          : SRewardMultiplier;
  929.         var currXPMult              : float; // SXPM
  930.        
  931.         if ( target == thePlayer )
  932.         {
  933.             // exp
  934.             if ( rewrd.experience > 0 && GetWitcherPlayer())
  935.             {
  936.                 expModifier = 1.0f;
  937.                 // check of EP1 content
  938.                 rewardNameS = NameToString(rewardName);
  939.                 ep1Content = false;
  940.                 if ( StrContains(rewardNameS, "q60") )
  941.                 {
  942.                     ep1Content = true;
  943.                 }
  944.                
  945.                 {
  946.                     if(FactsQuerySum("witcher3_game_finished") > 1 && !ep1Content )
  947.                     {
  948.                         expModifier = 0.5f;     //after completing the main quest line we get always 50% base exp
  949.                     }
  950.                     else
  951.                     {
  952.                         if ( rewrd.level == 0 )
  953.                         {
  954.                             expModifier = 1.f;   // special quests
  955.                         }
  956.                         else
  957.                         {
  958.                             lvlDiff = rewrd.level - thePlayer.GetLevel();
  959.                            
  960.                             //reward levels are set for base game, we need to increase them in NG+
  961.                             if(FactsQuerySum("NewGamePlus") > 0)
  962.                                 lvlDiff += params.GetNewGamePlusLevel();
  963.                                
  964.                             if ( lvlDiff <= -theGame.params.LEVEL_DIFF_HIGH )
  965.                             {
  966.                                 expModifier = 0.f;      //no exp
  967.                 GetWitcherPlayer().AddPoints( EExperiencePoint, RoundF( rewrd.experience * expGlobalMod_quests * expModifier), true);
  968.             }
  969.                             }
  970.                             else
  971.                             {
  972.                                 difficultyMode = theGame.GetDifficultyMode();
  973.                                 if ( difficultyMode == EDM_Hardcore )
  974.                                 {
  975.                                     expModifier = 0.8;
  976.                                 }
  977.                                 else if ( difficultyMode == EDM_Hard )
  978.                                 {
  979.                                     expModifier = 0.9;
  980.                                 }
  981.                                 else
  982.                                 {
  983.                                     expModifier = 1.0;
  984.                                 }
  985.                                
  986.                                 if ( ep1Content && lvlDiff < theGame.params.LEVEL_DIFF_HIGH )
  987.                                 {
  988.                                     expModifier += lvlDiff * theGame.params.LEVEL_DIFF_XP_MOD;
  989.                                     if ( expModifier > theGame.params.MAX_XP_MOD )
  990.                                         expModifier = theGame.params.MAX_XP_MOD;
  991.                                     if ( expModifier < 0.f )
  992.                                         expModifier = 0.f;
  993.                                 }
  994.                             }
  995.                         }
  996.                     }
  997.                 }
  998.                
  999.                 if(mSXPM.GetisModOnQ())
  1000.                 {
  1001.                     currXPMult = mSXPM.GetxpmultiplierQ();
  1002.                     expModifier = currXPMult;
  1003.                 }
  1004.                
  1005.                 if(expModifier > 0.f && !mSXPM.GetUseTrueZero())
  1006.                     GetWitcherPlayer().AddPoints( EExperiencePoint, RoundF( rewrd.experience * expGlobalMod_quests * expModifier), true);
  1007.                 else if ( expModifier == 0.f && rewrd.experience > 0 && !mSXPM.GetUseTrueZero())
  1008.                 {
  1009.                     expModifier = 0.05f;           
  1010.                     GetWitcherPlayer().AddPoints( EExperiencePoint, RoundF( rewrd.experience * expGlobalMod_quests * expModifier), true);
  1011.                 }
  1012.             }
  1013.            
  1014.             if ( rewrd.achievement > 0 )
  1015.             {
  1016.                 theGame.GetGamerProfile().AddAchievement( rewrd.achievement );
  1017.             }
  1018.         }
  1019.        
  1020.         gameplayEntity = (CGameplayEntity)target;
  1021.         if ( gameplayEntity )
  1022.         {
  1023.             inv = gameplayEntity.GetInventory();
  1024.             if ( inv )
  1025.             {
  1026.                 rewardMultData = thePlayer.GetRewardMultiplierData( rewardName );
  1027.                
  1028.                 if( rewardMultData.isItemMultiplier )
  1029.                 {
  1030.                     goldMultiplier = 1.0;
  1031.                     itemMultiplier = rewardMultData.rewardMultiplier;
  1032.                 }
  1033.                 else
  1034.                 {
  1035.                     goldMultiplier = rewardMultData.rewardMultiplier;
  1036.                     itemMultiplier = 1.0;
  1037.                 }
  1038.                
  1039.                 // gold
  1040.                 if ( rewrd.gold > 0 )
  1041.                 {
  1042.                     inv.AddMoney( (int)(rewrd.gold * goldMultiplier) );
  1043.                     thePlayer.RemoveRewardMultiplier(rewardName);      
  1044.                     if( target == thePlayer )
  1045.                     {
  1046.                         moneyWon = (int)(rewrd.gold * goldMultiplier);
  1047.                        
  1048.                         if ( moneyWon > 0 )
  1049.                             thePlayer.DisplayItemRewardNotification('Crowns', moneyWon );
  1050.                     }
  1051.                 }
  1052.                
  1053.                 // items
  1054.                
  1055.                 for ( i = 0; i < rewrd.items.Size(); i += 1 )
  1056.                 {
  1057.                     itemsCount = RoundF( rewrd.items[ i ].amount * itemMultiplier );
  1058.                    
  1059.                     if( itemsCount > 0 )
  1060.                     {
  1061.                         ids = inv.AddAnItem( rewrd.items[ i ].item, itemsCount );
  1062.                        
  1063.                         for ( itemCount = 0; itemCount < ids.Size(); itemCount += 1 )
  1064.                         {
  1065.                             // failsafe - when item is spawned in container and there is no player level yet - reset item and regenerate
  1066.                             if ( inv.ItemHasTag( ids[i], 'Autogen' ) && GetWitcherPlayer().GetLevel() - 1 > 1 )
  1067.                             {
  1068.                                 inv.GenerateItemLevel( ids[i], true );
  1069.                             }
  1070.                         }
  1071.                        
  1072.                         itemCategory = inv.GetItemCategory( ids[0] );
  1073.                         if ( itemCategory == 'alchemy_recipe' ||  itemCategory == 'crafting_schematic' )
  1074.                         {
  1075.                             inv.ReadSchematicsAndRecipes( ids[0] );
  1076.                         }                      
  1077.                        
  1078.                         if(target == thePlayer)
  1079.                         {
  1080.                             //Gwint cards should not display info in rewards, notification is handled inside AddAnItem function to display info from all sources
  1081.                             if( !inv.ItemHasTag( ids[0], 'GwintCard') )
  1082.                             {
  1083.                                 thePlayer.DisplayItemRewardNotification(rewrd.items[ i ].item, RoundF( rewrd.items[ i ].amount * itemMultiplier ) );
  1084.                             }
  1085.                         }
  1086.                     }
  1087.                 }
  1088.             }
  1089.         }
  1090.     }
  1091.  
  1092.     public function IsEffectManagerInitialized() : bool
  1093.     {
  1094.         if(!effectMgr)
  1095.             return false;
  1096.        
  1097.         return effectMgr.IsReady();
  1098.     }
  1099.    
  1100.     public function InitializeEffectManager()
  1101.     {
  1102.         effectMgr = new W3GameEffectManager in this;
  1103.         effectMgr.Initialize();
  1104.     }
  1105.    
  1106.     public function GetLowestDifficultyUsed() : EDifficultyMode
  1107.     {
  1108.         return FactsQuerySum("lowest_difficulty_used");
  1109.     }
  1110.    
  1111.     public function SetLowestDifficultyUsed(d : EDifficultyMode)
  1112.     {
  1113.         FactsSet("lowest_difficulty_used", (int)d);
  1114.     }
  1115.    
  1116.     // Game ended
  1117.     event OnGameEnded()
  1118.     {  
  1119.         var focusModeController : CFocusModeController;
  1120.        
  1121.         if ( runewordMgr )
  1122.         {
  1123.             delete runewordMgr;
  1124.             runewordMgr = NULL;
  1125.         }
  1126.        
  1127.         focusModeController = GetFocusModeController();
  1128.         if ( focusModeController )
  1129.         {
  1130.             focusModeController.OnGameEnded();
  1131.         }
  1132.         thePlayer.DeactivateDN(); //Shaedhen - Atmospheric Nights
  1133.         DeactivateEnvironment( environmentID, 0 );
  1134.            
  1135.         if(effectMgr)
  1136.         {
  1137.             delete effectMgr;
  1138.             effectMgr = NULL;
  1139.         }
  1140.        
  1141.         if(envMgr)
  1142.         {
  1143.             delete envMgr;
  1144.             envMgr = NULL;
  1145.         }
  1146.        
  1147.         if( syncAnimManager )
  1148.         {
  1149.             delete syncAnimManager;
  1150.             syncAnimManager = NULL;
  1151.         }
  1152.        
  1153.         RemoveTimeScale( GetTimescaleSource(ETS_RadialMenu) );
  1154.  
  1155.         //for sound debuging/ambients in editor
  1156.         theSound.Finalize();
  1157.         //theSound.SoundState( "game_state", ""  );
  1158.        
  1159.         LogChannel( 'HUD', "GUI Closed" );
  1160.     }
  1161.        
  1162.     public var m_runReactionSceneDialog : bool;
  1163.     public function SetRunReactionSceneDialog( val : bool ){ m_runReactionSceneDialog = val; }
  1164.    
  1165.     public function SetIsDialogOrCutscenePlaying(b : bool)
  1166.     {
  1167.         var witcher         : W3PlayerWitcher;
  1168.         var activePoster    : W3Poster;
  1169.         var hud             : CR4ScriptedHud;
  1170.         var radialModule    : CR4HudModuleRadialMenu;
  1171.         var lootPopup       : CR4LootPopup;
  1172.         var bolts           : SItemUniqueId;
  1173.        
  1174.         isDialogOrCutscenePlaying = b;
  1175.         recentDialogOrCutsceneEndGameTime = GetGameTime();
  1176.        
  1177.         if ( b)
  1178.         {
  1179.             hud = (CR4ScriptedHud)GetHud();
  1180.    
  1181.             if( hud )
  1182.             {
  1183.                 radialModule = (CR4HudModuleRadialMenu)hud.GetHudModule("RadialMenuModule");
  1184.                 if (radialModule && radialModule.IsRadialMenuOpened())
  1185.                 {
  1186.                     radialModule.HideRadialMenu();
  1187.                 }
  1188.             }
  1189.            
  1190.             lootPopup = (CR4LootPopup)GetGuiManager().GetPopup('LootPopup');
  1191.            
  1192.             if (lootPopup)
  1193.             {
  1194.                 lootPopup.ClosePopup();
  1195.             }
  1196.         }
  1197.        
  1198.         if(theGame.GetTutorialSystem() && theGame.GetTutorialSystem().IsRunning())
  1199.         {
  1200.             theGame.GetTutorialSystem().OnCutsceneOrDialogChange(b);
  1201.            
  1202.             if(b)
  1203.             {
  1204.                 FactsAdd("tut_dialog_started", 1, CeilF(ConvertRealTimeSecondsToGameSeconds(1)));
  1205.             }
  1206.         }
  1207.        
  1208.         //disable player quen
  1209.         witcher = GetWitcherPlayer();
  1210.         if(b && witcher && witcher.IsAnyQuenActive())
  1211.         {
  1212.             witcher.FinishQuen( true, true );          
  1213.         }
  1214.        
  1215.         activePoster = thePlayer.GetActivePoster ();
  1216.        
  1217.         if ( activePoster )
  1218.         {
  1219.             CloseMenu('PosterMenu');
  1220.             activePoster.OnEndedObservingPoster();
  1221.         }
  1222.        
  1223.         if ( b && thePlayer.IsHoldingItemInLHand ())
  1224.         {
  1225.             thePlayer.HideUsableItem( true );
  1226.             restoreUsableItemL = true;
  1227.         }
  1228.         if ( !b && restoreUsableItemL )
  1229.         {
  1230.             restoreUsableItemL = false;
  1231.            
  1232.             if ( !thePlayer.IsInCombat() )
  1233.             {
  1234.                 thePlayer.OnUseSelectedItem();
  1235.             }
  1236.         }
  1237.        
  1238.         //harpoon equip hack - sometimes scenes can teleport player to water for a short while - in such case
  1239.         //harpoons equip properly but it does not handle getting out of the water properly
  1240.         if(!b && witcher)
  1241.         {
  1242.             //if no bolts equipped or equipped bodkin/harpoon bolts
  1243.             if(!witcher.GetItemEquippedOnSlot(EES_Bolt, bolts) || witcher.inv.ItemHasTag(bolts, theGame.params.TAG_INFINITE_AMMO))         
  1244.                 witcher.AddAndEquipInfiniteBolt();
  1245.         }
  1246.     }
  1247.    
  1248.     public final function IsDialogOrCutscenePlaying() : bool
  1249.     {
  1250.         return isDialogOrCutscenePlaying;
  1251.     }
  1252.    
  1253.     public final function GetRecentDialogOrCutsceneEndGameTime() : GameTime
  1254.     {
  1255.         return recentDialogOrCutsceneEndGameTime;
  1256.     }
  1257.    
  1258.     public final function GetSavedEnchanterFunds() : int
  1259.     {
  1260.         return savedEnchanterFunds;
  1261.     }
  1262.  
  1263.     public final function SetSavedEnchanterFunds( value : int )
  1264.     {
  1265.         savedEnchanterFunds = value;
  1266.     }
  1267.  
  1268.     //bullshit as the var is public but cannot be accessed
  1269.     public function SetIsCutscenePlaying(b : bool)
  1270.     {
  1271.         isCutscenePlaying = b;
  1272.     }
  1273.    
  1274.     /////////////////////////////////////////////
  1275.     // MAIN MENU
  1276.     /////////////////////////////////////////////
  1277.    
  1278.     /* C++ */ public function PopulateMenuQueueStartupOnce( out menus : array< name > )
  1279.     {
  1280.         menus.PushBack( 'StartupMoviesMenu' );
  1281.     }
  1282.    
  1283.     /* C++ */ public function PopulateMenuQueueStartupAlways( out menus : array< name > )
  1284.     {
  1285.         if (GetPlatform() != Platform_PC)
  1286.         {
  1287.             if ( theGame.GetDLCManager().IsEP2Available() )
  1288.             {
  1289.                 menus.PushBack( 'StartScreenMenuEP2' );
  1290.             }
  1291.             else if ( theGame.GetDLCManager().IsEP1Available() )
  1292.             {
  1293.                 menus.PushBack( 'StartScreenMenuEP1' );
  1294.             }
  1295.             else
  1296.             {
  1297.                 menus.PushBack( 'StartScreenMenu' );
  1298.             }
  1299.         }
  1300.     }
  1301.    
  1302.     /* C++ */ public function PopulateMenuQueueConfig( out menus : array< name > )
  1303.     {
  1304.         var inGameConfigWrapper : CInGameConfigWrapper;
  1305.         inGameConfigWrapper = (CInGameConfigWrapper)theGame.GetInGameConfigWrapper();
  1306.        
  1307.         if( GetPlatform() != Platform_PC )
  1308.         {
  1309.             menus.PushBack( 'RescaleMenu' );
  1310.             menus.PushBack( 'MainGammaMenu' );
  1311.         }
  1312.     }
  1313.  
  1314.     /* C++ */ public function PopulateMenuQueueMainOnce( out menus : array< name > )
  1315.     {
  1316.         if (GetPlatform() != Platform_PC)
  1317.         {
  1318.             menus.PushBack( 'AutosaveWarningMenu' );
  1319.         }
  1320.         menus.PushBack( 'RecapMoviesMenu' );
  1321.     }
  1322.    
  1323.     /* C++ */ public function PopulateMenuQueueMainAlways( out menus : array< name > )
  1324.     {
  1325.         if (theGame.GetDLCManager().IsEP2Available())
  1326.         {
  1327.             menus.PushBack( 'CommonMainMenuEP2' );
  1328.         }
  1329.         else if (theGame.GetDLCManager().IsEP1Available())
  1330.         {
  1331.             menus.PushBack( 'CommonMainMenuEP1' );
  1332.         }
  1333.         else
  1334.         {
  1335.             menus.PushBack( 'CommonMainMenu' );
  1336.         }
  1337.     }
  1338.  
  1339.     public function GetNewGameDefinitionFilename() : string
  1340.     {
  1341.         return "game/witcher3.redgame";
  1342.     }
  1343.    
  1344.     /////////////////////////////////////////////
  1345.     // GAME ZONES
  1346.     /////////////////////////////////////////////
  1347.    
  1348.     public function GetCurrentZone() : EZoneName
  1349.     {
  1350.         return zoneName;
  1351.     }
  1352.    
  1353.     public function SetCurrentZone( tag : name )
  1354.     {
  1355.         zoneName = ZoneNameToType( tag );
  1356.     }
  1357.        
  1358.     /////////////////////////////////////////////
  1359.     //                  UI
  1360.     /////////////////////////////////////////////
  1361.    
  1362.     private var uiHorizontalFrameScale : float; default uiHorizontalFrameScale              = 1.0;
  1363.     private var uiVerticalFrameScale : float;   default uiVerticalFrameScale                = 1.0;
  1364.     private var uiScale : float;                default uiScale                             = 1.0; 
  1365.     private var uiGamepadScaleGain : float;     default uiGamepadScaleGain                  = 0.0;
  1366.     private var uiOpacity : float;              default uiOpacity                           = 0.8;
  1367.    
  1368.     // #Y temp solution to store this value
  1369.     protected var isColorBlindMode:bool;
  1370.     public function getColorBlindMode():bool
  1371.     {
  1372.         return isColorBlindMode;
  1373.     }
  1374.     public function setColorBlindMode(value:bool)
  1375.     {
  1376.         isColorBlindMode = value;
  1377.     }
  1378.    
  1379.     // menu to be opened by common/background menu
  1380.     private var menuToOpen : name;
  1381.     public function GetMenuToOpen() : name
  1382.     {
  1383.         return menuToOpen;
  1384.     }
  1385.     public function SetMenuToOpen( menu : name )
  1386.     {
  1387.         menuToOpen = menu;
  1388.     }
  1389.    
  1390.     public function RequestMenuWithBackground( menu : name, backgroundMenu : name, optional initData : IScriptable )
  1391.     {
  1392.         var commonMenu : CR4CommonMenu;
  1393.         var guiManager : CR4GuiManager;
  1394.        
  1395.         guiManager = GetGuiManager();
  1396.         commonMenu = (CR4CommonMenu)guiManager.GetRootMenu();
  1397.         if( commonMenu )
  1398.         {
  1399.             commonMenu.SwitchToSubMenu(menu,"");
  1400.         }
  1401.         else
  1402.         {
  1403.             if ( guiManager.IsAnyMenu() )
  1404.             {
  1405.                 guiManager.GetRootMenu().CloseMenu();
  1406.             }
  1407.            
  1408.             SetMenuToOpen( menu );
  1409.             theGame.RequestMenu( backgroundMenu, initData );
  1410.         }
  1411.     }
  1412.    
  1413.     public function OpenPopup(DataObject : W3PopupData) : void
  1414.     {
  1415.         theGame.RequestMenu('PopupMenu', DataObject);
  1416.     }
  1417.  
  1418.     public function SetUIVerticalFrameScale( value : float )
  1419.     {
  1420.         uiVerticalFrameScale = value;
  1421.     }
  1422.  
  1423.     public function GetUIVerticalFrameScale() : float
  1424.     {
  1425.         return uiVerticalFrameScale;
  1426.     }
  1427.  
  1428.     public function SetUIHorizontalFrameScale( value : float )
  1429.     {
  1430.         var horizontalPlusFrameScale : float;
  1431.         uiHorizontalFrameScale = value;
  1432.         horizontalPlusFrameScale = theGame.GetUIHorizontalPlusFrameScale();
  1433.         uiHorizontalFrameScale = uiHorizontalFrameScale * horizontalPlusFrameScale;
  1434.     }
  1435.    
  1436.     public function GetUIHorizontalFrameScale() : float
  1437.     {
  1438.         return uiHorizontalFrameScale;
  1439.     }
  1440.    
  1441.     public function SetUIScale( value : float )
  1442.     {
  1443.         uiScale = value;
  1444.     }
  1445.  
  1446.     public function GetUIScale() : float
  1447.     {
  1448.         return uiScale;
  1449.     }
  1450.  
  1451.     public function SetUIGamepadScaleGain( value : float )
  1452.     {
  1453.         uiGamepadScaleGain = value;
  1454.     }
  1455.  
  1456.     public function GetUIGamepadScaleGain() : float
  1457.     {
  1458.         return uiGamepadScaleGain;
  1459.     }
  1460.  
  1461.     public function SetDeathSaveLockId(i : int)
  1462.     {
  1463.         deathSaveLockId = i;
  1464.     }
  1465.    
  1466.     public function SetUIOpacity( value : float )
  1467.     {
  1468.         uiOpacity = value;
  1469.     }
  1470.  
  1471.     public function GetUIOpacity() : float
  1472.     {
  1473.         return uiOpacity;
  1474.     }
  1475.    
  1476.     public function setDialogDisplayDisabled( value : bool )
  1477.     {
  1478.         isDialogDisplayDisabled = value;
  1479.     }
  1480.  
  1481.     public function LoadHudSettings()
  1482.     {
  1483.         var inGameConfigWrapper : CInGameConfigWrapper;
  1484.        
  1485.         hudSettings = LoadCSV("gameplay\globals\hud_settings.csv"); //#B
  1486.            
  1487.         inGameConfigWrapper = (CInGameConfigWrapper)theGame.GetInGameConfigWrapper();
  1488.            
  1489.         isDialogDisplayDisabled = inGameConfigWrapper.GetVarValue('Localization', 'Subtitles') == "false";
  1490.            
  1491.         SetUIVerticalFrameScale( StringToFloat(inGameConfigWrapper.GetVarValue('Hidden', 'uiVerticalFrameScale')) );
  1492.         SetUIHorizontalFrameScale( StringToFloat(inGameConfigWrapper.GetVarValue('Hidden', 'uiHorizontalFrameScale')) );
  1493.            
  1494.         uiScale = StringToFloat(theGame.hudSettings.GetValueAt(1,theGame.hudSettings.GetRowIndexAt( 0, "uiScale" )));  
  1495.         uiOpacity = StringToFloat(theGame.hudSettings.GetValueAt(1,theGame.hudSettings.GetRowIndexAt( 0, "uiOpacity" )));  
  1496.     }
  1497.    
  1498.     event OnRefreshUIScaling()
  1499.     {
  1500.         var inGameConfigWrapper : CInGameConfigWrapper;
  1501.         inGameConfigWrapper = (CInGameConfigWrapper)theGame.GetInGameConfigWrapper();
  1502.         SetUIVerticalFrameScale( StringToFloat(inGameConfigWrapper.GetVarValue('Hidden', 'uiVerticalFrameScale')) );
  1503.         SetUIHorizontalFrameScale( StringToFloat(inGameConfigWrapper.GetVarValue('Hidden', 'uiHorizontalFrameScale')) );
  1504.     }
  1505.    
  1506.     event OnSpawnPlayerHorse( )
  1507.     {
  1508.         var createEntityHelper              : CR4CreateEntityHelper;
  1509.        
  1510.         thePlayer.RaiseEvent('HorseSummon');
  1511.        
  1512.         if( !thePlayer.GetHorseWithInventory()
  1513.             ||  !thePlayer.GetHorseWithInventory().IsAlive()
  1514.             ||  ( !thePlayer.WasVisibleInScaledFrame( thePlayer.GetHorseWithInventory(), 1.5f, 1.5f ) && VecDistanceSquared( thePlayer.GetWorldPosition(), thePlayer.GetHorseWithInventory().GetWorldPosition() ) > 900 )
  1515.             ||  VecDistanceSquared( thePlayer.GetWorldPosition(), thePlayer.GetHorseWithInventory().GetWorldPosition() ) > 1600 )
  1516.         {
  1517.             createEntityHelper = new CR4CreateEntityHelper in this;
  1518.             createEntityHelper.SetPostAttachedCallback( this, 'OnPlayerHorseSummoned' );
  1519.             theGame.SummonPlayerHorse( true, createEntityHelper );
  1520.         }
  1521.         else
  1522.         {
  1523.             // Just come to me you koń !
  1524.             thePlayer.GetHorseWithInventory().SignalGameplayEventParamObject( 'HorseSummon', thePlayer );
  1525.         }
  1526.        
  1527.         thePlayer.OnSpawnHorse();
  1528.     }
  1529.  
  1530.     private function OnPlayerHorseSummoned( horseEntity : CEntity )
  1531.     {
  1532.         var saddle          : SItemUniqueId;
  1533.         var horseManager    : W3HorseManager;
  1534.         var horse           : CActor;
  1535.  
  1536.         //Demonic Saddle
  1537.         horseManager = GetWitcherPlayer().GetHorseManager();
  1538.         saddle = horseManager.GetItemInSlot(EES_HorseSaddle);
  1539.         if ( horseManager.GetInventoryComponent().GetItemName(saddle) == 'Devil Saddle' )
  1540.         {
  1541.             // proper appearance for 'Devil Saddle' is set inside ApplyHorseUpdateOnSpawn called below
  1542.             horse = (CActor)horseEntity;
  1543.             horse.AddEffectDefault(EET_WeakeningAura, horse, 'horse saddle', false);
  1544.         }
  1545.        
  1546.         thePlayer.GetHorseWithInventory().SignalGameplayEventParamObject( 'HorseSummon', thePlayer );
  1547.        
  1548.         GetWitcherPlayer().GetHorseManager().ApplyHorseUpdateOnSpawn();
  1549.     }
  1550.    
  1551.     //See EDialogActionIcon for flag values (EDialogActionIcon)
  1552.     event OnTutorialMessageForChoiceLines( flags : int )
  1553.     {
  1554.         //var dbg_icons : array<EDialogActionIcon>;
  1555.        
  1556.         //dbg_icons  = GetDialogActionIcons(flags);
  1557.         GameplayFactsSet('dialog_choice_flags', flags);
  1558.         GameplayFactsAdd('dialog_choice_is_set', 1, 1);
  1559.     }
  1560.    
  1561.     event OnTutorialMessageForChoiceLineChosen( flags : int )
  1562.     {
  1563.         GameplayFactsSet('dialog_used_choice_flags', flags);
  1564.         GameplayFactsAdd('dialog_used_choice_is_set', 1, 1);
  1565.     }  
  1566.    
  1567.     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1568.     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1569.     /////////////////////////////////   GAMEPLAY FACTS   //////////////////////////////////////////////////////////////////////////////////
  1570.     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1571.     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1572.     /*
  1573.         Duplicated facts db functionality. The reason is that if game is paused or if gametime is frozen to a fixed hour (e.g. constant 15:30)
  1574.         then facts CANNOT be removed from DB until game is unpaused / time is unfrozen. As a consequence this screws up all facts
  1575.         being added for some period of time. We're not going to get any fix on this.
  1576.     */
  1577.  
  1578.     public function GameplayFactsAdd(factName : string, optional value : int, optional realtimeSecsValidFor : int)
  1579.     {
  1580.         var idx : int;
  1581.         var newFact : SGameplayFact;
  1582.         var newFactRemoval : SGameplayFactRemoval;
  1583.        
  1584.         if(value < 0)
  1585.             return;
  1586.         else if(value == 0)
  1587.             value = 1;
  1588.            
  1589.         idx = GetGameplayFactIndex(factName);
  1590.         if(idx >= 0)
  1591.         {
  1592.             gameplayFacts[idx].value += value;
  1593.         }
  1594.         else
  1595.         {
  1596.             newFact.factName = factName;
  1597.             newFact.value = value;
  1598.             gameplayFacts.PushBack(newFact);
  1599.         }
  1600.        
  1601.         if(realtimeSecsValidFor > 0)
  1602.         {
  1603.             newFactRemoval.factName = factName;
  1604.             newFactRemoval.value = value;
  1605.             newFactRemoval.timerID = thePlayer.AddTimer('GameplayFactRemove', realtimeSecsValidFor, , , , true, false);
  1606.            
  1607.             gameplayFactsForRemoval.PushBack(newFactRemoval);
  1608.         }
  1609.     }
  1610.    
  1611.     public function GameplayFactsSet(factName : string, value : int)
  1612.     {
  1613.         var idx : int;
  1614.         var newFact : SGameplayFact;
  1615.        
  1616.         idx = GetGameplayFactIndex(factName);
  1617.         if(idx >= 0)
  1618.         {
  1619.             gameplayFacts[idx].value = value;
  1620.         }
  1621.         else
  1622.         {
  1623.             newFact.factName = factName;
  1624.             newFact.value = value;
  1625.             gameplayFacts.PushBack(newFact);
  1626.         }
  1627.     }
  1628.    
  1629.     public function GameplayFactsRemove(factName : string)
  1630.     {
  1631.         var i : int;
  1632.        
  1633.         for(i=0; i<gameplayFacts.Size(); i+=1)
  1634.         {
  1635.             if(gameplayFacts[i].factName == factName)
  1636.             {
  1637.                 gameplayFacts.EraseFast(i);
  1638.                 return;
  1639.             }
  1640.         }
  1641.     }
  1642.    
  1643.     //Gameplay fact removed by finished timer of given timer ID
  1644.     public function GameplayFactRemoveFromTimer(timerID : int)
  1645.     {
  1646.         var idx, factIdx : int;
  1647.        
  1648.         idx = GetGameplayFactsForRemovalIndex(timerID);
  1649.         if(idx < 0)
  1650.         {
  1651.             LogAssert(false, "CR4Game.GameplayFactRemoveFromTimer: trying to process non-existant timer <<" + timerID + ">>");
  1652.             return;
  1653.         }
  1654.        
  1655.         factIdx = GetGameplayFactIndex(gameplayFactsForRemoval[idx].factName);
  1656.         if(factIdx < 0)                
  1657.             return;
  1658.        
  1659.         gameplayFacts[factIdx].value -= gameplayFactsForRemoval[idx].value;
  1660.         if(gameplayFacts[factIdx].value <= 0)
  1661.             gameplayFacts.EraseFast(factIdx);
  1662.            
  1663.         gameplayFactsForRemoval.EraseFast(idx);
  1664.     }
  1665.  
  1666.     public function GameplayFactsQuerySum(factName : string) : int
  1667.     {
  1668.         var idx : int;
  1669.        
  1670.         idx = GetGameplayFactIndex(factName);
  1671.         if(idx >= 0)       
  1672.             return gameplayFacts[idx].value;
  1673.            
  1674.         return 0;
  1675.     }
  1676.    
  1677.     private function GetGameplayFactIndex(factName : string) : int
  1678.     {
  1679.         var i : int;
  1680.        
  1681.         for(i=0; i<gameplayFacts.Size(); i+=1)
  1682.         {
  1683.             if(gameplayFacts[i].factName == factName)
  1684.                 return i;          
  1685.         }
  1686.        
  1687.         return -1;
  1688.     }
  1689.    
  1690.     private function GetGameplayFactsForRemovalIndex(timerID : int) : int
  1691.     {
  1692.         var i : int;
  1693.        
  1694.         for(i=0; i<gameplayFactsForRemoval.Size(); i+=1)
  1695.         {
  1696.             if(gameplayFactsForRemoval[i].timerID == timerID)
  1697.                 return i;          
  1698.         }
  1699.        
  1700.         return -1;
  1701.     }
  1702.    
  1703.     public function GetR4ReactionManager() : CR4ReactionManager
  1704.     {
  1705.         return ( CR4ReactionManager ) GetBehTreeReactionManager();
  1706.     }
  1707.        
  1708.     public function GetDifficultyMode() : EDifficultyMode
  1709.     {
  1710.         var diff : EDifficultyMode;
  1711.                
  1712.         diff = GetDifficultyLevel();
  1713.        
  1714.         //if diff not set, then use default
  1715.         if(diff == EDM_NotSet)
  1716.         {
  1717.             return EDM_Medium;
  1718.         }
  1719.        
  1720.         return diff;
  1721.     }
  1722.    
  1723.     event OnDifficultyChanged(newDifficulty : int)
  1724.     {
  1725.         var i : int;
  1726.         var lowestDiff : EDifficultyMode;
  1727.        
  1728.         //we need player to get entities around it to update their stats - if no player then postpone
  1729.         if(!thePlayer)
  1730.         {
  1731.             diffChangePostponed = newDifficulty;
  1732.             return false;
  1733.         }
  1734.        
  1735.         theTelemetry.SetCommonStatI32(CS_DIFFICULTY_LVL, newDifficulty);
  1736.  
  1737.         //update min used difficulty mode if current mode < previous min mode
  1738.         lowestDiff = GetLowestDifficultyUsed();    
  1739.         if(lowestDiff != newDifficulty && MinDiffMode(lowestDiff, newDifficulty) == newDifficulty)
  1740.             SetLowestDifficultyUsed(newDifficulty);
  1741.            
  1742.         UpdateStatsForDifficultyLevel( GetSpawnDifficultyMode() );
  1743.     }
  1744.    
  1745.     //called AFTER player entity has changed to a new actor
  1746.     public function OnPlayerChanged()
  1747.     {
  1748.         var i : int;
  1749.         var buffs : array<CBaseGameplayEffect>;
  1750.         var witcher : W3PlayerWitcher;
  1751.        
  1752.         //remove buffs added when we were previously playing with this character
  1753.         thePlayer.RemoveAllNonAutoBuffs();
  1754.        
  1755.         //force resume all autobuffs
  1756.         buffs = thePlayer.GetBuffs();
  1757.         for(i=0; i<buffs.Size(); i+=1)
  1758.         {
  1759.             buffs[i].ResumeForced();
  1760.         }
  1761.    
  1762.         //we have no destructors so we cannot remove fx when player character is destroyed - hence the hack
  1763.         GetGameCamera().StopEffect( 'frost' );
  1764.         DisableCatViewFx( 1.0f );
  1765.         thePlayer.StopEffect('critical_low_health');
  1766.         DisableDrunkFx();
  1767.         thePlayer.StopEffect('critical_toxicity');
  1768.        
  1769.         if(GetWitcherPlayer())
  1770.             GetWitcherPlayer().UpdateEncumbrance();
  1771.    
  1772.         // Update difficulty on all spawned gameplay entities, as
  1773.         // playing as Ciri we're limited to medium difficulty. 
  1774.         UpdateStatsForDifficultyLevel( GetSpawnDifficultyMode() );
  1775.        
  1776.         //reset timescale to 1.0f
  1777.         RemoveAllTimeScales();
  1778.     }
  1779.    
  1780.     // When the player is using Ciri monsters
  1781.     // should be limited to Medium difficulty.
  1782.     public function GetSpawnDifficultyMode() : EDifficultyMode
  1783.     {
  1784.         if( thePlayer && thePlayer.IsCiri() )
  1785.         {
  1786.             return MinDiffMode( GetDifficultyMode(), EDM_Medium );
  1787.         }
  1788.         return GetDifficultyMode();
  1789.     }
  1790.    
  1791.     public function UpdateStatsForDifficultyLevel( difficulty : EDifficultyMode )
  1792.     {
  1793.         var i : int;
  1794.         var actor : CActor;
  1795.         var npcs : array< CNewNPC >;
  1796.         GetAllNPCs( npcs );
  1797.         for( i=0; i < npcs.Size(); i+=1 )
  1798.         {
  1799.             actor = (CActor)npcs[i];
  1800.             if( actor )
  1801.             {
  1802.                 actor.UpdateStatsForDifficultyLevel( difficulty );
  1803.             }
  1804.         }
  1805.     }
  1806.  
  1807.     public function CanTrackQuest( questEntry : CJournalQuest ) : bool
  1808.     {
  1809.         var questName : string;
  1810.         var baseName : string;
  1811.         var i : int;
  1812.         var questCount : int;
  1813.         var playerLevel : int;
  1814.         var questLevel : int;
  1815.         var questLevels : C2dArray;
  1816.         var questLevelsCount : int;
  1817.         var iterQuestLevels : int;
  1818.        
  1819.         baseName = questEntry.baseName;
  1820.         playerLevel = thePlayer.GetLevel();
  1821.  
  1822.         if ( questEntry.GetType() == MonsterHunt )
  1823.         {
  1824.             questLevelsCount = theGame.questLevelsContainer.Size();
  1825.             for( iterQuestLevels = 0; iterQuestLevels < questLevelsCount; iterQuestLevels += 1 )
  1826.             {
  1827.                 questLevels = theGame.questLevelsContainer[iterQuestLevels];
  1828.             // these questLevels should be in journal
  1829.                 questCount = questLevels.GetNumRows();
  1830.                 for( i = 0; i < questCount; i += 1 )
  1831.                 {
  1832.                         questName  = questLevels.GetValueAtAsName( 0, i );
  1833.                     if ( questName == baseName )
  1834.                     {
  1835.                             questLevel  = NameToInt( questLevels.GetValueAtAsName( 1, i ) );
  1836.                         return playerLevel >= questLevel - 5;
  1837.                     }
  1838.                 }
  1839.             }
  1840.         }
  1841.         return true;
  1842.     }
  1843.    
  1844.     import final function GetGwintManager() : CR4GwintManager;
  1845.    
  1846.     public function IsBlackscreenOrFading() : bool
  1847.     {
  1848.         return IsBlackscreen() || IsFading();
  1849.     }
  1850.        
  1851.     ////////////////////////////////////////////////////////////
  1852.     // "postponed" CPreAttackEvevets - called in "Main" tick
  1853.     ////////////////////////////////////////////////////////////
  1854.  
  1855.     var postponedPreAttackEvents : array< SPostponedPreAttackEvent >;
  1856.    
  1857.     event OnPreAttackEvent( entity : CGameplayEntity, animEventName : name, animEventType : EAnimationEventType, data : CPreAttackEventData, animInfo : SAnimationEventAnimInfo )
  1858.     {
  1859.         var postponedPreAttackEvent : SPostponedPreAttackEvent;
  1860.         var xpKillMult : float; // SXPM
  1861.        
  1862.         postponedPreAttackEvent.entity      = entity;
  1863.         postponedPreAttackEvent.eventName   = animEventName;
  1864.         postponedPreAttackEvent.eventType   = animEventType;
  1865.         postponedPreAttackEvent.data        = data;
  1866.         postponedPreAttackEvent.animInfo    = animInfo;
  1867.        
  1868.         postponedPreAttackEvents.PushBack( postponedPreAttackEvent );
  1869.        
  1870.         // SXPM+
  1871.         xpKillMult = mSXPM.GetxpmultiplierK();
  1872.         SetKillXPMultiplier(xpKillMult);
  1873.         // SXPM-
  1874.     }
  1875.  
  1876.     function FirePostponedPreAttackEvents()
  1877.     {
  1878.         var i, size : int;
  1879.         var entity : CGameplayEntity;
  1880.        
  1881.         size = postponedPreAttackEvents.Size();
  1882.         for ( i = 0; i < size; i+=1 )
  1883.         {
  1884.             entity = postponedPreAttackEvents[i].entity;
  1885.             if ( entity )
  1886.             {
  1887.                 entity.OnPreAttackEvent( postponedPreAttackEvents[i].eventName,
  1888.                                          postponedPreAttackEvents[i].eventType,
  1889.                                          postponedPreAttackEvents[i].data,
  1890.                                          postponedPreAttackEvents[i].animInfo );
  1891.             }
  1892.         }
  1893.         postponedPreAttackEvents.Clear();
  1894.     }
  1895.    
  1896.     public final function AddDynamicallySpawnedBoatHandle(handle : EntityHandle)
  1897.     {
  1898.         var i : int;
  1899.        
  1900.         if(EntityHandleGet(handle))
  1901.         {          
  1902.             dynamicallySpawnedBoats.PushBack(handle);
  1903.            
  1904.             if(dynamicallySpawnedBoats.Size() >= theGame.params.MAX_DYNAMICALLY_SPAWNED_BOATS)
  1905.             {
  1906.                 //check for nulls in array - failsafe (if sth else would destroy boat)
  1907.                 for(i=dynamicallySpawnedBoatsToDestroy.Size()-1; i>=0; i-=1)
  1908.                 {
  1909.                     if(!EntityHandleGet(dynamicallySpawnedBoats[i]))
  1910.                         dynamicallySpawnedBoats.EraseFast(i);
  1911.                 }
  1912.            
  1913.                 if(dynamicallySpawnedBoats.Size() >= theGame.params.MAX_DYNAMICALLY_SPAWNED_BOATS)
  1914.                 {
  1915.                     dynamicallySpawnedBoatsToDestroy.PushBack( dynamicallySpawnedBoats[0] );
  1916.                     dynamicallySpawnedBoats.Erase(0);
  1917.                 }
  1918.             }
  1919.         }
  1920.     }
  1921.    
  1922.     public final function IsBoatMarkedForDestroy(boat : W3Boat) : bool
  1923.     {
  1924.         var handle : EntityHandle;
  1925.         var i : int;
  1926.        
  1927.         EntityHandleSet(handle, boat);
  1928.         for(i=0; i<dynamicallySpawnedBoatsToDestroy.Size(); i+=1)
  1929.         {
  1930.             if(handle == dynamicallySpawnedBoatsToDestroy[i])
  1931.             {
  1932.                 dynamicallySpawnedBoatsToDestroy.EraseFast(i);
  1933.                 return true;
  1934.             }
  1935.         }
  1936.        
  1937.         return false;
  1938.     }
  1939.  
  1940.     public final function VibrateControllerVeryLight(optional duration : float)
  1941.     {
  1942.         if ( !theInput.LastUsedGamepad() )
  1943.             return;
  1944.            
  1945.         if(duration == 0)
  1946.             duration = 0.15f;
  1947.            
  1948.         if(IsSpecificRumbleActive(0.2, 0))
  1949.         {
  1950.             OverrideRumbleDuration(0.2, 0, duration);
  1951.         }
  1952.         else
  1953.         {
  1954.             VibrateController(0.2, 0, duration);
  1955.         }
  1956.     }
  1957.    
  1958.     public final function VibrateControllerLight(optional duration : float)
  1959.     {
  1960.         if ( !theInput.LastUsedGamepad() )
  1961.             return;
  1962.            
  1963.         if(duration == 0)
  1964.             duration = 0.2f;
  1965.            
  1966.         if(IsSpecificRumbleActive(0.5, 0))
  1967.         {
  1968.             OverrideRumbleDuration(0.5, 0, duration);
  1969.         }
  1970.         else
  1971.         {
  1972.             VibrateController(0.5, 0, duration);
  1973.         }
  1974.     }
  1975.    
  1976.     public final function VibrateControllerHard(optional duration : float)
  1977.     {
  1978.         if ( !theInput.LastUsedGamepad() )
  1979.             return;
  1980.            
  1981.         if(duration == 0)
  1982.             duration = 0.2f;
  1983.        
  1984.         if(IsSpecificRumbleActive(0.75, 0.75))
  1985.         {
  1986.             OverrideRumbleDuration(0.75, 0.75, duration);
  1987.         }
  1988.         else
  1989.         {
  1990.             VibrateController(0.75, 0.75, duration);
  1991.         }
  1992.     }
  1993.    
  1994.     public final function VibrateControllerVeryHard(optional duration : float)
  1995.     {
  1996.         if ( !theInput.LastUsedGamepad() )
  1997.             return;
  1998.            
  1999.         if(duration == 0)
  2000.             duration = 0.5f;
  2001.        
  2002.         if(IsSpecificRumbleActive(1, 1))
  2003.         {
  2004.             OverrideRumbleDuration(1, 1, duration);
  2005.         }
  2006.         else
  2007.         {
  2008.             VibrateController(1, 1, duration);
  2009.         }
  2010.     }
  2011.     import public final function GetWorldDLCExtender() : CR4WorldDLCExtender;
  2012.    
  2013.     public function GetMiniMapSize( areaType : int ) : float
  2014.     {
  2015.         var mapSize  : float;
  2016.         var valueAsString : string;
  2017.        
  2018.         valueAsString = minimapSettings.GetValueAt( 1, areaType );
  2019.        
  2020.         if( StrLen( valueAsString ) != 0 )
  2021.         {
  2022.             mapSize = StringToFloat( valueAsString );
  2023.         }
  2024.         else
  2025.         {
  2026.             mapSize = GetWorldDLCExtender().GetMiniMapSize( areaType );
  2027.         }
  2028.         return mapSize;
  2029.     }
  2030.    
  2031.     public function GetMiniMapTileCount( areaType : int ) : int
  2032.     {
  2033.         var tileCount  : int;
  2034.         var valueAsString : string;
  2035.        
  2036.         valueAsString = minimapSettings.GetValueAt( 2, areaType );
  2037.        
  2038.         if( StrLen( valueAsString ) != 0 )
  2039.         {
  2040.             tileCount = StringToInt( valueAsString );
  2041.         }
  2042.         else
  2043.         {
  2044.             tileCount = GetWorldDLCExtender().GetMiniMapTileCount( areaType );
  2045.         }
  2046.         return tileCount;
  2047.     }
  2048.    
  2049.     public function GetMiniMapExteriorTextureSize( areaType : int ) : int
  2050.     {
  2051.         var exteriorTextureSize  : int;
  2052.         var valueAsString : string;
  2053.        
  2054.         valueAsString = minimapSettings.GetValueAt( 3, areaType );
  2055.        
  2056.         if( StrLen( valueAsString ) != 0 )
  2057.         {
  2058.             exteriorTextureSize = StringToInt( valueAsString );
  2059.         }
  2060.         else
  2061.         {
  2062.             exteriorTextureSize = GetWorldDLCExtender().GetMiniMapExteriorTextureSize( areaType );
  2063.         }
  2064.         return exteriorTextureSize;
  2065.     }
  2066.    
  2067.        
  2068.     public function GetMiniMapInteriorTextureSize( areaType : int ) : int
  2069.     {
  2070.         var interiorTextureSize  : int;
  2071.         var valueAsString : string;
  2072.        
  2073.         valueAsString = minimapSettings.GetValueAt( 4, areaType );
  2074.        
  2075.         if( StrLen( valueAsString ) != 0 )
  2076.         {
  2077.             interiorTextureSize = StringToInt( valueAsString );
  2078.         }
  2079.         else
  2080.         {
  2081.             interiorTextureSize = GetWorldDLCExtender().GetMiniMapInteriorTextureSize( areaType );
  2082.         }
  2083.         return interiorTextureSize;
  2084.     }
  2085.    
  2086.     public function GetMiniMapTextureSize( areaType : int ) : int
  2087.     {
  2088.         var textureSize  : int;
  2089.         var valueAsString : string;
  2090.        
  2091.         valueAsString = minimapSettings.GetValueAt( 5, areaType );
  2092.        
  2093.         if( StrLen( valueAsString ) != 0 )
  2094.         {
  2095.             textureSize = StringToInt( valueAsString );
  2096.         }
  2097.         else
  2098.         {
  2099.             textureSize = GetWorldDLCExtender().GetMiniMapTextureSize( areaType );
  2100.         }
  2101.         return textureSize;
  2102.     }
  2103.    
  2104.     public function GetMiniMapMinLod( areaType : int ) : int
  2105.     {
  2106.         var minLod  : int;
  2107.         var valueAsString : string;
  2108.        
  2109.         valueAsString = minimapSettings.GetValueAt( 6, areaType );
  2110.        
  2111.         if( StrLen( valueAsString ) != 0 )
  2112.         {
  2113.             minLod = StringToInt( valueAsString );
  2114.         }
  2115.         else
  2116.         {
  2117.             minLod = GetWorldDLCExtender().GetMiniMapMinLod( areaType );
  2118.         }
  2119.         return minLod;
  2120.     }
  2121.    
  2122.     public function GetMiniMapMaxLod( areaType : int ) : int
  2123.     {
  2124.         var maxLod  : int;
  2125.         var valueAsString : string;
  2126.        
  2127.         valueAsString = minimapSettings.GetValueAt( 7, areaType );
  2128.        
  2129.         if( StrLen( valueAsString ) != 0 )
  2130.         {
  2131.             maxLod = StringToInt( valueAsString );
  2132.         }
  2133.         else
  2134.         {
  2135.             maxLod = GetWorldDLCExtender().GetMiniMapMaxLod( areaType );
  2136.         }
  2137.         return maxLod;
  2138.     }
  2139.  
  2140.     public function GetMiniMapExteriorTextureExtension( areaType : int ) : string
  2141.     {
  2142.         var exteriorTextureExtension  : string;
  2143.         var valueAsString : string;
  2144.        
  2145.         valueAsString = minimapSettings.GetValueAt( 8, areaType );
  2146.        
  2147.         if( StrLen( valueAsString ) != 0 )
  2148.         {
  2149.             exteriorTextureExtension = ExtractStringFromCSV( valueAsString );
  2150.         }
  2151.         else
  2152.         {
  2153.             exteriorTextureExtension = GetWorldDLCExtender().GetMiniMapExteriorTextureExtension( areaType );
  2154.         }
  2155.         return exteriorTextureExtension;
  2156.     }
  2157.    
  2158.     public function GetMiniMapInteriorTextureExtension( areaType : int ) : string
  2159.     {
  2160.         var interiorTextureExtension  : string;
  2161.         var valueAsString : string;
  2162.        
  2163.         valueAsString = minimapSettings.GetValueAt( 9, areaType );
  2164.        
  2165.         if( StrLen( valueAsString ) != 0 )
  2166.         {
  2167.             interiorTextureExtension = ExtractStringFromCSV( valueAsString );
  2168.         }
  2169.         else
  2170.         {
  2171.             interiorTextureExtension = GetWorldDLCExtender().GetMiniMapInteriorTextureExtension( areaType );
  2172.         }
  2173.         return interiorTextureExtension;
  2174.     }
  2175.    
  2176.     public function GetMiniMapVminX( areaType : int ) : int
  2177.     {
  2178.         var vminX  : int;
  2179.         var valueAsString : string;
  2180.        
  2181.         valueAsString = minimapSettings.GetValueAt( 11, areaType );
  2182.        
  2183.         if( StrLen( valueAsString ) != 0 )
  2184.         {
  2185.             vminX = StringToInt( valueAsString );
  2186.         }
  2187.         else
  2188.         {
  2189.             vminX = GetWorldDLCExtender().GetMiniMapVminX( areaType );
  2190.         }
  2191.         return vminX;
  2192.     }
  2193.    
  2194.     public function GetMiniMapVmaxX( areaType : int ) : int
  2195.     {
  2196.         var vmaxX  : int;
  2197.         var valueAsString : string;
  2198.        
  2199.         valueAsString = minimapSettings.GetValueAt( 12, areaType );
  2200.        
  2201.         if( StrLen( valueAsString ) != 0 )
  2202.         {
  2203.             vmaxX = StringToInt( valueAsString );
  2204.         }
  2205.         else
  2206.         {
  2207.             vmaxX = GetWorldDLCExtender().GetMiniMapVmaxX( areaType );
  2208.         }
  2209.         return vmaxX;
  2210.     }
  2211.    
  2212.     public function GetMiniMapVminY( areaType : int ) : int
  2213.     {
  2214.         var vminY  : int;
  2215.         var valueAsString : string;
  2216.        
  2217.         valueAsString = minimapSettings.GetValueAt( 13, areaType );
  2218.        
  2219.         if( StrLen( valueAsString ) != 0 )
  2220.         {
  2221.             vminY = StringToInt( valueAsString );
  2222.         }
  2223.         else
  2224.         {
  2225.             vminY = GetWorldDLCExtender().GetMiniMapVminY( areaType );
  2226.         }
  2227.         return vminY;
  2228.     }
  2229.    
  2230.     public function GetMiniMapVmaxY( areaType : int ) : int
  2231.     {
  2232.         var vmaxY  : int;
  2233.         var valueAsString : string;
  2234.        
  2235.         valueAsString = minimapSettings.GetValueAt( 14, areaType );
  2236.        
  2237.         if( StrLen( valueAsString ) != 0 )
  2238.         {
  2239.             vmaxY = StringToInt( valueAsString );
  2240.         }
  2241.         else
  2242.         {
  2243.             vmaxY = GetWorldDLCExtender().GetMiniMapVmaxY( areaType );
  2244.         }
  2245.         return vmaxY;
  2246.     }
  2247.    
  2248.     public function GetMiniMapSminX( areaType : int ) : int
  2249.     {
  2250.         var sminX  : int;
  2251.         var valueAsString : string;
  2252.        
  2253.         valueAsString = minimapSettings.GetValueAt( 15, areaType );
  2254.        
  2255.         if( StrLen( valueAsString ) != 0 )
  2256.         {
  2257.             sminX = StringToInt( valueAsString );
  2258.         }
  2259.         else
  2260.         {
  2261.             sminX = GetWorldDLCExtender().GetMiniMapSminX( areaType );
  2262.         }
  2263.         return sminX;
  2264.     }
  2265.    
  2266.     public function GetMiniMapSmaxX( areaType : int ) : int
  2267.     {
  2268.         var smaxX  : int;
  2269.         var valueAsString : string;
  2270.        
  2271.         valueAsString = minimapSettings.GetValueAt( 16, areaType );
  2272.        
  2273.         if( StrLen( valueAsString ) != 0 )
  2274.         {
  2275.             smaxX = StringToInt( valueAsString );
  2276.         }
  2277.         else
  2278.         {
  2279.             smaxX = GetWorldDLCExtender().GetMiniMapSmaxX( areaType );
  2280.         }
  2281.         return smaxX;
  2282.     }
  2283.    
  2284.     public function GetMiniMapSminY( areaType : int ) : int
  2285.     {
  2286.         var sminY  : int;
  2287.         var valueAsString : string;
  2288.        
  2289.         valueAsString = minimapSettings.GetValueAt( 17, areaType );
  2290.        
  2291.         if( StrLen( valueAsString ) != 0 )
  2292.         {
  2293.             sminY = StringToInt( valueAsString );
  2294.         }
  2295.         else
  2296.         {
  2297.             sminY = GetWorldDLCExtender().GetMiniMapSminY( areaType );
  2298.         }
  2299.         return sminY;
  2300.     }
  2301.    
  2302.     public function GetMiniMapSmaxY( areaType : int ) : int
  2303.     {
  2304.         var smaxY  : int;
  2305.         var valueAsString : string;
  2306.        
  2307.         valueAsString = minimapSettings.GetValueAt( 18, areaType );
  2308.        
  2309.         if( StrLen( valueAsString ) != 0 )
  2310.         {
  2311.             smaxY = StringToInt( valueAsString );
  2312.         }
  2313.         else
  2314.         {
  2315.             smaxY = GetWorldDLCExtender().GetMiniMapSmaxY( areaType );
  2316.         }
  2317.         return smaxY;
  2318.     }
  2319.    
  2320.     public function GetMiniMapMinZoom( areaType : int ) : float
  2321.     {
  2322.         var minZoom  : float;
  2323.         var valueAsString : string;
  2324.        
  2325.         valueAsString = minimapSettings.GetValueAt( 19, areaType );
  2326.        
  2327.         if( StrLen( valueAsString ) != 0 )
  2328.         {
  2329.             minZoom = StringToFloat( valueAsString );
  2330.         }
  2331.         else
  2332.         {
  2333.             minZoom = GetWorldDLCExtender().GetMiniMapMinZoom( areaType );
  2334.         }
  2335.         return minZoom;
  2336.     }
  2337.    
  2338.     public function GetMiniMapMaxZoom( areaType : int ) : float
  2339.     {
  2340.         var maxZoom  : float;
  2341.         var valueAsString : string;
  2342.        
  2343.         valueAsString = minimapSettings.GetValueAt( 20, areaType );
  2344.        
  2345.         if( StrLen( valueAsString ) != 0 )
  2346.         {
  2347.             maxZoom = StringToFloat( valueAsString );
  2348.         }
  2349.         else
  2350.         {
  2351.             maxZoom = GetWorldDLCExtender().GetMiniMapMaxZoom( areaType );
  2352.         }
  2353.         return maxZoom;
  2354.     }
  2355.    
  2356.     public function GetMiniMapZoom12( areaType : int ) : float
  2357.     {
  2358.         var zoom12  : float;
  2359.         var valueAsString : string;
  2360.        
  2361.         valueAsString = minimapSettings.GetValueAt( 21, areaType );
  2362.        
  2363.         if( StrLen( valueAsString ) != 0 )
  2364.         {
  2365.             zoom12 = StringToFloat( valueAsString );
  2366.         }
  2367.         else
  2368.         {
  2369.             zoom12 = GetWorldDLCExtender().GetMiniMapZoom12( areaType );
  2370.         }
  2371.         return zoom12;
  2372.     }
  2373.    
  2374.     public function GetMiniMapZoom23( areaType : int ) : float
  2375.     {
  2376.         var zoom23  : float;
  2377.         var valueAsString : string;
  2378.        
  2379.         valueAsString = minimapSettings.GetValueAt( 22, areaType );
  2380.        
  2381.         if( StrLen( valueAsString ) != 0 )
  2382.         {
  2383.             zoom23 = StringToFloat( valueAsString );
  2384.         }
  2385.         else
  2386.         {
  2387.             zoom23 = GetWorldDLCExtender().GetMiniMapZoom23( areaType );
  2388.         }
  2389.         return zoom23;
  2390.     }
  2391.    
  2392.     public function GetMiniMapZoom34( areaType : int ) : float
  2393.     {
  2394.         var zoom34  : float;
  2395.         var valueAsString : string;
  2396.        
  2397.         valueAsString = minimapSettings.GetValueAt( 23, areaType );
  2398.        
  2399.         if( StrLen( valueAsString ) != 0 )
  2400.         {
  2401.             zoom34 = StringToFloat( valueAsString );
  2402.         }
  2403.         else
  2404.         {
  2405.             zoom34 = GetWorldDLCExtender().GetMiniMapZoom34( areaType );
  2406.         }
  2407.         return zoom34;
  2408.     }
  2409.    
  2410.     public function GetGradientScale( areaType : int ) : float
  2411.     {
  2412.         var scale  : float;
  2413.         var valueAsString : string;
  2414.        
  2415.         valueAsString = minimapSettings.GetValueAt( 24, areaType );
  2416.        
  2417.         if( StrLen( valueAsString ) != 0 )
  2418.         {
  2419.             scale = StringToFloat( valueAsString );
  2420.         }
  2421.         else
  2422.         {
  2423.             scale = GetWorldDLCExtender().GetGradientScale( areaType );
  2424.         }
  2425.         return scale;
  2426.     }
  2427.    
  2428.     public function GetPreviewHeight( areaType : int ) : float
  2429.     {
  2430.         var height  : float;
  2431.         var valueAsString : string;
  2432.        
  2433.         valueAsString = minimapSettings.GetValueAt( 25, areaType );
  2434.        
  2435.         if( StrLen( valueAsString ) != 0 )
  2436.         {
  2437.             height = StringToFloat( valueAsString );
  2438.         }
  2439.         else
  2440.         {
  2441.             height = GetWorldDLCExtender().GetPreviewHeight( areaType );
  2442.         }
  2443.         return height;
  2444.     }
  2445.  
  2446.     private function UnlockMissedAchievements()
  2447.     {
  2448.         var manager : CCommonMapManager = theGame.GetCommonMapManager();   
  2449.         if ( manager )
  2450.         {
  2451.             manager.CheckExplorerAchievement();
  2452.         }
  2453.  
  2454.         GetWitcherPlayer().CheckForFullyArmedAchievement();
  2455.         GetGamerProfile().CheckProgressOfAllStats();
  2456.         if (FactsDoesExist("witcher3_game_finished"))
  2457.         {
  2458.             Achievement_FinishedGame();
  2459.         }
  2460.     }
  2461.    
  2462.     public final function MutationHUDFeedback( type : EMutationFeedbackType )
  2463.     {
  2464.         var hud : CR4ScriptedHud;
  2465.         var hudWolfHeadModule : CR4HudModuleWolfHead;      
  2466.  
  2467.         hud = (CR4ScriptedHud)GetHud();
  2468.         if ( hud )
  2469.         {
  2470.             hudWolfHeadModule = (CR4HudModuleWolfHead)hud.GetHudModule( "WolfHeadModule" );
  2471.             if ( hudWolfHeadModule )
  2472.             {
  2473.                 hudWolfHeadModule.DisplayMutationFeedback( type );
  2474.             }
  2475.         }
  2476.     }
  2477. }
  2478.  
  2479. function hasSaveDataToLoad():bool
  2480. {
  2481.     var currentSave : SSavegameInfo;
  2482.     var saveGames   : array< SSavegameInfo >;
  2483.    
  2484.     theGame.ListSavedGames( saveGames );
  2485.     if ( saveGames.Size() > 0 )
  2486.     {
  2487.         return true;
  2488.     }
  2489.    
  2490.     return false;
  2491. }
  2492.  
  2493. exec function EnableLog( enable : bool )
  2494. {
  2495.     theGame.EnableLog( enable );
  2496. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement