Advertisement
Guest User

Untitled

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