Advertisement
Guest User

r4game issue

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