Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 83.78 KB | None | 0 0
  1. /***********************************************************************/
  2. /** Copyright © 2013-2014
  3. /** Author : Tomasz Czarny
  4. /** Tomek Kozera
  5. /** Marwin So
  6. /***********************************************************************/
  7.  
  8. class CPlayerInput
  9. {
  10. private saved var actionLocks : array<array<SInputActionLock>>; //locks for actions
  11.  
  12. private var totalCameraPresetChange : float; default totalCameraPresetChange = 0.0f;
  13. private var potAction : SInputAction;
  14. private var potPress : bool;
  15. private var debugBlockSourceName : name; default debugBlockSourceName = 'PLAYER';
  16. private var holdFastMenuInvoked : bool; default holdFastMenuInvoked = false; //to handle touchpad press/hold releases
  17. private var potionUpperHeld, potionLowerHeld : bool; //set when potion switch button is being held
  18. private var potionModeHold : bool; //set when potion switching mode is set to Hold
  19.  
  20. default potionModeHold = true;
  21.  
  22. public function Initialize(isFromLoad : bool, optional previousInput : CPlayerInput)
  23. {
  24. var missingLocksCount, i : int;
  25. var dummy : array<SInputActionLock>;
  26.  
  27. if(previousInput)
  28. {
  29. actionLocks = previousInput.actionLocks;
  30. }
  31. else
  32. {
  33. if(!isFromLoad)
  34. {
  35. actionLocks.Grow(EnumGetMax('EInputActionBlock')+1);
  36. }
  37. else
  38. {
  39. missingLocksCount = EnumGetMax('EInputActionBlock') + 1 - actionLocks.Size();
  40. for ( i = 0; i < missingLocksCount; i += 1 )
  41. {
  42. actionLocks.PushBack( dummy );
  43. }
  44. }
  45. }
  46.  
  47. theInput.RegisterListener( this, 'OnCommSprint', 'Sprint' );
  48. theInput.RegisterListener( this, 'OnCommSprintToggle', 'SprintToggle' );
  49. theInput.RegisterListener( this, 'OnCommWalkToggle', 'WalkToggle' );
  50. theInput.RegisterListener( this, 'OnCommGuard', 'Guard' );
  51.  
  52. // horse
  53. theInput.RegisterListener( this, 'OnCommSpawnHorse', 'SpawnHorse' );
  54.  
  55. //potions
  56. //theInput.RegisterListener( this, 'OnCommDrinkPot', 'DrinkPotion' ); -not used anymore, handles one on tap and second on double tap
  57. theInput.RegisterListener( this, 'OnCommDrinkPotion1', 'DrinkPotion1' );
  58. theInput.RegisterListener( this, 'OnCommDrinkPotion2', 'DrinkPotion2' );
  59. theInput.RegisterListener( this, 'OnCommDrinkPotion3', 'DrinkPotion3' );
  60. theInput.RegisterListener( this, 'OnCommDrinkPotion4', 'DrinkPotion4' );
  61. theInput.RegisterListener( this, 'OnCommDrinkpotionUpperHeld', 'DrinkPotionUpperHold' );
  62. theInput.RegisterListener( this, 'OnCommDrinkpotionLowerHeld', 'DrinkPotionLowerHold' );
  63.  
  64. //weapon draw/sheathe
  65. theInput.RegisterListener( this, 'OnCommSteelSword', 'SteelSword' );
  66. theInput.RegisterListener( this, 'OnCommSilverSword', 'SilverSword' );
  67. theInput.RegisterListener( this, 'OnCommSheatheAny', 'SwordSheathe' );
  68. theInput.RegisterListener( this, 'OnCommSheatheSilver', 'SwordSheatheSilver' );
  69. theInput.RegisterListener( this, 'OnCommSheatheSteel', 'SwordSheatheSteel' );
  70.  
  71. theInput.RegisterListener( this, 'OnToggleSigns', 'ToggleSigns' );
  72. theInput.RegisterListener( this, 'OnSelectSign', 'SelectAard' );
  73. theInput.RegisterListener( this, 'OnSelectSign', 'SelectYrden' );
  74. theInput.RegisterListener( this, 'OnSelectSign', 'SelectIgni' );
  75. theInput.RegisterListener( this, 'OnSelectSign', 'SelectQuen' );
  76. theInput.RegisterListener( this, 'OnSelectSign', 'SelectAxii' );
  77.  
  78.  
  79. //character panels
  80. theInput.RegisterListener( this, 'OnCommDeckEditor', 'PanelGwintDeckEditor' );
  81. theInput.RegisterListener( this, 'OnCommMenuHub', 'HubMenu' );
  82. theInput.RegisterListener( this, 'OnCommPanelInv', 'PanelInv' );
  83. theInput.RegisterListener( this, 'OnCommHoldFastMenu', 'HoldFastMenu' );
  84. theInput.RegisterListener( this, 'OnCommPanelChar', 'PanelChar' );
  85. theInput.RegisterListener( this, 'OnCommPanelMed', 'PanelMed' );
  86. theInput.RegisterListener( this, 'OnCommPanelMap', 'PanelMap' );
  87. theInput.RegisterListener( this, 'OnCommPanelMapPC', 'PanelMapPC' );
  88. theInput.RegisterListener( this, 'OnCommPanelJour', 'PanelJour' );
  89. theInput.RegisterListener( this, 'OnCommPanelAlch', 'PanelAlch' );
  90. theInput.RegisterListener( this, 'OnCommPanelGlossary', 'PanelGlossary' );
  91. theInput.RegisterListener( this, 'OnCommPanelBestiary', 'PanelBestiary' );
  92. theInput.RegisterListener( this, 'OnCommPanelMeditation', 'PanelMeditation' );
  93. theInput.RegisterListener( this, 'OnCommPanelCrafting', 'PanelCrafting' );
  94. theInput.RegisterListener( this, 'OnShowControlsHelp', 'ControlsHelp' );
  95. theInput.RegisterListener( this, 'OnCommPanelUIResize', 'PanelUIResize' );
  96.  
  97. theInput.RegisterListener( this, 'OnCastSign', 'CastSign' );
  98. theInput.RegisterListener( this, 'OnExpFocus', 'Focus' );
  99. theInput.RegisterListener( this, 'OnExpMedallion', 'Medallion' );
  100.  
  101. //boat
  102. theInput.RegisterListener( this, 'OnBoatDismount', 'BoatDismount' );
  103.  
  104. theInput.RegisterListener( this, 'OnDiving', 'DiveDown' );
  105. theInput.RegisterListener( this, 'OnDiving', 'DiveUp' );
  106. theInput.RegisterListener( this, 'OnDivingDodge', 'DiveDodge' );
  107.  
  108. // PC only
  109. theInput.RegisterListener( this, 'OnCbtSpecialAttackWithAlternateLight', 'SpecialAttackWithAlternateLight' );
  110. theInput.RegisterListener( this, 'OnCbtSpecialAttackWithAlternateHeavy', 'SpecialAttackWithAlternateHeavy' );
  111. theInput.RegisterListener( this, 'OnCbtAttackWithAlternateLight', 'AttackWithAlternateLight' );
  112. theInput.RegisterListener( this, 'OnCbtAttackWithAlternateHeavy', 'AttackWithAlternateHeavy' );
  113.  
  114. theInput.RegisterListener( this, 'OnCbtAttackLight', 'AttackLight' );
  115. theInput.RegisterListener( this, 'OnCbtAttackHeavy', 'AttackHeavy' );
  116. theInput.RegisterListener( this, 'OnCbtSpecialAttackLight', 'SpecialAttackLight' );
  117. theInput.RegisterListener( this, 'OnCbtSpecialAttackHeavy', 'SpecialAttackHeavy' );
  118. theInput.RegisterListener( this, 'OnCbtDodge', 'Dodge' );
  119. theInput.RegisterListener( this, 'OnCbtRoll', 'CbtRoll' );
  120. theInput.RegisterListener( this, 'OnMovementDoubleTap', 'MovementDoubleTapW' );
  121. theInput.RegisterListener( this, 'OnMovementDoubleTap', 'MovementDoubleTapS' );
  122. theInput.RegisterListener( this, 'OnMovementDoubleTap', 'MovementDoubleTapA' );
  123. theInput.RegisterListener( this, 'OnMovementDoubleTap', 'MovementDoubleTapD' );
  124. theInput.RegisterListener( this, 'OnCbtLockAndGuard', 'LockAndGuard' );
  125. theInput.RegisterListener( this, 'OnCbtCameraLockOrSpawnHorse', 'CameraLockOrSpawnHorse' );
  126. theInput.RegisterListener( this, 'OnCbtCameraLock', 'CameraLock' );
  127. theInput.RegisterListener( this, 'OnCbtComboDigitLeft', 'ComboDigitLeft' );
  128. theInput.RegisterListener( this, 'OnCbtComboDigitRight', 'ComboDigitRight' );
  129.  
  130.  
  131. // Ciri
  132. theInput.RegisterListener( this, 'OnCbtCiriSpecialAttack', 'CiriSpecialAttack' );
  133. theInput.RegisterListener( this, 'OnCbtCiriAttackHeavy', 'CiriAttackHeavy' );
  134. theInput.RegisterListener( this, 'OnCbtCiriSpecialAttackHeavy', 'CiriSpecialAttackHeavy' );
  135. theInput.RegisterListener( this, 'OnCbtCiriDodge', 'CiriDodge' );
  136. theInput.RegisterListener( this, 'OnCbtCiriDash', 'CiriDash' );
  137.  
  138. //throwing items, casting signs
  139. theInput.RegisterListener( this, 'OnCbtThrowItem', 'ThrowItem' );
  140. theInput.RegisterListener( this, 'OnCbtThrowItemHold', 'ThrowItemHold' );
  141. theInput.RegisterListener( this, 'OnCbtThrowCastAbort', 'ThrowCastAbort' );
  142.  
  143. //replacer only
  144. theInput.RegisterListener( this, 'OnCiriDrawWeapon', 'CiriDrawWeapon' );
  145. theInput.RegisterListener( this, 'OnCiriDrawWeapon', 'CiriDrawWeaponAlternative' );
  146. theInput.RegisterListener( this, 'OnCiriHolsterWeapon', 'CiriHolsterWeapon' );
  147. // PN
  148. theInput.RegisterListener( this, 'OnPNToggleHud', 'PNToggleHud');
  149. theInput.RegisterListener( this, 'OnPNPee', 'PNPee');
  150. theInput.RegisterListener( this, 'OnPNPoop', 'PNPoop');
  151. theInput.RegisterListener( this, 'OnPNDrinkShallowWater', 'PNDrinkWater');
  152. // PN
  153.  
  154. //debug
  155. if( !theGame.IsFinalBuild() )
  156. {
  157. theInput.RegisterListener( this, 'OnDbgSpeedUp', 'Debug_SpeedUp' );
  158. theInput.RegisterListener( this, 'OnDbgHit', 'Debug_Hit' );
  159. theInput.RegisterListener( this, 'OnDbgKillTarget', 'Debug_KillTarget' );
  160. theInput.RegisterListener( this, 'OnDbgKillAll', 'Debug_KillAllEnemies' );
  161. theInput.RegisterListener( this, 'OnDbgKillAllTargetingPlayer', 'Debug_KillAllTargetingPlayer' );
  162. theInput.RegisterListener( this, 'OnCommPanelFakeHud', 'PanelFakeHud' );
  163. theInput.RegisterListener( this, 'OnDbgTeleportToPin', 'Debug_TeleportToPin' );
  164. }
  165.  
  166. // other
  167. theInput.RegisterListener( this, 'OnChangeCameraPreset', 'CameraPreset' );
  168. theInput.RegisterListener( this, 'OnChangeCameraPresetByMouseWheel', 'CameraPresetByMouseWheel' );
  169. theInput.RegisterListener( this, 'OnMeditationAbort', 'MeditationAbort');
  170.  
  171. theInput.RegisterListener( this, 'OnFastMenu', 'FastMenu' );
  172. theInput.RegisterListener( this, 'OnIngameMenu', 'IngameMenu' );
  173.  
  174. theInput.RegisterListener( this, 'OnToggleHud', 'ToggleHud' );
  175.  
  176. // AutoLoot mod added
  177. theInput.RegisterListener( this, 'OnAutoLootRadiusLoot', 'AutoLootRadius' );
  178. }
  179.  
  180. // curently unused
  181. function Destroy()
  182. {
  183. }
  184.  
  185. ///////////////////////////
  186. // Action blocking
  187. ///////////////////////////
  188.  
  189. public function FindActionLockIndex(action : EInputActionBlock, sourceName : name) : int
  190. {
  191. var i : int;
  192.  
  193. for(i=0; i<actionLocks[action].Size(); i+=1)
  194. if(actionLocks[action][i].sourceName == sourceName)
  195. return i;
  196.  
  197. return -1;
  198. }
  199.  
  200. // function to (un)block given input actions
  201. public function BlockAction(action : EInputActionBlock, sourceName : name, lock : bool, optional keepOnSpawn : bool, optional onSpawnedNullPointerHackFix : CPlayer, optional isFromQuest : bool, optional isFromPlace : bool)
  202. {
  203. var index : int;
  204. var isLocked, wasLocked : bool;
  205. var actionLock : SInputActionLock;
  206.  
  207. if (action == EIAB_HighlightObjective)
  208. {
  209. index = FindActionLockIndex(action, sourceName);
  210. }
  211.  
  212. index = FindActionLockIndex(action, sourceName);
  213.  
  214. wasLocked = (actionLocks[action].Size() > 0);
  215.  
  216. if(lock)
  217. {
  218. if(index != -1)
  219. return;
  220.  
  221. actionLock.sourceName = sourceName;
  222. actionLock.removedOnSpawn = !keepOnSpawn;
  223. actionLock.isFromQuest = isFromQuest;
  224. actionLock.isFromPlace = isFromPlace;
  225.  
  226. actionLocks[action].PushBack(actionLock);
  227. }
  228. else
  229. {
  230. if(index == -1)
  231. return;
  232.  
  233. actionLocks[action].Erase(index);
  234. }
  235.  
  236. isLocked = (actionLocks[action].Size() > 0);
  237. if(isLocked != wasLocked)
  238. OnActionLockChanged(action, isLocked, sourceName, onSpawnedNullPointerHackFix);
  239. }
  240.  
  241. //For toxic gas tutorial - we MUST open radial then so ALL locks are released
  242. public final function TutorialForceUnblockRadial() : array<SInputActionLock>
  243. {
  244. var ret : array<SInputActionLock>;
  245.  
  246. ret = actionLocks[EIAB_RadialMenu];
  247.  
  248. actionLocks[EIAB_RadialMenu].Clear();
  249.  
  250. thePlayer.SetBIsInputAllowed(true, '');
  251.  
  252. BlockAction( EIAB_Signs, 'ToxicGasTutorial', true, true, NULL, false);
  253.  
  254. return ret;
  255. }
  256.  
  257. //Toxic tutorial restoring of radial open locks
  258. public final function TutorialForceRestoreRadialLocks(radialLocks : array<SInputActionLock>)
  259. {
  260. actionLocks[EIAB_RadialMenu] = radialLocks;
  261. thePlayer.UnblockAction(EIAB_Signs, 'ToxicGasTutorial' );
  262. }
  263.  
  264. private function OnActionLockChanged(action : EInputActionBlock, locked : bool, optional sourceName : name, optional onSpawnedNullPointerHackFix : CPlayer)
  265. {
  266. var player : CPlayer;
  267. var lockType : EPlayerInteractionLock;
  268. var hud : CR4ScriptedHud;
  269. var guiManager : CR4GuiManager;
  270. var rootMenu : CR4MenuBase;
  271.  
  272. // ED: Submited this to catch unknown blocking sources
  273. if( sourceName == debugBlockSourceName )
  274. {
  275. // Put a breakpoint here:
  276. sourceName = sourceName;
  277. }
  278.  
  279. //custom stuff
  280. if(action == EIAB_FastTravel)
  281. {
  282. theGame.GetCommonMapManager().EnableFastTravelling(!locked);
  283. }
  284. else if(action == EIAB_Interactions)
  285. {
  286. //set lock flag
  287. if(sourceName == 'InsideCombatAction')
  288. lockType = PIL_CombatAction;
  289. else
  290. lockType = PIL_Default;
  291.  
  292. if(!thePlayer)
  293. player = onSpawnedNullPointerHackFix;
  294. else
  295. player = thePlayer;
  296.  
  297. if(player)
  298. {
  299. if(locked)
  300. player.LockButtonInteractions(lockType);
  301. else
  302. player.UnlockButtonInteractions(lockType);
  303. }
  304.  
  305. //update interactions after flag change
  306. hud = (CR4ScriptedHud)theGame.GetHud();
  307. if ( hud )
  308. {
  309. hud.ForceInteractionUpdate();
  310. }
  311. }
  312. else if(action == EIAB_Movement && locked && thePlayer) //no thePlayer on session start
  313. {
  314. //if we block movement then force Idle state, unless you are in air (jumping) - in that case wait for touch down and then force it
  315. if(thePlayer.IsUsingVehicle() && thePlayer.GetCurrentStateName() == 'HorseRiding')
  316. {
  317. ((CActor)thePlayer.GetUsedVehicle()).GetMovingAgentComponent().ResetMoveRequests();
  318. thePlayer.GetUsedVehicle().SetBehaviorVariable( '2idle', 1);
  319.  
  320. thePlayer.SetBehaviorVariable( 'speed', 0);
  321. thePlayer.SetBehaviorVariable( '2idle', 1);
  322. }
  323. else if(!thePlayer.IsInAir())
  324. {
  325. thePlayer.RaiseForceEvent( 'Idle' );
  326. }
  327. }
  328. else if (action == EIAB_DismountVehicle)
  329. {
  330. guiManager = theGame.GetGuiManager();
  331.  
  332. if (guiManager)
  333. {
  334. guiManager.UpdateDismountAvailable(locked);
  335. }
  336. }
  337. else if (action == EIAB_OpenPreparation || action == EIAB_OpenMap || action == EIAB_OpenInventory ||
  338. action == EIAB_OpenJournal || action == EIAB_OpenCharacterPanel || action == EIAB_OpenGlossary ||
  339. action == EIAB_OpenAlchemy || action == EIAB_MeditationWaiting || action == EIAB_OpenMeditation)
  340. {
  341. guiManager = theGame.GetGuiManager();
  342.  
  343. if (guiManager && guiManager.IsAnyMenu())
  344. {
  345. rootMenu = (CR4MenuBase)guiManager.GetRootMenu();
  346.  
  347. if (rootMenu)
  348. {
  349. rootMenu.ActionBlockStateChange(action, locked);
  350. }
  351. }
  352. }
  353. }
  354.  
  355. public function BlockAllActions(sourceName : name, lock : bool, optional exceptions : array<EInputActionBlock>, optional saveLock : bool, optional onSpawnedNullPointerHackFix : CPlayer, optional isFromQuest : bool, optional isFromPlace : bool)
  356. {
  357. var i, size : int;
  358.  
  359. size = EnumGetMax('EInputActionBlock')+1;
  360. for(i=0; i<size; i+=1)
  361. {
  362. if ( exceptions.Contains(i) )
  363. continue;
  364.  
  365. BlockAction(i, sourceName, lock, saveLock, onSpawnedNullPointerHackFix, isFromQuest, isFromPlace);
  366. }
  367. }
  368.  
  369. //blocking all actions from all quest sources regardless of source
  370. public final function BlockAllQuestActions(sourceName : name, lock : bool)
  371. {
  372. var action, j, size : int;
  373. var isLocked, wasLocked : bool;
  374. var exceptions : array< EInputActionBlock >;
  375.  
  376. if(lock)
  377. {
  378. //block works as regular block
  379. exceptions.PushBack( EIAB_FastTravelGlobal );
  380. BlockAllActions(sourceName, lock, exceptions, true, , true);
  381. }
  382. else
  383. {
  384. //release all quest locks, regardless of sourceName
  385. size = EnumGetMax('EInputActionBlock')+1;
  386. for(action=0; action<size; action+=1)
  387. {
  388. wasLocked = (actionLocks[action].Size() > 0);
  389.  
  390. for(j=0; j<actionLocks[action].Size();)
  391. {
  392. if(actionLocks[action][j].isFromQuest)
  393. {
  394. actionLocks[action].EraseFast(j);
  395. }
  396. else
  397. {
  398. j += 1;
  399. }
  400. }
  401.  
  402. isLocked = (actionLocks[action].Size() > 0);
  403. if(wasLocked != isLocked)
  404. OnActionLockChanged(action, isLocked);
  405. }
  406. }
  407. }
  408.  
  409. //blocking all UI actions from all quest sources regardless of source
  410. public function BlockAllUIQuestActions(sourceName : name, lock : bool)
  411. {
  412. var i, j, action, size : int;
  413. var uiActions : array<int>;
  414. var wasLocked, isLocked : bool;
  415.  
  416. if( lock )
  417. {
  418. BlockAction(EIAB_OpenInventory, sourceName, true, true, NULL, false);
  419. BlockAction(EIAB_MeditationWaiting, sourceName, true, true, NULL, false);
  420. BlockAction(EIAB_OpenMeditation, sourceName, true, true, NULL, false);
  421. BlockAction(EIAB_FastTravel, sourceName, true, true, NULL, false);
  422. BlockAction(EIAB_OpenMap, sourceName, true, true, NULL, false);
  423. BlockAction(EIAB_OpenCharacterPanel, sourceName, true, true, NULL, false);
  424. BlockAction(EIAB_OpenJournal, sourceName, true, true, NULL, false);
  425. BlockAction(EIAB_OpenAlchemy, sourceName, true, true, NULL, false);
  426. }
  427. else
  428. {
  429. //release all quest locks, regardless of sourceName
  430. uiActions.Resize(8);
  431. uiActions[0] = EIAB_OpenInventory;
  432. uiActions[1] = EIAB_MeditationWaiting;
  433. uiActions[2] = EIAB_OpenMeditation;
  434. uiActions[3] = EIAB_FastTravel;
  435. uiActions[4] = EIAB_OpenMap;
  436. uiActions[5] = EIAB_OpenCharacterPanel;
  437. uiActions[6] = EIAB_OpenJournal;
  438. uiActions[7] = EIAB_OpenAlchemy;
  439.  
  440. size = uiActions.Size();
  441. for(i=0; i<size; i+=1)
  442. {
  443. action = uiActions[i];
  444.  
  445. wasLocked = (actionLocks[action].Size() > 0);
  446.  
  447. for(j=0; j<actionLocks[action].Size();)
  448. {
  449. if(actionLocks[action][j].isFromQuest)
  450. {
  451. actionLocks[action].EraseFast(j);
  452. }
  453. else
  454. {
  455. j += 1;
  456. }
  457. }
  458.  
  459. isLocked = (actionLocks[action].Size() > 0);
  460. if(wasLocked != isLocked)
  461. OnActionLockChanged(action, isLocked);
  462. }
  463. }
  464. }
  465.  
  466. //forces releas of all action blocks
  467. public function ForceUnlockAllInputActions(alsoQuestLocks : bool)
  468. {
  469. var i, j : int;
  470.  
  471. for(i=0; i<=EnumGetMax('EInputActionBlock'); i+=1)
  472. {
  473. if(alsoQuestLocks)
  474. {
  475. actionLocks[i].Clear();
  476. OnActionLockChanged(i, false);
  477. }
  478. else
  479. {
  480. for(j=actionLocks[i].Size()-1; j>=0; j-=1)
  481. {
  482. if(actionLocks[i][j].removedOnSpawn)
  483. actionLocks[i].Erase(j);
  484. }
  485.  
  486. if(actionLocks[i].Size() == 0)
  487. OnActionLockChanged(i, false);
  488. }
  489. }
  490. }
  491.  
  492. public function RemoveLocksOnSpawn()
  493. {
  494. var i, j : int;
  495.  
  496. for(i=0; i<actionLocks.Size(); i+=1)
  497. {
  498. for(j=actionLocks[i].Size()-1; j>=0; j-=1)
  499. {
  500. if(actionLocks[i][j].removedOnSpawn)
  501. {
  502. actionLocks[i].Erase(j);
  503. }
  504. }
  505. }
  506. }
  507.  
  508. public function GetActionLocks(action : EInputActionBlock) : array< SInputActionLock >
  509. {
  510. return actionLocks[action];
  511. }
  512.  
  513. public function GetAllActionLocks() : array< array< SInputActionLock > >
  514. {
  515. return actionLocks;
  516. }
  517.  
  518. public function IsActionAllowed(action : EInputActionBlock) : bool
  519. {
  520. var actionAllowed : bool;
  521. actionAllowed = (actionLocks[action].Size() == 0);
  522. return actionAllowed;
  523. }
  524.  
  525. public function IsActionBlockedBy( action : EInputActionBlock, sourceName : name ) : bool
  526. {
  527. return FindActionLockIndex( action, sourceName ) != -1;
  528. }
  529.  
  530. public final function GetActionBlockedHudLockType(action : EInputActionBlock) : name
  531. {
  532. var i : int;
  533.  
  534. if(action == EIAB_Undefined)
  535. return '';
  536.  
  537. for(i=0; i<actionLocks[action].Size(); i+=1)
  538. {
  539. if(actionLocks[action][i].isFromPlace)
  540. return 'place';
  541. }
  542.  
  543. if(actionLocks[action].Size() > 0)
  544. return 'time';
  545.  
  546. return '';
  547. }
  548.  
  549. ///////////////////////////
  550. // Common Inputs
  551. ///////////////////////////
  552. private var accelerateTimestamp : float;
  553. private var triedDoubleTap : bool;
  554. event OnCommSprint( action : SInputAction )
  555. {
  556. if( IsPressed( action ) )
  557. {
  558. //ImmersiveMotion++
  559.  
  560. if( accelerateTimestamp + DOUBLE_TAP_WINDOW >= theGame.GetEngineTimeAsSeconds() )
  561. {
  562. triedDoubleTap = true;
  563. // PN
  564. if ( PNFatigueOn() && PNFatigueLevel1() ) {
  565. PNHudNotify( GetLocStringByKeyExt("HUDmessage_TooTiredToSprint") );
  566. thePlayer.SetSprintActionPressed(false);
  567. return false;
  568. }
  569. else
  570. // PN
  571. {
  572. triedDoubleTap = false;
  573. }
  574.  
  575. if( triedDoubleTap )
  576. thePlayer.SetSprintSpeed(1.5);
  577. else
  578. thePlayer.SetSprintSpeed(1.0);
  579.  
  580. //ImmersiveMotion--
  581.  
  582. thePlayer.SetSprintActionPressed(true);
  583.  
  584. if ( thePlayer.rangedWeapon )
  585. thePlayer.rangedWeapon.OnSprintHolster();
  586. }
  587.  
  588. /*if( thePlayer.CanFollowNpc() )
  589. accelerateTimestamp = theGame.GetEngineTimeAsSeconds(); //ImmersiveMotion
  590. {
  591. if( IsPressed( action ) )
  592. {
  593. if( VecDistanceSquared( thePlayer.GetWorldPosition(), thePlayer.GetActorToFollow().GetWorldPosition() ) < 25.0 )
  594. {
  595. thePlayer.FollowActor( thePlayer.GetActorToFollow() );
  596. }
  597. else
  598. {
  599. thePlayer.SignalGameplayEvent( 'StopPlayerAction' );
  600. thePlayer.SetCanFollowNpc( false, NULL );
  601. }
  602. }
  603. else if( IsReleased( action ) )
  604. {
  605. thePlayer.SignalGameplayEvent( 'StopPlayerAction' );
  606. thePlayer.SetCanFollowNpc( false, NULL );
  607. }
  608. }*/
  609. }
  610.  
  611. event OnCommSprintToggle( action : SInputAction )
  612. {
  613. if( IsPressed(action) )
  614. {
  615. // PN
  616. if ( PNFatigueOn() && PNFatigueLevel1() ) {
  617. PNHudNotify( GetLocStringByKeyExt("HUDmessage_TooTiredToSprint") );
  618. return false;
  619. }
  620. // PN
  621. if ( thePlayer.GetIsSprintToggled() )
  622. thePlayer.SetSprintToggle( false );
  623. else
  624. thePlayer.SetSprintToggle( true );
  625. }
  626. }
  627.  
  628. event OnCommWalkToggle( action : SInputAction )
  629. {
  630. if( IsPressed(action) && !thePlayer.GetIsSprinting() && !thePlayer.modifyPlayerSpeed )
  631. {
  632. if ( thePlayer.GetIsWalkToggled() ) {
  633. // PN
  634. if ( PNFatigueOn() && PNFatigueLevel5() ) {
  635. PNHudNotify( GetLocStringByKeyExt("HUDmessage_TooTiredToRun") );
  636. return false;
  637. }
  638. // PN
  639. thePlayer.SetWalkToggle( false );
  640. }
  641. else
  642. {
  643. thePlayer.SetWalkToggle( true );
  644. // PN
  645. if ( PNFatigueOn() && PNFatigueLevel5() ) {
  646. PNHudNotify( GetLocStringByKeyExt("HUDmessage_TooTiredToRun") );
  647. return false;
  648. }
  649. // PN
  650. }
  651. }
  652. }
  653.  
  654.  
  655. event OnCommGuard( action : SInputAction )
  656. {
  657. // PN
  658. if ( PNFatigueOn() && PNFatigueLevel5() ) {
  659. PNHudNotify( GetLocStringByKeyExt("HUDmessage_TooTiredToBlock") );
  660. return false;
  661. }
  662. // PN
  663. if(thePlayer.IsCiri() && !GetCiriPlayer().HasSword())
  664. return false;
  665.  
  666. if ( !thePlayer.IsInsideInteraction() )
  667. {
  668. if ( IsActionAllowed(EIAB_Parry) )
  669. {
  670. if( IsReleased(action) && thePlayer.GetCurrentStateName() == 'CombatFists' )
  671. thePlayer.OnGuardedReleased();
  672.  
  673. if( IsPressed(action) )
  674. {
  675. thePlayer.AddCounterTimeStamp(theGame.GetEngineTime()); //cache counter button press to further check counter button spamming by the thePlayer
  676. thePlayer.SetGuarded(true);
  677. thePlayer.OnPerformGuard();
  678. }
  679. else if( IsReleased(action) )
  680. {
  681. thePlayer.SetGuarded(false);
  682. }
  683. }
  684. else
  685. {
  686. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Parry);
  687. }
  688. }
  689. }
  690.  
  691. ///////////////////////////
  692. // Horse
  693. ///////////////////////////
  694.  
  695. private var pressTimestamp : float;
  696. private const var DOUBLE_TAP_WINDOW : float;
  697. default DOUBLE_TAP_WINDOW = 0.4;
  698.  
  699. event OnCommSpawnHorse( action : SInputAction )
  700. {
  701. var doubleTap : bool;
  702.  
  703. if( IsPressed( action ) )
  704. {
  705. if( pressTimestamp + DOUBLE_TAP_WINDOW >= theGame.GetEngineTimeAsSeconds() )
  706. {
  707. doubleTap = true;
  708. }
  709. else
  710. {
  711. doubleTap = false;
  712. }
  713.  
  714. if( IsActionAllowed( EIAB_CallHorse ) && !thePlayer.IsInInterior() && !thePlayer.IsInAir() )
  715. {
  716.  
  717. if( doubleTap || theInput.LastUsedPCInput() )
  718. {
  719. if ( thePlayer.IsHoldingItemInLHand () )
  720. {
  721. thePlayer.OnUseSelectedItem(true);
  722. thePlayer.SetPlayerActionToRestore ( PATR_CallHorse );
  723. }
  724. else
  725. {
  726. theGame.OnSpawnPlayerHorse();
  727. }
  728. }
  729. }
  730. else
  731. {
  732. if( thePlayer.IsInInterior() )
  733. thePlayer.DisplayActionDisallowedHudMessage( EIAB_Undefined, false, true );
  734. else
  735. thePlayer.DisplayActionDisallowedHudMessage( EIAB_CallHorse );
  736. }
  737.  
  738. pressTimestamp = theGame.GetEngineTimeAsSeconds();
  739.  
  740. return true;
  741. }
  742.  
  743. return false;
  744. }
  745.  
  746. ///////////////////////////
  747. // Opening UI Panels
  748. ///////////////////////////
  749.  
  750. // MenuHub (aka commonmenu.ws)
  751. event OnCommMenuHub( action : SInputAction )
  752. {
  753. if(IsReleased(action))
  754. {
  755. PushMenuHub();
  756. }
  757. }
  758.  
  759. final function PushMenuHub()
  760. {
  761. if ( theGame.IsBlackscreenOrFading() )
  762. {
  763. return;
  764. }
  765. theGame.RequestMenu('CommonMenu');
  766. }
  767.  
  768. //Character screen
  769.  
  770. event OnCommPanelChar( action : SInputAction )
  771. {
  772. if(IsReleased(action))
  773. {
  774. PushCharacterScreen();
  775. }
  776. }
  777. final function PushCharacterScreen()
  778. {
  779. if ( theGame.IsBlackscreenOrFading() )
  780. {
  781. return;
  782. }
  783.  
  784. if( IsActionAllowed(EIAB_OpenCharacterPanel) )
  785. {
  786. theGame.RequestMenuWithBackground( 'CharacterMenu', 'CommonMenu' );
  787. }
  788. else
  789. {
  790. thePlayer.DisplayActionDisallowedHudMessage(EIAB_OpenCharacterPanel);
  791. }
  792. }
  793.  
  794. //Inventory screen
  795. event OnCommPanelInv( action : SInputAction )
  796. {
  797. if (IsReleased(action))
  798. {
  799. PushInventoryScreen();
  800. }
  801. }
  802.  
  803. final function PushInventoryScreen()
  804. {
  805. if ( theGame.IsBlackscreenOrFading() )
  806. {
  807. return;
  808. }
  809. if( IsActionAllowed(EIAB_OpenInventory) )
  810. {
  811. theGame.RequestMenuWithBackground( 'InventoryMenu', 'CommonMenu' );
  812. }
  813. else
  814. {
  815. thePlayer.DisplayActionDisallowedHudMessage(EIAB_OpenInventory);
  816. }
  817. }
  818.  
  819. //Gwint screen
  820. event OnCommDeckEditor( action : SInputAction )
  821. {
  822. if( IsReleased(action) )
  823. {
  824. if ( theGame.IsBlackscreenOrFading() )
  825. {
  826. return false;
  827. }
  828. if (theGame.GetGwintManager().GetHasDoneTutorial() || theGame.GetGwintManager().HasLootedCard())
  829. {
  830. if( IsActionAllowed(EIAB_OpenGwint) )
  831. {
  832. theGame.RequestMenu( 'DeckBuilder' );
  833. }
  834. else
  835. {
  836. thePlayer.DisplayActionDisallowedHudMessage(EIAB_OpenGwint);
  837. }
  838. }
  839. }
  840. }
  841.  
  842. //Meditation screen
  843. event OnCommPanelMed( action : SInputAction )
  844. {
  845. if( IsReleased(action) )
  846. {
  847. if( IsActionAllowed(EIAB_MeditationWaiting) )
  848. {
  849. GetWitcherPlayer().Meditate();
  850. }
  851. else
  852. {
  853. thePlayer.DisplayActionDisallowedHudMessage(EIAB_MeditationWaiting);
  854. }
  855. }
  856. }
  857.  
  858. event OnCommPanelMapPC( action : SInputAction )
  859. {
  860. if( IsReleased(action) )
  861. {
  862. PushMapScreen();
  863. }
  864. }
  865. //Map screen
  866. event OnCommPanelMap( action : SInputAction )
  867. {
  868. if( IsPressed(action) )
  869. {
  870. PushMapScreen();
  871. }
  872. }
  873. final function PushMapScreen()
  874. {
  875. if ( theGame.IsBlackscreenOrFading() )
  876. {
  877. return;
  878. }
  879. if( IsActionAllowed(EIAB_OpenMap) )
  880. {
  881. theGame.RequestMenuWithBackground( 'MapMenu', 'CommonMenu' );
  882. }
  883. else
  884. {
  885. thePlayer.DisplayActionDisallowedHudMessage(EIAB_OpenMap);
  886. }
  887. }
  888.  
  889. //Journal screen
  890. event OnCommPanelJour( action : SInputAction )
  891. {
  892. if( IsReleased(action) )
  893. {
  894. PushJournalScreen();
  895. }
  896. }
  897. final function PushJournalScreen()
  898. {
  899. if ( theGame.IsBlackscreenOrFading() )
  900. {
  901. return;
  902. }
  903. if( IsActionAllowed(EIAB_OpenJournal) )
  904. {
  905. //theGame.RequestMenu( 'QuestListMenu' );
  906. theGame.RequestMenuWithBackground( 'JournalQuestMenu', 'CommonMenu' );
  907. }
  908. else
  909. {
  910. thePlayer.DisplayActionDisallowedHudMessage(EIAB_OpenJournal);
  911. }
  912. }
  913.  
  914. event OnCommPanelMeditation( action : SInputAction )
  915. {
  916. if( IsReleased(action) )
  917. {
  918. PushMeditationScreen();
  919. }
  920. }
  921.  
  922. final function PushMeditationScreen()
  923. {
  924. var imInstalled : bool; //Immersive Meditation
  925.  
  926. if ( theGame.IsBlackscreenOrFading() )
  927. {
  928. return;
  929. }
  930. if( IsActionAllowed(EIAB_OpenMeditation) )
  931. {
  932. //Immersive Meditation++
  933.  
  934. if( StringToFloat( theGame.GetInGameConfigWrapper().GetVarValue('ImmersiveCamPositionsMeditation', 'medRotSpeed') ) >= 0.1 )
  935. imInstalled = true;
  936.  
  937. if( imInstalled )
  938. ((CMeditationUI)thePlayer.getMeditation()).NewMeditate();
  939. else
  940. theGame.RequestMenuWithBackground( 'MeditationClockMenu', 'CommonMenu' );
  941.  
  942. //Immersive Meditation--
  943. }
  944. else
  945. {
  946. thePlayer.DisplayActionDisallowedHudMessage(EIAB_OpenMeditation);
  947. }
  948. }
  949.  
  950. event OnCommPanelCrafting( action : SInputAction )
  951. {
  952. if( IsReleased(action) )
  953. {
  954. PushCraftingScreen();
  955. }
  956. }
  957.  
  958. final function PushCraftingScreen()
  959. {
  960. if ( theGame.IsBlackscreenOrFading() )
  961. {
  962. return;
  963. }
  964.  
  965. theGame.RequestMenuWithBackground( 'CraftingMenu', 'CommonMenu' );
  966. }
  967.  
  968. //Bestiary screen
  969. event OnCommPanelBestiary( action : SInputAction )
  970. {
  971. if( IsReleased(action) )
  972. {
  973. PushBestiaryScreen();
  974. }
  975. }
  976.  
  977. final function PushBestiaryScreen()
  978. {
  979. if ( theGame.IsBlackscreenOrFading() )
  980. {
  981. return;
  982. }
  983. if( IsActionAllowed(EIAB_OpenGlossary) )
  984. {
  985. theGame.RequestMenuWithBackground( 'GlossaryBestiaryMenu', 'CommonMenu' );
  986. }
  987. else
  988. {
  989. thePlayer.DisplayActionDisallowedHudMessage(EIAB_OpenGlossary);
  990. }
  991. }
  992. //Alchemy screen
  993. event OnCommPanelAlch( action : SInputAction )
  994. {
  995. if( IsReleased(action) )
  996. {
  997. PushAlchemyScreen();
  998. }
  999. }
  1000. final function PushAlchemyScreen()
  1001. {
  1002. if ( theGame.IsBlackscreenOrFading() )
  1003. {
  1004. return;
  1005. }
  1006. if( IsActionAllowed(EIAB_OpenAlchemy) )
  1007. {
  1008. theGame.RequestMenuWithBackground( 'AlchemyMenu', 'CommonMenu' );
  1009. }
  1010. else
  1011. {
  1012. thePlayer.DisplayActionDisallowedHudMessage(EIAB_OpenAlchemy);
  1013. }
  1014. }
  1015. //Alchemy screen
  1016. event OnCommPanelGlossary( action : SInputAction )
  1017. {
  1018. if( IsReleased(action) )
  1019. {
  1020. PushGlossaryScreen();
  1021. }
  1022. }
  1023. final function PushGlossaryScreen()
  1024. {
  1025. if ( theGame.IsBlackscreenOrFading() )
  1026. {
  1027. return;
  1028. }
  1029. if( IsActionAllowed(EIAB_OpenGlossary) )
  1030. {
  1031. theGame.RequestMenuWithBackground( 'GlossaryEncyclopediaMenu', 'CommonMenu' );
  1032. }
  1033. else
  1034. {
  1035. thePlayer.DisplayActionDisallowedHudMessage(EIAB_OpenGlossary);
  1036. }
  1037. }
  1038.  
  1039. event OnShowControlsHelp( action : SInputAction )
  1040. {
  1041. if( IsReleased(action) )
  1042. {
  1043. if ( theGame.IsBlackscreenOrFading() )
  1044. {
  1045. return false;
  1046. }
  1047. //theGame.RequestMenu( 'ControlsHelp' );
  1048. //theGame.RequestMenu( 'JournalQuestMenu' );
  1049. }
  1050. }
  1051.  
  1052. event OnCommPanelUIResize( action : SInputAction )
  1053. {
  1054. if( IsReleased(action) )
  1055. {
  1056. if ( theGame.IsBlackscreenOrFading() )
  1057. {
  1058. return false;
  1059. }
  1060. theGame.RequestMenu( 'RescaleMenu' );
  1061. }
  1062. }
  1063.  
  1064. event OnCommPanelFakeHud( action : SInputAction )
  1065. {
  1066. if( IsReleased(action) )
  1067. {
  1068. if ( theGame.IsBlackscreenOrFading() )
  1069. {
  1070. return false;
  1071. }
  1072. //theGame.RequestMenu( 'FakeHudMenu' );
  1073. }
  1074. }
  1075.  
  1076. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1077. ////////////////////////////// WEAPON DRAW ///////////////////////////////////////////////////////////////////////////////////////////////////
  1078. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1079. // PN
  1080. event OnPNToggleHud( action : SInputAction ) {
  1081. if( IsReleased(action) ) {
  1082. PNToggleHud();
  1083. PNUpdateHud();
  1084. }
  1085. }
  1086.  
  1087. event OnPNPee( action : SInputAction) {
  1088. if( IsReleased(action) ) {
  1089. if (PNPeeOn()) {
  1090. if (PNGetPee() > 4)
  1091. PNPee();
  1092. else
  1093. PNHudNotify( GetLocStringByKeyExt("HUDmessage_NotAbleToPee") );
  1094. }
  1095. }
  1096. }
  1097.  
  1098. event OnPNPoop( action : SInputAction) {
  1099. if( IsReleased(action) ) {
  1100. if (PNPoopOn()) {
  1101. if (PNGetPoop() > 9)
  1102. PNPoop();
  1103. else
  1104. PNHudNotify( GetLocStringByKeyExt("HUDmessage_NotAbleToPoop") );
  1105. }
  1106. }
  1107. }
  1108.  
  1109. event OnPNDrinkShallowWater( action : SInputAction ) {
  1110. if ( IsReleased( action )) {
  1111. PNDrinkShallowWater();
  1112. }
  1113. }
  1114. // PN
  1115. private var processedSwordHold : bool;
  1116.  
  1117. event OnCommSteelSword( action : SInputAction )
  1118. {
  1119. var duringCastSign : bool;
  1120.  
  1121. if(IsPressed(action))
  1122. processedSwordHold = false;
  1123.  
  1124. if ( theInput.LastUsedGamepad() && theInput.IsActionPressed('Alternate') )
  1125. {
  1126. return false;
  1127. }
  1128.  
  1129. if ( IsReleased(action) || ( IsPressed(action) && (thePlayer.GetCurrentMeleeWeaponType() == PW_None || thePlayer.GetCurrentMeleeWeaponType() == PW_Fists) ) )
  1130. {
  1131. if( !processedSwordHold )
  1132. {
  1133. if ( IsActionAllowed(EIAB_DrawWeapon) && thePlayer.GetBIsInputAllowed() && thePlayer.GetWeaponHolster().IsMeleeWeaponReady() )
  1134. {
  1135. thePlayer.PushCombatActionOnBuffer( EBAT_Draw_Steel, BS_Pressed );
  1136. if ( thePlayer.GetBIsCombatActionAllowed() )
  1137. thePlayer.ProcessCombatActionBuffer();
  1138. }
  1139. processedSwordHold = true;
  1140. }
  1141. }
  1142. }
  1143.  
  1144. event OnCommSilverSword( action : SInputAction )
  1145. {
  1146. var duringCastSign : bool;
  1147.  
  1148. if( IsPressed(action) )
  1149. processedSwordHold = false;
  1150.  
  1151. if ( theInput.LastUsedGamepad() && theInput.IsActionPressed('Alternate') )
  1152. {
  1153. return false;
  1154. }
  1155.  
  1156. if ( IsReleased(action) || ( IsPressed(action) && (thePlayer.GetCurrentMeleeWeaponType() == PW_None || thePlayer.GetCurrentMeleeWeaponType() == PW_Fists) ) )
  1157. {
  1158. if( !processedSwordHold )
  1159. {
  1160. if ( IsActionAllowed(EIAB_DrawWeapon) && thePlayer.GetBIsInputAllowed() && thePlayer.GetWeaponHolster().IsMeleeWeaponReady() )
  1161. {
  1162. thePlayer.PushCombatActionOnBuffer( EBAT_Draw_Silver, BS_Pressed );
  1163. if ( thePlayer.GetBIsCombatActionAllowed() || duringCastSign )
  1164. thePlayer.ProcessCombatActionBuffer();
  1165. }
  1166. processedSwordHold = true;
  1167. }
  1168.  
  1169. }
  1170. }
  1171.  
  1172. event OnCommSheatheAny( action : SInputAction )
  1173. {
  1174. var duringCastSign : bool;
  1175.  
  1176. if( IsPressed( action ) )
  1177. {
  1178. if ( thePlayer.GetBIsInputAllowed() && thePlayer.GetWeaponHolster().IsMeleeWeaponReady() )
  1179. {
  1180. thePlayer.PushCombatActionOnBuffer( EBAT_Sheathe_Sword, BS_Pressed );
  1181. if ( thePlayer.GetBIsCombatActionAllowed() || duringCastSign )
  1182. {
  1183. thePlayer.ProcessCombatActionBuffer();
  1184. }
  1185. }
  1186. processedSwordHold = true;
  1187. }
  1188. }
  1189.  
  1190. event OnCommSheatheSteel( action : SInputAction )
  1191. {
  1192. if( IsPressed( action ) && thePlayer.IsWeaponHeld( 'steelsword' ) && !processedSwordHold)
  1193. {
  1194. OnCommSheatheAny(action);
  1195. }
  1196. }
  1197.  
  1198. event OnCommSheatheSilver( action : SInputAction )
  1199. {
  1200. if( IsPressed( action ) && thePlayer.IsWeaponHeld( 'silversword' ) && !processedSwordHold)
  1201. {
  1202. OnCommSheatheAny(action);
  1203. }
  1204. }
  1205.  
  1206. event OnCommDrinkPot( action : SInputAction )
  1207. {
  1208. if(IsPressed(action))
  1209. {
  1210. if(!potPress)
  1211. {
  1212. potPress = true;
  1213. potAction = action;
  1214. thePlayer.AddTimer('PotDrinkTimer', 0.3);
  1215. }
  1216. else
  1217. {
  1218. PotDrinkTimer(true);
  1219. thePlayer.RemoveTimer('PotDrinkTimer');
  1220. }
  1221. }
  1222. }
  1223.  
  1224. public function PotDrinkTimer(isDoubleTapped : bool)
  1225. {
  1226. thePlayer.RemoveTimer('PotDrinkTimer');
  1227. potPress = false;
  1228.  
  1229. if(isDoubleTapped)
  1230. OnCommDrinkPotion2(potAction);
  1231. else
  1232. OnCommDrinkPotion1(potAction);
  1233. }
  1234. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1235. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1236. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1237.  
  1238. event OnCbtComboDigitLeft( action : SInputAction )
  1239. {
  1240. if ( theInput.IsActionPressed('Alternate') )
  1241. {
  1242. OnTogglePreviousSign(action);
  1243. }
  1244. }
  1245.  
  1246. event OnCbtComboDigitRight( action : SInputAction )
  1247. {
  1248. if ( theInput.IsActionPressed('Alternate') )
  1249. {
  1250. OnToggleNextSign(action);
  1251. }
  1252. }
  1253.  
  1254.  
  1255. event OnSelectSign(action : SInputAction)
  1256. {
  1257. if( IsPressed( action ) )
  1258. {
  1259. switch( action.aName )
  1260. {
  1261. case 'SelectAard' :
  1262. GetWitcherPlayer().SetEquippedSign(ST_Aard);
  1263. break;
  1264. case 'SelectYrden' :
  1265. GetWitcherPlayer().SetEquippedSign(ST_Yrden);
  1266. break;
  1267. case 'SelectIgni' :
  1268. GetWitcherPlayer().SetEquippedSign(ST_Igni);
  1269. break;
  1270. case 'SelectQuen' :
  1271. GetWitcherPlayer().SetEquippedSign(ST_Quen);
  1272. break;
  1273. case 'SelectAxii' :
  1274. GetWitcherPlayer().SetEquippedSign(ST_Axii);
  1275. break;
  1276. default :
  1277. break;
  1278. }
  1279. }
  1280. }
  1281.  
  1282. event OnToggleSigns( action : SInputAction )
  1283. {
  1284. var tolerance : float;
  1285. tolerance = 2.5f;
  1286.  
  1287. if( action.value < -tolerance )
  1288. {
  1289. GetWitcherPlayer().TogglePreviousSign();
  1290. }
  1291. else if( action.value > tolerance )
  1292. {
  1293. GetWitcherPlayer().ToggleNextSign();
  1294. }
  1295. }
  1296. event OnToggleNextSign( action : SInputAction )
  1297. {
  1298. if( IsPressed( action ) )
  1299. {
  1300. GetWitcherPlayer().ToggleNextSign();
  1301. }
  1302. }
  1303. event OnTogglePreviousSign( action : SInputAction )
  1304. {
  1305. if( IsPressed( action ) )
  1306. {
  1307. GetWitcherPlayer().TogglePreviousSign();
  1308. }
  1309. }
  1310.  
  1311. event OnToggleItem( action : SInputAction )
  1312. {
  1313. if( !IsActionAllowed( EIAB_QuickSlots ) )
  1314. {
  1315. thePlayer.DisplayActionDisallowedHudMessage(EIAB_QuickSlots);
  1316. return false;
  1317. }
  1318.  
  1319. if( IsReleased( action ) )
  1320. {
  1321. if( theInput.GetLastActivationTime( action.aName ) < 0.3 )
  1322. GetWitcherPlayer().ToggleNextItem();
  1323. }
  1324. }
  1325.  
  1326. ///////////////////////////
  1327. // Potions
  1328. ///////////////////////////
  1329.  
  1330. event OnCommDrinkpotionUpperHeld( action : SInputAction )
  1331. {
  1332. if(!potionModeHold)
  1333. return false;
  1334.  
  1335. //requested hack for Ciri using Geralt's input context
  1336. if(thePlayer.IsCiri())
  1337. return false;
  1338.  
  1339. if(IsReleased(action))
  1340. return false;
  1341.  
  1342. potionUpperHeld = true;
  1343. GetWitcherPlayer().FlipSelectedPotion(true);
  1344. }
  1345.  
  1346. event OnCommDrinkpotionLowerHeld( action : SInputAction )
  1347. {
  1348. if(!potionModeHold)
  1349. return false;
  1350.  
  1351. //requested hack for Ciri using Geralt's input context
  1352. if(thePlayer.IsCiri())
  1353. return false;
  1354.  
  1355. if(IsReleased(action))
  1356. return false;
  1357.  
  1358. potionLowerHeld = true;
  1359. GetWitcherPlayer().FlipSelectedPotion(false);
  1360. }
  1361.  
  1362. public final function SetPotionSelectionMode(b : bool)
  1363. {
  1364. potionModeHold = b;
  1365. }
  1366.  
  1367. private final function DrinkPotion(action : SInputAction, upperSlot : bool) : bool
  1368. {
  1369. var witcher : W3PlayerWitcher;
  1370.  
  1371. if ( potionModeHold && IsReleased(action) )
  1372. {
  1373. if(!potionUpperHeld && !potionLowerHeld)
  1374. {
  1375. GetWitcherPlayer().OnPotionDrinkInput(upperSlot);
  1376. }
  1377.  
  1378. if(upperSlot)
  1379. potionUpperHeld = false;
  1380. else
  1381. potionLowerHeld = false;
  1382. }
  1383. else if(!potionModeHold && IsPressed(action))
  1384. {
  1385. witcher = GetWitcherPlayer();
  1386. if(!witcher.IsPotionDoubleTapRunning())
  1387. {
  1388. witcher.SetPotionDoubleTapRunning(true, upperSlot);
  1389. return true;
  1390. }
  1391. else
  1392. {
  1393. witcher.SetPotionDoubleTapRunning(false);
  1394. witcher.FlipSelectedPotion(upperSlot);
  1395. return true;
  1396. }
  1397. }
  1398.  
  1399. return false;
  1400. }
  1401.  
  1402. //upper left slot
  1403. event OnCommDrinkPotion1( action : SInputAction )
  1404. {
  1405. //requested hack for Ciri using Geralt's input context
  1406. if(thePlayer.IsCiri())
  1407. return false;
  1408.  
  1409. if( !IsActionAllowed( EIAB_QuickSlots ) )
  1410. {
  1411. thePlayer.DisplayActionDisallowedHudMessage(EIAB_QuickSlots);
  1412. return false;
  1413. }
  1414.  
  1415. if ( theInput.LastUsedGamepad() )
  1416. {
  1417. return DrinkPotion(action, true);
  1418. }
  1419. else
  1420. if ( IsReleased(action) )
  1421. {
  1422. GetWitcherPlayer().OnPotionDrinkKeyboardsInput(EES_Potion1);
  1423. return true;
  1424. }
  1425.  
  1426. return false;
  1427. }
  1428.  
  1429. //lower left slot
  1430. event OnCommDrinkPotion2( action : SInputAction )
  1431. {
  1432. var witcher : W3PlayerWitcher;
  1433.  
  1434. //requested hack for Ciri using Geralt's input context
  1435. if(thePlayer.IsCiri())
  1436. return false;
  1437.  
  1438. if( !IsActionAllowed( EIAB_QuickSlots ) )
  1439. {
  1440. thePlayer.DisplayActionDisallowedHudMessage(EIAB_QuickSlots);
  1441. return false;
  1442. }
  1443.  
  1444. if ( theInput.LastUsedGamepad() )
  1445. {
  1446. return DrinkPotion(action, false);
  1447. }
  1448. else
  1449. if ( IsReleased(action) )
  1450. {
  1451. GetWitcherPlayer().OnPotionDrinkKeyboardsInput(EES_Potion2);
  1452. return true;
  1453. }
  1454.  
  1455. return false;
  1456. }
  1457.  
  1458. //upper right slot
  1459. event OnCommDrinkPotion3( action : SInputAction )
  1460. {
  1461. //requested hack for Ciri using Geralt's input context
  1462. if(thePlayer.IsCiri())
  1463. return false;
  1464.  
  1465. if( !IsActionAllowed( EIAB_QuickSlots ) )
  1466. {
  1467. thePlayer.DisplayActionDisallowedHudMessage(EIAB_QuickSlots);
  1468. return false;
  1469. }
  1470.  
  1471. if ( IsReleased(action) )
  1472. {
  1473. GetWitcherPlayer().OnPotionDrinkKeyboardsInput(EES_Potion3);
  1474. return true;
  1475. }
  1476.  
  1477. return false;
  1478. }
  1479.  
  1480. //lower right slot
  1481. event OnCommDrinkPotion4( action : SInputAction )
  1482. {
  1483. var witcher : W3PlayerWitcher;
  1484.  
  1485. //requested hack for Ciri using Geralt's input context
  1486. if(thePlayer.IsCiri())
  1487. return false;
  1488.  
  1489. if( !IsActionAllowed( EIAB_QuickSlots ) )
  1490. {
  1491. thePlayer.DisplayActionDisallowedHudMessage(EIAB_QuickSlots);
  1492. return false;
  1493. }
  1494.  
  1495. if ( IsReleased(action) )
  1496. {
  1497. GetWitcherPlayer().OnPotionDrinkKeyboardsInput(EES_Potion4);
  1498. return true;
  1499. }
  1500.  
  1501. return false;
  1502. }
  1503.  
  1504. ///////////////////////////
  1505. // Exploration Inputs
  1506. ///////////////////////////
  1507.  
  1508. event OnDiving( action : SInputAction )
  1509. {
  1510. if ( IsPressed(action) && IsActionAllowed(EIAB_Dive) )
  1511. {
  1512. if ( action.aName == 'DiveDown' )
  1513. {
  1514. if ( thePlayer.OnAllowedDiveDown() )
  1515. {
  1516. if ( !thePlayer.OnCheckDiving() )
  1517. thePlayer.OnDive();
  1518.  
  1519. if ( thePlayer.bLAxisReleased )
  1520. thePlayer.SetBehaviorVariable( 'divePitch',-1.0);
  1521. else
  1522. thePlayer.SetBehaviorVariable( 'divePitch', -0.9);
  1523. thePlayer.OnDiveInput(-1.f);
  1524.  
  1525. if ( thePlayer.rangedWeapon.GetCurrentStateName() != 'State_WeaponWait' )
  1526. {
  1527. thePlayer.OnRangedForceHolster( true, false );
  1528. thePlayer.OnFullyBlendedIdle();
  1529. }
  1530. }
  1531. }
  1532. else if ( action.aName == 'DiveUp' )
  1533. {
  1534. if ( thePlayer.bLAxisReleased )
  1535. thePlayer.SetBehaviorVariable( 'divePitch',1.0);
  1536. else
  1537. thePlayer.SetBehaviorVariable( 'divePitch', 0.9);
  1538.  
  1539. if ( thePlayer.rangedWeapon.GetCurrentStateName() != 'State_WeaponWait' )
  1540. {
  1541. thePlayer.OnRangedForceHolster( true, false );
  1542. thePlayer.OnFullyBlendedIdle();
  1543. }
  1544.  
  1545. thePlayer.OnDiveInput(1.f);
  1546. }
  1547. }
  1548. else if ( IsReleased(action) )
  1549. {
  1550. thePlayer.SetBehaviorVariable( 'divePitch',0.0);
  1551. thePlayer.OnDiveInput(0.f);
  1552. }
  1553. else if ( IsPressed(action) && !IsActionAllowed(EIAB_Dive) )
  1554. {
  1555. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Dive);
  1556. }
  1557. }
  1558.  
  1559. event OnDivingDodge( action : SInputAction )
  1560. {
  1561. var isDodgeAllowed : bool;
  1562.  
  1563. if( IsPressed(action) )
  1564. {
  1565. // PN
  1566. if ( PNFatigueOn() && PNFatigueLevel4() ) {
  1567. PNHudNotify( GetLocStringByKeyExt("HUDmessage_TooTiredToDodge") );
  1568. return false;
  1569. }
  1570. // PN
  1571. isDodgeAllowed = IsActionAllowed(EIAB_Dodge);
  1572. if( isDodgeAllowed && IsActionAllowed(EIAB_Dive) )
  1573. {
  1574. if ( thePlayer.OnCheckDiving() && thePlayer.GetBIsInputAllowed() )
  1575. {
  1576. thePlayer.PushCombatActionOnBuffer( EBAT_Dodge, BS_Pressed );
  1577. if ( thePlayer.GetBIsCombatActionAllowed() )
  1578. thePlayer.ProcessCombatActionBuffer();
  1579. }
  1580. }
  1581. else
  1582. {
  1583. if(!isDodgeAllowed)
  1584. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Dodge);
  1585. else
  1586. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Dive);
  1587. }
  1588. }
  1589. }
  1590.  
  1591. /*
  1592. Redundant with OnCbtCameraLockOrSpawnHorse
  1593. event OnExpSpawnHorse( action : SInputAction )
  1594. {
  1595. var test : bool = false;
  1596. if( IsPressed(action) && IsActionAllowed(EIAB_CallHorse))
  1597. {
  1598. test = false;
  1599. //thePlayer.OnSpawnHorse();
  1600. }
  1601. } */
  1602.  
  1603. /*event OnMountHorse( action : SInputAction )
  1604. {
  1605. if( IsPressed( action ) )
  1606. {
  1607. if( thePlayer.IsMountingHorseAllowed() )
  1608. {
  1609. thePlayer.OnVehicleInteraction( (CVehicleComponent)thePlayer.horseInteractionSource.GetComponentByClassName( 'CVehicleComponent' ) );
  1610. }
  1611. }
  1612. }*/
  1613.  
  1614. event OnExpFistFightLight( action : SInputAction )
  1615. {
  1616. var fistsAllowed : bool;
  1617.  
  1618. if( IsPressed(action) )
  1619. {
  1620. fistsAllowed = IsActionAllowed(EIAB_Fists);
  1621. if( fistsAllowed && IsActionAllowed(EIAB_LightAttacks) )
  1622. {
  1623. //thePlayer.PrepareToAttack( );
  1624. thePlayer.SetupCombatAction( EBAT_LightAttack, BS_Pressed );
  1625. }
  1626. else
  1627. {
  1628. if(!fistsAllowed)
  1629. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Fists);
  1630. else
  1631. thePlayer.DisplayActionDisallowedHudMessage(EIAB_LightAttacks);
  1632. }
  1633. }
  1634. }
  1635.  
  1636. event OnExpFistFightHeavy( action : SInputAction )
  1637. {
  1638. var fistsAllowed : bool;
  1639.  
  1640. if( IsPressed(action) )
  1641. {
  1642. fistsAllowed = IsActionAllowed(EIAB_Fists);
  1643. if( fistsAllowed && IsActionAllowed(EIAB_HeavyAttacks) )
  1644. {
  1645. //thePlayer.PrepareToAttack( );
  1646. thePlayer.SetupCombatAction( EBAT_HeavyAttack, BS_Pressed );
  1647. }
  1648. else
  1649. {
  1650. if(!fistsAllowed)
  1651. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Fists);
  1652. else
  1653. thePlayer.DisplayActionDisallowedHudMessage(EIAB_HeavyAttacks);
  1654. }
  1655. }
  1656. }
  1657.  
  1658. /*
  1659. event OnExpMedallion( action : SInputAction )
  1660. {
  1661. if(IsActionAllowed(EIAB_ExplorationFocus))
  1662. {
  1663. if( IsPressed( action ) )
  1664. {
  1665. thePlayer.MedallionPing();
  1666. }
  1667. }
  1668. }
  1669. */
  1670.  
  1671. event OnExpFocus( action : SInputAction )
  1672. {
  1673. if(IsActionAllowed(EIAB_ExplorationFocus))
  1674. {
  1675. if( IsPressed( action ) )
  1676. {
  1677. // Let's turn focus into guard if the player should fight
  1678. if( thePlayer.GoToCombatIfNeeded() )
  1679. {
  1680. OnCommGuard( action );
  1681. return false;
  1682. }
  1683. theGame.GetFocusModeController().Activate();
  1684. //thePlayer.MedallionPing();
  1685. }
  1686. else if( IsReleased( action ) )
  1687. {
  1688. theGame.GetFocusModeController().Deactivate();
  1689. }
  1690. }
  1691. else
  1692. {
  1693. thePlayer.DisplayActionDisallowedHudMessage(EIAB_ExplorationFocus);
  1694. theGame.GetFocusModeController().Deactivate();
  1695. }
  1696. }
  1697.  
  1698. ///////////////////////////
  1699. // Combat Inputs
  1700. ///////////////////////////
  1701.  
  1702. private function ShouldSwitchAttackType():bool
  1703. {
  1704. var outKeys : array<EInputKey>;
  1705.  
  1706. if ( theInput.LastUsedPCInput() )
  1707. {
  1708. theInput.GetPCKeysForAction('PCAlternate',outKeys);
  1709. if ( outKeys.Size() > 0 )
  1710. {
  1711. if ( theInput.IsActionPressed('PCAlternate') )
  1712. {
  1713. return true;
  1714. }
  1715. }
  1716. }
  1717. return false;
  1718. }
  1719.  
  1720. event OnCbtAttackWithAlternateLight( action : SInputAction )
  1721. {
  1722. CbtAttackPC( action, false);
  1723. }
  1724.  
  1725. event OnCbtAttackWithAlternateHeavy( action : SInputAction )
  1726. {
  1727. CbtAttackPC( action, true);
  1728. }
  1729.  
  1730. function CbtAttackPC( action : SInputAction, isHeavy : bool )
  1731. {
  1732. var switchAttackType : bool;
  1733.  
  1734. switchAttackType = ShouldSwitchAttackType();
  1735.  
  1736. if ( !theInput.LastUsedPCInput() )
  1737. {
  1738. return;
  1739. }
  1740.  
  1741. if ( thePlayer.IsCiri() )
  1742. {
  1743. if ( switchAttackType != isHeavy) // XOR
  1744. {
  1745. OnCbtCiriAttackHeavy(action);
  1746. }
  1747. else
  1748. {
  1749. OnCbtAttackLight(action);
  1750. }
  1751. }
  1752. else
  1753. {
  1754. if ( switchAttackType != isHeavy) // XOR
  1755. {
  1756. OnCbtAttackHeavy(action);
  1757. }
  1758. else
  1759. {
  1760. OnCbtAttackLight(action);
  1761. }
  1762. }
  1763. }
  1764.  
  1765. event OnCbtAttackLight( action : SInputAction )
  1766. {
  1767. var allowed, checkedFists : bool;
  1768.  
  1769. if( IsPressed(action) )
  1770. {
  1771. if( IsActionAllowed(EIAB_LightAttacks) )
  1772. {
  1773. if (thePlayer.GetBIsInputAllowed())
  1774. {
  1775. allowed = false;
  1776.  
  1777. if( thePlayer.GetCurrentMeleeWeaponType() == PW_Fists || thePlayer.GetCurrentMeleeWeaponType() == PW_None )
  1778. {
  1779. checkedFists = true;
  1780. if(IsActionAllowed(EIAB_Fists))
  1781. allowed = true;
  1782. }
  1783. else if(IsActionAllowed(EIAB_SwordAttack))
  1784. {
  1785. checkedFists = false;
  1786. allowed = true;
  1787. }
  1788.  
  1789. if(allowed)
  1790. {
  1791. thePlayer.SetupCombatAction( EBAT_LightAttack, BS_Pressed );
  1792. }
  1793. else
  1794. {
  1795. if(checkedFists)
  1796. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Fists);
  1797. else
  1798. thePlayer.DisplayActionDisallowedHudMessage(EIAB_SwordAttack);
  1799. }
  1800. }
  1801. }
  1802. else if ( !IsActionBlockedBy(EIAB_LightAttacks,'interaction') )
  1803. {
  1804. thePlayer.DisplayActionDisallowedHudMessage(EIAB_LightAttacks);
  1805. }
  1806. }
  1807. }
  1808.  
  1809. event OnCbtAttackHeavy( action : SInputAction )
  1810. {
  1811. var allowed, checkedSword : bool;
  1812. var outKeys : array<EInputKey>;
  1813.  
  1814. if ( thePlayer.GetBIsInputAllowed() )
  1815. {
  1816. if( IsActionAllowed(EIAB_HeavyAttacks) )
  1817. {
  1818. allowed = false;
  1819.  
  1820. if( thePlayer.GetCurrentMeleeWeaponType() == PW_Fists || thePlayer.GetCurrentMeleeWeaponType() == PW_None )
  1821. {
  1822. checkedSword = false;
  1823. if(IsActionAllowed(EIAB_Fists))
  1824. allowed = true;
  1825. }
  1826. else if(IsActionAllowed(EIAB_SwordAttack))
  1827. {
  1828. checkedSword = true;
  1829. allowed = true;
  1830. }
  1831.  
  1832. if(allowed)
  1833. {
  1834. if ( ( thePlayer.GetCurrentMeleeWeaponType() == PW_Fists || thePlayer.GetCurrentMeleeWeaponType() == PW_None ) && IsPressed(action) )
  1835. {
  1836. thePlayer.SetupCombatAction( EBAT_HeavyAttack, BS_Released );
  1837. }
  1838. else
  1839. {
  1840. if( IsReleased(action) && theInput.GetLastActivationTime( action.aName ) < 0.2 )
  1841. {
  1842. thePlayer.SetupCombatAction( EBAT_HeavyAttack, BS_Released );
  1843. }
  1844. }
  1845. }
  1846. else
  1847. {
  1848. if(checkedSword)
  1849. thePlayer.DisplayActionDisallowedHudMessage(EIAB_SwordAttack);
  1850. else
  1851. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Fists);
  1852. }
  1853. }
  1854. else if ( !IsActionBlockedBy(EIAB_HeavyAttacks,'interaction') )
  1855. {
  1856. thePlayer.DisplayActionDisallowedHudMessage(EIAB_HeavyAttacks);
  1857. }
  1858. }
  1859. }
  1860.  
  1861. private function CheckFinisherInput() : bool
  1862. {
  1863. var enemyInCone : CActor;
  1864. var npc : CNewNPC;
  1865. var interactionTarget : CInteractionComponent;
  1866.  
  1867. var isDeadlySwordHeld : bool;
  1868.  
  1869. interactionTarget = theGame.GetInteractionsManager().GetActiveInteraction();
  1870. if ( interactionTarget && interactionTarget.GetName() == "Finish" )//|| thePlayer.GetFinisherVictim() )
  1871. {
  1872. npc = (CNewNPC)( interactionTarget.GetEntity() );
  1873.  
  1874. isDeadlySwordHeld = thePlayer.IsDeadlySwordHeld();
  1875. if( ( theInput.GetActionValue( 'AttackHeavy' ) == 1.f || theInput.GetActionValue( 'AttackLight' ) == 1.f )
  1876. && isDeadlySwordHeld )//
  1877. {
  1878. theGame.RemoveTimeScale( theGame.GetTimescaleSource(ETS_FinisherInput) );
  1879. npc.SignalGameplayEvent('Finisher');
  1880.  
  1881. }
  1882. else if ( !isDeadlySwordHeld )
  1883. {
  1884. if ( thePlayer.IsWeaponHeld( 'fist' ))
  1885. thePlayer.SetBehaviorVariable( 'combatTauntType', 1.f );
  1886. else
  1887. thePlayer.SetBehaviorVariable( 'combatTauntType', 0.f );
  1888.  
  1889. thePlayer.RaiseEvent( 'CombatTaunt' );
  1890. }
  1891.  
  1892. return true;
  1893.  
  1894. }
  1895. return false;
  1896. }
  1897.  
  1898. private function IsPlayerAbleToPerformSpecialAttack() : bool
  1899. {
  1900. if( ( thePlayer.GetCurrentStateName() == 'Exploration' ) && !( thePlayer.IsWeaponHeld( 'silversword' ) || thePlayer.IsWeaponHeld( 'steelsword' ) ) )
  1901. {
  1902. return false;
  1903. }
  1904. return true;
  1905. }
  1906.  
  1907. event OnCbtSpecialAttackWithAlternateLight( action : SInputAction )
  1908. {
  1909. CbSpecialAttackPC( action, false);
  1910. }
  1911.  
  1912. event OnCbtSpecialAttackWithAlternateHeavy( action : SInputAction )
  1913. {
  1914. CbSpecialAttackPC( action, true);
  1915. }
  1916.  
  1917. function CbSpecialAttackPC( action : SInputAction, isHeavy : bool ) // special attack for PC
  1918. {
  1919. var switchAttackType : bool;
  1920.  
  1921. switchAttackType = ShouldSwitchAttackType();
  1922.  
  1923. if ( !theInput.LastUsedPCInput() )
  1924. {
  1925. return;
  1926. }
  1927.  
  1928. if ( IsPressed(action) )
  1929. {
  1930. if ( thePlayer.IsCiri() )
  1931. {
  1932. // always heavy for Ciri
  1933. OnCbtCiriSpecialAttackHeavy(action);
  1934. }
  1935. else
  1936. {
  1937. if (switchAttackType != isHeavy) // XOR
  1938. {
  1939. OnCbtSpecialAttackHeavy(action);
  1940. }
  1941. else
  1942. {
  1943. OnCbtSpecialAttackLight(action);
  1944. }
  1945. }
  1946. }
  1947. else if ( IsReleased( action ) )
  1948. {
  1949. if ( thePlayer.IsCiri() )
  1950. {
  1951. OnCbtCiriSpecialAttackHeavy(action);
  1952. }
  1953. else
  1954. {
  1955. // to release hold actions
  1956. OnCbtSpecialAttackHeavy(action);
  1957. OnCbtSpecialAttackLight(action);
  1958. }
  1959. }
  1960. }
  1961.  
  1962. event OnCbtSpecialAttackLight( action : SInputAction )
  1963. {
  1964. if ( IsReleased( action ) )
  1965. {
  1966. thePlayer.CancelHoldAttacks();
  1967. return true;
  1968. }
  1969.  
  1970. if ( !IsPlayerAbleToPerformSpecialAttack() )
  1971. return false;
  1972.  
  1973. if( !IsActionAllowed(EIAB_LightAttacks) )
  1974. {
  1975. thePlayer.DisplayActionDisallowedHudMessage(EIAB_LightAttacks);
  1976. return false;
  1977. }
  1978. if(!IsActionAllowed(EIAB_SpecialAttackLight) )
  1979. {
  1980. thePlayer.DisplayActionDisallowedHudMessage(EIAB_SpecialAttackLight);
  1981. return false;
  1982. }
  1983.  
  1984. if( IsPressed(action) && thePlayer.CanUseSkill(S_Sword_s01) )
  1985. {
  1986. thePlayer.PrepareToAttack();
  1987. thePlayer.SetPlayedSpecialAttackMissingResourceSound(false);
  1988. thePlayer.AddTimer( 'IsSpecialLightAttackInputHeld', 0.00001, true );
  1989. }
  1990. }
  1991.  
  1992. event OnCbtSpecialAttackHeavy( action : SInputAction )
  1993. {
  1994. if ( IsReleased( action ) )
  1995. {
  1996. thePlayer.CancelHoldAttacks();
  1997. return true;
  1998. }
  1999.  
  2000. if ( !IsPlayerAbleToPerformSpecialAttack() )
  2001. return false;
  2002.  
  2003. if( !IsActionAllowed(EIAB_HeavyAttacks))
  2004. {
  2005. thePlayer.DisplayActionDisallowedHudMessage(EIAB_HeavyAttacks);
  2006. return false;
  2007. }
  2008. if(!IsActionAllowed(EIAB_SpecialAttackHeavy))
  2009. {
  2010. thePlayer.DisplayActionDisallowedHudMessage(EIAB_SpecialAttackHeavy);
  2011. return false;
  2012. }
  2013.  
  2014. if( IsPressed(action) && thePlayer.CanUseSkill(S_Sword_s02) )
  2015. {
  2016. thePlayer.PrepareToAttack();
  2017. thePlayer.SetPlayedSpecialAttackMissingResourceSound(false);
  2018. thePlayer.AddTimer( 'IsSpecialHeavyAttackInputHeld', 0.00001, true );
  2019. }
  2020. else if ( IsPressed(action) )
  2021. {
  2022. if ( theInput.IsActionPressed('AttackHeavy') )
  2023. theInput.ForceDeactivateAction('AttackHeavy');
  2024. else if ( theInput.IsActionPressed('AttackWithAlternateHeavy') )
  2025. theInput.ForceDeactivateAction('AttackWithAlternateHeavy');
  2026. }
  2027. }
  2028.  
  2029. // CiriSpecialAttack
  2030. event OnCbtCiriSpecialAttack( action : SInputAction )
  2031. {
  2032. if( !GetCiriPlayer().HasSword() )
  2033. return false;
  2034.  
  2035. if( thePlayer.GetBIsInputAllowed() && thePlayer.GetBIsCombatActionAllowed() && IsPressed(action) )
  2036. {
  2037. if ( thePlayer.HasAbility('CiriBlink') && ((W3ReplacerCiri)thePlayer).HasStaminaForSpecialAction(true) )
  2038. thePlayer.PrepareToAttack();
  2039. thePlayer.PushCombatActionOnBuffer( EBAT_Ciri_SpecialAttack, BS_Pressed );
  2040. thePlayer.ProcessCombatActionBuffer();
  2041. }
  2042. else if ( IsReleased( action ) && thePlayer.GetCombatAction() == EBAT_Ciri_SpecialAttack && thePlayer.GetBehaviorVariable( 'isPerformingSpecialAttack' ) != 0 )
  2043. {
  2044. thePlayer.PushCombatActionOnBuffer( EBAT_Ciri_SpecialAttack, BS_Released );
  2045. thePlayer.ProcessCombatActionBuffer();
  2046. }
  2047. }
  2048.  
  2049. // CiriSpecialAttackHeavy
  2050. event OnCbtCiriAttackHeavy( action : SInputAction )
  2051. {
  2052. var specialAttackAction : SInputAction;
  2053.  
  2054. if( !GetCiriPlayer().HasSword() )
  2055. return false;
  2056.  
  2057. specialAttackAction = theInput.GetAction('CiriSpecialAttackHeavy');
  2058.  
  2059. if( thePlayer.GetBIsInputAllowed() && IsReleased(action) && thePlayer.GetBehaviorVariable( 'isPerformingSpecialAttack' ) == 0 )
  2060. {
  2061. if( IsActionAllowed(EIAB_HeavyAttacks) && IsActionAllowed(EIAB_SwordAttack) )
  2062. {
  2063. if ( thePlayer.GetCurrentMeleeWeaponType() == PW_Steel )
  2064. {
  2065. thePlayer.PrepareToAttack();
  2066. thePlayer.SetupCombatAction( EBAT_HeavyAttack, BS_Released );
  2067. if ( thePlayer.GetBIsCombatActionAllowed() )
  2068. thePlayer.ProcessCombatActionBuffer();
  2069. }
  2070. }
  2071. else if ( !IsActionBlockedBy(EIAB_HeavyAttacks,'interaction') )
  2072. {
  2073. thePlayer.DisplayActionDisallowedHudMessage(EIAB_LightAttacks);
  2074. }
  2075. }
  2076. }
  2077.  
  2078. // CiriSpecialAttackHeavy
  2079. event OnCbtCiriSpecialAttackHeavy( action : SInputAction )
  2080. {
  2081. if( !GetCiriPlayer().HasSword() )
  2082. return false;
  2083.  
  2084. if( thePlayer.GetBIsInputAllowed() && thePlayer.GetBIsCombatActionAllowed() && IsPressed(action) )
  2085. {
  2086. theInput.ForceDeactivateAction('AttackWithAlternateHeavy');
  2087. thePlayer.PushCombatActionOnBuffer( EBAT_Ciri_SpecialAttack_Heavy, BS_Pressed );
  2088. thePlayer.ProcessCombatActionBuffer();
  2089. }
  2090. else if ( IsReleased( action ) && thePlayer.GetCombatAction() == EBAT_Ciri_SpecialAttack_Heavy && thePlayer.GetBehaviorVariable( 'isPerformingSpecialAttack' ) != 0 )
  2091. {
  2092. theInput.ForceDeactivateAction('CiriAttackHeavy');
  2093. theInput.ForceDeactivateAction('AttackWithAlternateHeavy');
  2094. thePlayer.PushCombatActionOnBuffer( EBAT_Ciri_SpecialAttack_Heavy, BS_Released );
  2095. thePlayer.ProcessCombatActionBuffer();
  2096. }
  2097. }
  2098.  
  2099. event OnCbtCiriDodge( action : SInputAction )
  2100. {
  2101. if( IsActionAllowed(EIAB_Dodge) && IsPressed(action) && thePlayer.IsAlive() )
  2102. {
  2103. if ( thePlayer.IsInCombatAction() && thePlayer.GetCombatAction() == EBAT_Ciri_SpecialAttack && thePlayer.GetBehaviorVariable( 'isCompletingSpecialAttack' ) <= 0 )
  2104. {
  2105. thePlayer.PushCombatActionOnBuffer( EBAT_Ciri_Dodge, BS_Pressed );
  2106. thePlayer.ProcessCombatActionBuffer();
  2107. }
  2108. else if ( thePlayer.GetBIsInputAllowed() )
  2109. {
  2110. thePlayer.PushCombatActionOnBuffer( EBAT_Ciri_Dodge, BS_Pressed );
  2111. if ( thePlayer.GetBIsCombatActionAllowed() )
  2112. thePlayer.ProcessCombatActionBuffer();
  2113. }
  2114. else
  2115. {
  2116. if ( thePlayer.IsInCombatAction() && thePlayer.GetBehaviorVariable( 'combatActionType' ) == (int)CAT_Attack )
  2117. {
  2118. if ( thePlayer.CanPlayHitAnim() && thePlayer.IsThreatened() )
  2119. {
  2120. thePlayer.CriticalEffectAnimationInterrupted("CiriDodge");
  2121. thePlayer.PushCombatActionOnBuffer( EBAT_Ciri_Dodge, BS_Pressed );
  2122. thePlayer.ProcessCombatActionBuffer();
  2123. }
  2124. else
  2125. thePlayer.PushCombatActionOnBuffer( EBAT_Ciri_Dodge, BS_Pressed );
  2126. }
  2127. }
  2128. }
  2129. else if ( !IsActionAllowed(EIAB_Dodge) )
  2130. {
  2131. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Dodge);
  2132. }
  2133. }
  2134.  
  2135. event OnCbtCiriDash( action : SInputAction )
  2136. {
  2137. if ( theInput.LastUsedGamepad() && IsPressed( action ) )
  2138. {
  2139. thePlayer.StartDodgeTimer();
  2140. }
  2141. else if( IsActionAllowed(EIAB_Dodge) && thePlayer.IsAlive() )
  2142. {
  2143. if ( theInput.LastUsedGamepad() )
  2144. {
  2145. if ( !(thePlayer.IsDodgeTimerRunning() && !thePlayer.IsInsideInteraction() && IsReleased(action)) )
  2146. return false;
  2147. }
  2148.  
  2149. if ( thePlayer.IsInCombatAction() && thePlayer.GetCombatAction() == EBAT_Ciri_SpecialAttack && thePlayer.GetBehaviorVariable( 'isCompletingSpecialAttack' ) <= 0 )
  2150. {
  2151. thePlayer.PushCombatActionOnBuffer( EBAT_Roll, BS_Released );
  2152. thePlayer.ProcessCombatActionBuffer();
  2153. }
  2154. else if ( thePlayer.GetBIsInputAllowed() )
  2155. {
  2156. thePlayer.PushCombatActionOnBuffer( EBAT_Roll, BS_Released );
  2157. if ( thePlayer.GetBIsCombatActionAllowed() )
  2158. thePlayer.ProcessCombatActionBuffer();
  2159. }
  2160. else
  2161. {
  2162. if ( thePlayer.IsInCombatAction() && thePlayer.GetBehaviorVariable( 'combatActionType' ) == (int)CAT_Attack )
  2163. {
  2164. if ( thePlayer.CanPlayHitAnim() && thePlayer.IsThreatened() )
  2165. {
  2166. thePlayer.CriticalEffectAnimationInterrupted("CiriDodge");
  2167. thePlayer.PushCombatActionOnBuffer( EBAT_Roll, BS_Released );
  2168. thePlayer.ProcessCombatActionBuffer();
  2169. }
  2170. else
  2171. thePlayer.PushCombatActionOnBuffer( EBAT_Roll, BS_Released );
  2172. }
  2173. }
  2174. }
  2175. else if ( !IsActionAllowed(EIAB_Dodge) )
  2176. {
  2177. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Dodge);
  2178. }
  2179. }
  2180.  
  2181. event OnCbtDodge( action : SInputAction )
  2182. {
  2183. if ( IsPressed(action) ) {
  2184. // PN
  2185. if ( PNFatigueOn() && PNFatigueLevel4() ) {
  2186. PNHudNotify( GetLocStringByKeyExt("HUDmessage_TooTiredToDodge") );
  2187. return false;
  2188. }
  2189. // PN
  2190. thePlayer.EvadePressed(EBAT_Dodge);
  2191. }
  2192. }
  2193.  
  2194. event OnCbtRoll( action : SInputAction )
  2195. {
  2196. // PN
  2197. if ( PNFatigueOn() && PNFatigueLevel3() ) {
  2198. PNHudNotify( GetLocStringByKeyExt("HUDmessage_TooTiredToRoll") );
  2199. return false;
  2200. }
  2201. // PN
  2202. if ( theInput.LastUsedPCInput() )
  2203. {
  2204. if ( IsPressed( action ) )
  2205. {
  2206. thePlayer.EvadePressed(EBAT_Roll);
  2207. }
  2208. }
  2209. else
  2210. {
  2211. if ( IsPressed( action ) )
  2212. {
  2213. thePlayer.StartDodgeTimer();
  2214. }
  2215. else if ( IsReleased( action ) )
  2216. {
  2217. if ( thePlayer.IsDodgeTimerRunning() )
  2218. {
  2219. thePlayer.StopDodgeTimer();
  2220. if ( !thePlayer.IsInsideInteraction() )
  2221. thePlayer.EvadePressed(EBAT_Roll);
  2222. }
  2223.  
  2224. }
  2225. }
  2226. }
  2227.  
  2228.  
  2229. var lastMovementDoubleTapName : name;
  2230.  
  2231. event OnMovementDoubleTap( action : SInputAction )
  2232. {
  2233. if ( IsPressed( action ) )
  2234. {
  2235. if ( !thePlayer.IsDodgeTimerRunning() || action.aName != lastMovementDoubleTapName )
  2236. {
  2237. thePlayer.StartDodgeTimer();
  2238. lastMovementDoubleTapName = action.aName;
  2239. }
  2240. else
  2241. {
  2242. thePlayer.StopDodgeTimer();
  2243.  
  2244. thePlayer.EvadePressed(EBAT_Dodge);
  2245. }
  2246.  
  2247. }
  2248. }
  2249.  
  2250. event OnCastSign( action : SInputAction )
  2251. {
  2252. var signSkill : ESkill;
  2253.  
  2254. if( !thePlayer.GetBIsInputAllowed() )
  2255. {
  2256. return false;
  2257. }
  2258.  
  2259. if( IsPressed(action) )
  2260. {
  2261. if( !IsActionAllowed(EIAB_Signs) )
  2262. {
  2263. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Signs);
  2264. return false;
  2265. }
  2266. /* if ( thePlayer.IsHoldingItemInLHand() && !thePlayer.IsUsableItemLBlocked() )
  2267. {
  2268. thePlayer.SetPlayerActionToRestore ( PATR_CastSign );
  2269. thePlayer.OnUseSelectedItem( true );
  2270. return true;
  2271. }
  2272. else*/ if ( thePlayer.IsHoldingItemInLHand() && thePlayer.IsUsableItemLBlocked() )
  2273. {
  2274. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Undefined, false, false, true);
  2275. return false;
  2276. }
  2277. signSkill = SignEnumToSkillEnum( thePlayer.GetEquippedSign() );
  2278. if( signSkill != S_SUndefined )
  2279. {
  2280. if(!thePlayer.CanUseSkill(signSkill))
  2281. {
  2282. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Signs, false, false, true);
  2283. return false;
  2284. }
  2285.  
  2286. if( thePlayer.HasStaminaToUseSkill( signSkill, false ) )
  2287. {
  2288. if( GetInvalidUniqueId() != thePlayer.inv.GetItemFromSlot( 'l_weapon' ) && !thePlayer.IsUsableItemLBlocked())
  2289. {
  2290. // thePlayer.OnUseSelectedItem( true);
  2291. //thePlayer.DropItemFromSlot( 'l_weapon', false );
  2292. //thePlayer.RaiseEvent( 'ItemEndL' );
  2293. }
  2294.  
  2295. thePlayer.SetupCombatAction( EBAT_CastSign, BS_Pressed );
  2296. }
  2297. else
  2298. {
  2299. thePlayer.SoundEvent("gui_no_stamina");
  2300. }
  2301. }
  2302. }
  2303. }
  2304. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2305. ///////////////////////////////// @BOMBS ////////////////////////////////////////////////////////////////////////////////////////////
  2306. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2307.  
  2308. event OnThrowBomb(action : SInputAction)
  2309. {
  2310. var selectedItemId : SItemUniqueId;
  2311.  
  2312. selectedItemId = thePlayer.GetSelectedItemId();
  2313. if(!thePlayer.inv.IsItemBomb(selectedItemId))
  2314. return false;
  2315.  
  2316. if( thePlayer.inv.SingletonItemGetAmmo(selectedItemId) == 0 )
  2317. {
  2318. //sound to indicate you have no ammo
  2319. if(IsPressed(action))
  2320. {
  2321. thePlayer.SoundEvent( "gui_ingame_low_stamina_warning" );
  2322. }
  2323.  
  2324. return false;
  2325. }
  2326.  
  2327. if ( IsReleased(action) )
  2328. {
  2329. if ( thePlayer.IsThrowHold() )
  2330. {
  2331. if ( thePlayer.playerAiming.GetAimedTarget() )
  2332. {
  2333. if ( thePlayer.AllowAttack( thePlayer.playerAiming.GetAimedTarget(), EBAT_ItemUse ) )
  2334. {
  2335. thePlayer.PushCombatActionOnBuffer( EBAT_ItemUse, BS_Released );
  2336. thePlayer.ProcessCombatActionBuffer();
  2337. }
  2338. else
  2339. thePlayer.BombThrowAbort();
  2340. }
  2341. else
  2342. {
  2343. thePlayer.PushCombatActionOnBuffer( EBAT_ItemUse, BS_Released );
  2344. thePlayer.ProcessCombatActionBuffer();
  2345. }
  2346.  
  2347. thePlayer.SetThrowHold( false );
  2348.  
  2349. return true;
  2350.  
  2351. }
  2352. else
  2353. {
  2354. if(!IsActionAllowed(EIAB_ThrowBomb))
  2355. {
  2356. thePlayer.DisplayActionDisallowedHudMessage(EIAB_ThrowBomb);
  2357. return false;
  2358. }
  2359.  
  2360. if ( thePlayer.IsHoldingItemInLHand() && !thePlayer.IsUsableItemLBlocked() )
  2361. {
  2362. thePlayer.SetPlayerActionToRestore ( PATR_ThrowBomb );
  2363. thePlayer.OnUseSelectedItem( true );
  2364. return true;
  2365. }
  2366. if(thePlayer.CanSetupCombatAction_Throw() && theInput.GetLastActivationTime( action.aName ) < 0.3f ) //why last activation time?
  2367. {
  2368. //thePlayer.PrepareToAttack();
  2369. thePlayer.SetupCombatAction( EBAT_ItemUse, BS_Pressed );
  2370. return true;
  2371. }
  2372.  
  2373. thePlayer.SetupCombatAction( EBAT_ItemUse, BS_Released );
  2374. return true;
  2375. }
  2376. }
  2377.  
  2378. return false;
  2379. }
  2380.  
  2381. event OnThrowBombHold(action : SInputAction)
  2382. {
  2383. var locks : array<SInputActionLock>;
  2384. var ind : int;
  2385.  
  2386. var selectedItemId : SItemUniqueId;
  2387.  
  2388. selectedItemId = thePlayer.GetSelectedItemId();
  2389. if(!thePlayer.inv.IsItemBomb(selectedItemId))
  2390. return false;
  2391.  
  2392. if( thePlayer.inv.SingletonItemGetAmmo(selectedItemId) == 0 )
  2393. {
  2394. //sound to indicate you have no ammo
  2395. if(IsPressed(action))
  2396. {
  2397. thePlayer.SoundEvent( "gui_ingame_low_stamina_warning" );
  2398. }
  2399.  
  2400. return false;
  2401. }
  2402.  
  2403. if( IsPressed(action) )
  2404. {
  2405. if(!IsActionAllowed(EIAB_ThrowBomb))
  2406. {
  2407. thePlayer.DisplayActionDisallowedHudMessage(EIAB_ThrowBomb);
  2408. return false;
  2409. }
  2410. else if(GetWitcherPlayer().GetBombDelay(GetWitcherPlayer().GetItemSlot(selectedItemId)) > 0 )
  2411. {
  2412. //thePlayer.DisplayActionDisallowedHudMessage(EIAB_Undefined, , , true);
  2413. return false;
  2414. }
  2415. if ( thePlayer.IsHoldingItemInLHand() && !thePlayer.IsUsableItemLBlocked() )
  2416. {
  2417. thePlayer.SetPlayerActionToRestore ( PATR_ThrowBomb );
  2418. thePlayer.OnUseSelectedItem( true );
  2419. return true;
  2420. }
  2421. if(thePlayer.CanSetupCombatAction_Throw() && theInput.GetLastActivationTime( action.aName ) < 0.3f ) //why last activation time?
  2422. {
  2423. if( thePlayer.GetBIsCombatActionAllowed() )
  2424. {
  2425. thePlayer.PushCombatActionOnBuffer( EBAT_ItemUse, BS_Pressed );
  2426. thePlayer.ProcessCombatActionBuffer();
  2427. }
  2428. }
  2429.  
  2430. //get action locks, remove bomb throw lock and check if there any other more
  2431. //the reason is that ThrowItem always sets the lock not knowing if we'll do a hold later or not, so we have to skip this one lock instance
  2432. locks = GetActionLocks(EIAB_ThrowBomb);
  2433. ind = FindActionLockIndex(EIAB_ThrowBomb, 'BombThrow');
  2434. if(ind >= 0)
  2435. locks.Erase(ind);
  2436.  
  2437. if(locks.Size() != 0)
  2438. return false;
  2439.  
  2440. thePlayer.SetThrowHold( true );
  2441. return true;
  2442. }
  2443.  
  2444. return false;
  2445. }
  2446.  
  2447. event OnThrowBombAbort(action : SInputAction)
  2448. {
  2449. if( IsPressed(action) )
  2450. {
  2451. thePlayer.BombThrowAbort();
  2452. }
  2453. }
  2454.  
  2455. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2456. ///////////////////////////////// END OF BOMBS //////////////////////////////////////////////////////////////////////////////////////
  2457. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2458.  
  2459. event OnCbtThrowItem( action : SInputAction )
  2460. {
  2461. var isUsableItem, isCrossbow, isBomb, ret : bool;
  2462. var itemId : SItemUniqueId;
  2463.  
  2464. //disabled while in air
  2465. if(thePlayer.IsInAir() || thePlayer.GetWeaponHolster().IsOnTheMiddleOfHolstering())
  2466. return false;
  2467.  
  2468. if( thePlayer.IsSwimming() && !thePlayer.OnCheckDiving() && thePlayer.GetCurrentStateName() != 'AimThrow' )
  2469. return false;
  2470.  
  2471. itemId = thePlayer.GetSelectedItemId();
  2472.  
  2473. if(!thePlayer.inv.IsIdValid(itemId))
  2474. return false;
  2475.  
  2476. isCrossbow = thePlayer.inv.IsItemCrossbow(itemId);
  2477. if(!isCrossbow)
  2478. {
  2479. isBomb = thePlayer.inv.IsItemBomb(itemId);
  2480. if(!isBomb)
  2481. {
  2482. isUsableItem = true;
  2483. }
  2484. }
  2485.  
  2486. //if ( ( isBomb || isUsableItem ) && thePlayer.rangedWeapon && thePlayer.rangedWeapon.GetCurrentStateName() != 'State_WeaponWait' )
  2487. // thePlayer.OnRangedForceHolster( true, false );
  2488.  
  2489. if( isCrossbow )
  2490. {
  2491. if ( IsActionAllowed(EIAB_Crossbow) )
  2492. {
  2493. if( IsPressed(action))
  2494. {
  2495. if ( thePlayer.IsHoldingItemInLHand() && !thePlayer.IsUsableItemLBlocked() )
  2496. {
  2497. /* thePlayer.SetPlayerActionToRestore ( PATR_None );
  2498. thePlayer.OnUseSelectedItem( true );
  2499.  
  2500. if ( thePlayer.GetBIsInputAllowed() )
  2501. {
  2502. thePlayer.SetIsAimingCrossbow( true );
  2503. thePlayer.SetupCombatAction( EBAT_ItemUse, BS_Pressed );
  2504. }
  2505.  
  2506. ret = true;*/
  2507.  
  2508. thePlayer.SetPlayerActionToRestore ( PATR_Crossbow );
  2509. thePlayer.OnUseSelectedItem( true );
  2510. ret = true;
  2511. }
  2512. else if ( thePlayer.GetBIsInputAllowed() && !thePlayer.IsCurrentlyUsingItemL() )//&& thePlayer.GetBIsCombatActionAllowed() )
  2513. {
  2514. thePlayer.SetIsAimingCrossbow( true );
  2515. thePlayer.SetupCombatAction( EBAT_ItemUse, BS_Pressed );
  2516. //thePlayer.PushCombatActionOnBuffer( EBAT_ItemUse, BS_Pressed );
  2517. //thePlayer.ProcessCombatActionBuffer();
  2518. ret = true;
  2519. }
  2520. }
  2521. else
  2522. {
  2523. // if ( thePlayer.GetIsAimingCrossbow() )
  2524. if ( thePlayer.GetIsAimingCrossbow() && !thePlayer.IsCurrentlyUsingItemL() )
  2525. {
  2526. thePlayer.SetupCombatAction( EBAT_ItemUse, BS_Released );
  2527. //thePlayer.PushCombatActionOnBuffer( EBAT_ItemUse, BS_Released );
  2528. //thePlayer.ProcessCombatActionBuffer();
  2529. thePlayer.SetIsAimingCrossbow( false );
  2530. ret = true;
  2531. }
  2532. }
  2533. }
  2534. else
  2535. {
  2536. if ( !thePlayer.IsInShallowWater() )
  2537. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Crossbow);
  2538. }
  2539.  
  2540. if ( IsPressed(action) )
  2541. thePlayer.AddTimer( 'IsItemUseInputHeld', 0.00001, true );
  2542. else
  2543. thePlayer.RemoveTimer('IsItemUseInputHeld');
  2544.  
  2545. return ret;
  2546. }
  2547. else if(isBomb)
  2548. {
  2549. return OnThrowBomb(action);
  2550. }
  2551. else if(isUsableItem && !thePlayer.IsSwimming() )
  2552. {
  2553. if( IsActionAllowed(EIAB_UsableItem) )
  2554. {
  2555. if(IsPressed(action) && thePlayer.HasStaminaToUseAction(ESAT_UsableItem))
  2556. {
  2557. thePlayer.SetPlayerActionToRestore ( PATR_Default );
  2558. thePlayer.OnUseSelectedItem();
  2559. return true;
  2560. }
  2561. /* else if ( IsReleased(action) )
  2562. {
  2563. thePlayer.SetupCombatAction( EBAT_ItemUse, BS_Released );
  2564. return true;
  2565. }*/
  2566. }
  2567. else
  2568. {
  2569. thePlayer.DisplayActionDisallowedHudMessage(EIAB_UsableItem);
  2570. }
  2571. }
  2572.  
  2573. return false;
  2574. }
  2575.  
  2576. event OnCbtThrowItemHold( action : SInputAction )
  2577. {
  2578. var isBomb, isCrossbow, isUsableItem : bool;
  2579. var itemId : SItemUniqueId;
  2580.  
  2581. //disabled while in air
  2582. if(thePlayer.IsInAir() || thePlayer.GetWeaponHolster().IsOnTheMiddleOfHolstering() )
  2583. return false;
  2584.  
  2585. if( thePlayer.IsSwimming() && !thePlayer.OnCheckDiving() && thePlayer.GetCurrentStateName() != 'AimThrow' )
  2586. return false;
  2587.  
  2588. itemId = thePlayer.GetSelectedItemId();
  2589.  
  2590. if(!thePlayer.inv.IsIdValid(itemId))
  2591. return false;
  2592.  
  2593. isCrossbow = thePlayer.inv.IsItemCrossbow(itemId);
  2594. if(!isCrossbow)
  2595. {
  2596. isBomb = thePlayer.inv.IsItemBomb(itemId);
  2597. if(isBomb)
  2598. {
  2599. return OnThrowBombHold(action);
  2600. }
  2601. else
  2602. {
  2603. isUsableItem = true;
  2604. }
  2605. }
  2606.  
  2607. //quit if action is blocked - for bomb we already checked actionLocks.Size() so there is no check here
  2608. if(IsPressed(action))
  2609. {
  2610. if( isCrossbow && !IsActionAllowed(EIAB_Crossbow) )
  2611. {
  2612. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Crossbow);
  2613. return false;
  2614. }
  2615.  
  2616. if( isUsableItem)
  2617. {
  2618. if(!IsActionAllowed(EIAB_UsableItem))
  2619. {
  2620. thePlayer.DisplayActionDisallowedHudMessage(EIAB_UsableItem);
  2621. return false;
  2622. }
  2623. else if(thePlayer.IsSwimming())
  2624. {
  2625. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Undefined, false, false, true);
  2626. return false;
  2627. }
  2628. }
  2629. }
  2630.  
  2631. if( IsPressed(action) )
  2632. {
  2633. thePlayer.SetThrowHold( true );
  2634. return true;
  2635. }
  2636. else if( IsReleased(action) && thePlayer.IsThrowHold())
  2637. {
  2638. //thePlayer.PushCombatActionOnBuffer( EBAT_ItemUse, BS_Released );
  2639. //thePlayer.ProcessCombatActionBuffer();
  2640. thePlayer.SetupCombatAction( EBAT_ItemUse, BS_Released );
  2641. thePlayer.SetThrowHold( false );
  2642. return true;
  2643. }
  2644.  
  2645. return false;
  2646. }
  2647.  
  2648. event OnCbtThrowCastAbort( action : SInputAction )
  2649. {
  2650. var player : W3PlayerWitcher;
  2651. var throwStage : EThrowStage;
  2652.  
  2653. if(thePlayer.inv.IsItemBomb(thePlayer.GetSelectedItemId()))
  2654. {
  2655. return OnThrowBombAbort(action);
  2656. }
  2657.  
  2658. if( IsPressed(action) )
  2659. {
  2660. player = GetWitcherPlayer();
  2661. if(player)
  2662. {
  2663. if( player.IsCastingSign() )
  2664. {
  2665. player.CastSignAbort();
  2666. }
  2667. else
  2668. {
  2669. if ( thePlayer.inv.IsItemCrossbow( thePlayer.inv.GetItemFromSlot( 'l_weapon' ) ) )
  2670. {
  2671. thePlayer.OnRangedForceHolster();
  2672. }
  2673. else
  2674. {
  2675. throwStage = (int)thePlayer.GetBehaviorVariable( 'throwStage', (int)TS_Stop);
  2676.  
  2677. if(throwStage == TS_Start || throwStage == TS_Loop)
  2678. player.ThrowingAbort();
  2679. }
  2680. }
  2681. }
  2682. }
  2683. }
  2684.  
  2685. event OnCbtSelectLockTarget( inputVector : Vector )
  2686. {
  2687. var newLockTarget : CActor;
  2688. var inputHeading : float;
  2689. var target : CActor;
  2690.  
  2691. inputVector.Y = inputVector.Y * -1.f;
  2692. inputHeading = VecHeading( inputVector );
  2693.  
  2694. newLockTarget = thePlayer.GetScreenSpaceLockTarget( thePlayer.GetDisplayTarget(), 180.f, 1.f, inputHeading );
  2695.  
  2696. if ( newLockTarget )
  2697. thePlayer.ProcessLockTarget( newLockTarget );
  2698.  
  2699. target = thePlayer.GetTarget();
  2700. if ( target )
  2701. {
  2702. thePlayer.SetSlideTarget( target );
  2703. //thePlayer.LockToTarget( true );
  2704. }
  2705. }
  2706.  
  2707. event OnCbtLockAndGuard( action : SInputAction )
  2708. {
  2709. if(thePlayer.IsCiri() && !GetCiriPlayer().HasSword())
  2710. return false;
  2711.  
  2712. // moved released to front due to bug where geralt would stay in guard stance if though the button is released
  2713. if( IsReleased(action) )
  2714. {
  2715. thePlayer.SetGuarded(false);
  2716. thePlayer.OnGuardedReleased();
  2717. }
  2718.  
  2719. if( (thePlayer.IsWeaponHeld('fists') || thePlayer.GetCurrentStateName() == 'CombatFists') && !IsActionAllowed(EIAB_Fists))
  2720. {
  2721. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Fists);
  2722. return false;
  2723. }
  2724.  
  2725. if( IsPressed(action) )
  2726. {
  2727. if( !IsActionAllowed(EIAB_Parry) )
  2728. {
  2729. if ( IsActionBlockedBy(EIAB_Parry,'UsableItem') )
  2730. {
  2731. thePlayer.DisplayActionDisallowedHudMessage(EIAB_Parry);
  2732. }
  2733. return true;
  2734. }
  2735.  
  2736. if ( thePlayer.GetCurrentStateName() == 'Exploration' )
  2737. thePlayer.GoToCombatIfNeeded();
  2738.  
  2739. if ( thePlayer.bLAxisReleased )
  2740. thePlayer.ResetRawPlayerHeading();
  2741.  
  2742. if ( thePlayer.rangedWeapon && thePlayer.rangedWeapon.GetCurrentStateName() != 'State_WeaponWait' )
  2743. thePlayer.OnRangedForceHolster( true, true );
  2744.  
  2745. thePlayer.AddCounterTimeStamp(theGame.GetEngineTime()); //cache counter button press to further check counter button spamming by the thePlayer
  2746. thePlayer.SetGuarded(true);
  2747. thePlayer.OnPerformGuard();
  2748. }
  2749. }
  2750.  
  2751. event OnCbtCameraLockOrSpawnHorse( action : SInputAction )
  2752. {
  2753. if ( OnCbtCameraLock(action) )
  2754. return true;
  2755.  
  2756. if ( OnCommSpawnHorse(action) )
  2757. return true;
  2758.  
  2759. return false;
  2760. }
  2761.  
  2762. event OnCbtCameraLock( action : SInputAction )
  2763. {
  2764. if( IsPressed(action) )
  2765. {
  2766. if ( thePlayer.IsThreatened() || thePlayer.IsActorLockedToTarget() )
  2767. {
  2768. if( !IsActionAllowed(EIAB_CameraLock))
  2769. {
  2770. return false;
  2771. }
  2772. else if ( !thePlayer.IsHardLockEnabled() && thePlayer.GetDisplayTarget() && (CActor)( thePlayer.GetDisplayTarget() ) && IsActionAllowed(EIAB_HardLock))
  2773. {
  2774. if ( thePlayer.bLAxisReleased )
  2775. thePlayer.ResetRawPlayerHeading();
  2776.  
  2777. thePlayer.HardLockToTarget( true );
  2778. }
  2779. else
  2780. {
  2781. thePlayer.HardLockToTarget( false );
  2782. }
  2783. return true;
  2784. }
  2785. }
  2786. return false;
  2787. }
  2788.  
  2789. event OnChangeCameraPreset( action : SInputAction )
  2790. {
  2791. if( IsPressed(action) )
  2792. {
  2793. ((CCustomCamera)theCamera.GetTopmostCameraObject()).NextPreset();
  2794. }
  2795. }
  2796.  
  2797. event OnChangeCameraPresetByMouseWheel( action : SInputAction )
  2798. {
  2799. var tolerance : float;
  2800. tolerance = 10.0f;
  2801.  
  2802. if( ( action.value * totalCameraPresetChange ) < 0.0f )
  2803. {
  2804. totalCameraPresetChange = 0.0f;
  2805. }
  2806.  
  2807. totalCameraPresetChange += action.value;
  2808. if( totalCameraPresetChange < -tolerance )
  2809. {
  2810. ((CCustomCamera)theCamera.GetTopmostCameraObject()).PrevPreset();
  2811. totalCameraPresetChange = 0.0f;
  2812. }
  2813. else if( totalCameraPresetChange > tolerance )
  2814. {
  2815. ((CCustomCamera)theCamera.GetTopmostCameraObject()).NextPreset();
  2816. totalCameraPresetChange = 0.0f;
  2817. }
  2818. }
  2819.  
  2820. event OnMeditationAbort(action : SInputAction)
  2821. {
  2822. var med : W3PlayerWitcherStateMeditation;
  2823.  
  2824. //Immersive Meditation++
  2825.  
  2826. var imInstalled : bool;
  2827.  
  2828. if( StringToFloat( theGame.GetInGameConfigWrapper().GetVarValue('ImmersiveCamPositionsMeditation', 'medRotSpeed') ) >= 0.1 )
  2829. imInstalled = true;
  2830.  
  2831. if( ((CMeditationUI)thePlayer.getMeditation()).getMedMenuBool() && imInstalled )
  2832. {
  2833. ((CMeditationUI)thePlayer.getMeditation()).NewMeditate();
  2834. }
  2835.  
  2836. //Immersive Meditation--
  2837.  
  2838. if (!theGame.GetGuiManager().IsAnyMenu())
  2839. {
  2840. med = (W3PlayerWitcherStateMeditation)GetWitcherPlayer().GetCurrentState();
  2841. if(med)
  2842. {
  2843. // If meditation is stopped with b button (as of writing this, only plugged into player input and not gameplay systems)
  2844. // the menu's should not be closed automatically.
  2845. med.StopRequested(false);
  2846. }
  2847. }
  2848. }
  2849.  
  2850. public final function ClearLocksForNGP()
  2851. {
  2852. var i : int;
  2853.  
  2854. for(i=actionLocks.Size()-1; i>=0; i-=1)
  2855. {
  2856. OnActionLockChanged(i, false);
  2857. actionLocks[i].Clear();
  2858. }
  2859. }
  2860.  
  2861. ///////////////////////////
  2862. // Debug
  2863. ///////////////////////////
  2864.  
  2865. public function Dbg_UnlockAllActions()
  2866. {
  2867. var i : int;
  2868.  
  2869. if( theGame.IsFinalBuild() )
  2870. {
  2871. return;
  2872. }
  2873.  
  2874. for(i=actionLocks.Size()-1; i>=0; i-=1)
  2875. {
  2876. OnActionLockChanged(i, false);
  2877. }
  2878. actionLocks.Clear();
  2879. }
  2880.  
  2881. event OnDbgSpeedUp( action : SInputAction )
  2882. {
  2883. if( theGame.IsFinalBuild() )
  2884. {
  2885. return false;
  2886. }
  2887.  
  2888. if(IsPressed(action))
  2889. {
  2890. theGame.SetTimeScale(4, theGame.GetTimescaleSource(ETS_DebugInput), theGame.GetTimescalePriority(ETS_DebugInput));
  2891. }
  2892. else if(IsReleased(action))
  2893. {
  2894. theGame.RemoveTimeScale( theGame.GetTimescaleSource(ETS_DebugInput) );
  2895. }
  2896. }
  2897.  
  2898. event OnDbgHit( action : SInputAction )
  2899. {
  2900. if( theGame.IsFinalBuild() )
  2901. {
  2902. return false;
  2903. }
  2904.  
  2905. if(IsReleased(action))
  2906. {
  2907. thePlayer.SetBehaviorVariable( 'HitReactionDirection',(int)EHRD_Back);
  2908. thePlayer.SetBehaviorVariable( 'isAttackReflected', 0 );
  2909. thePlayer.SetBehaviorVariable( 'HitReactionType', (int)EHRT_Heavy);
  2910. thePlayer.SetBehaviorVariable( 'HitReactionWeapon', 0);
  2911. thePlayer.SetBehaviorVariable( 'HitSwingDirection',(int)ASD_LeftRight);
  2912. thePlayer.SetBehaviorVariable( 'HitSwingType',(int)AST_Horizontal);
  2913.  
  2914. thePlayer.RaiseForceEvent( 'Hit' );
  2915. thePlayer.OnRangedForceHolster( true );
  2916. GetWitcherPlayer().SetCustomRotation( 'Hit', thePlayer.GetHeading()+180, 1080.f, 0.1f, false );
  2917. thePlayer.CriticalEffectAnimationInterrupted("OnDbgHit");
  2918. }
  2919. }
  2920.  
  2921. event OnDbgKillTarget( action : SInputAction )
  2922. {
  2923. var target : CActor;
  2924.  
  2925. if( theGame.IsFinalBuild() )
  2926. {
  2927. return false;
  2928. }
  2929.  
  2930. target = thePlayer.GetTarget();
  2931.  
  2932. if( target && IsReleased(action) )
  2933. {
  2934. target.Kill( 'Debug' );
  2935. }
  2936. }
  2937.  
  2938. event OnDbgKillAll( action : SInputAction )
  2939. {
  2940. if( theGame.IsFinalBuild() )
  2941. {
  2942. return false;
  2943. }
  2944.  
  2945. if(IsReleased(action))
  2946. thePlayer.DebugKillAll();
  2947. }
  2948.  
  2949. //Nuke - kills all actors targeting thePlayer on the entire level
  2950. event OnDbgKillAllTargetingPlayer( action : SInputAction )
  2951. {
  2952. var i : int;
  2953. var all : array<CActor>;
  2954.  
  2955. if( theGame.IsFinalBuild() )
  2956. {
  2957. return false;
  2958. }
  2959.  
  2960. if(IsPressed(action))
  2961. {
  2962. all = GetActorsInRange(thePlayer, 10000, 10000, '', true);
  2963. for(i=0; i<all.Size(); i+=1)
  2964. {
  2965. if(all[i] != thePlayer && all[i].GetTarget() == thePlayer)
  2966. all[i].Kill( 'Debug' );
  2967. }
  2968. }
  2969. }
  2970.  
  2971. event OnDbgTeleportToPin( action : SInputAction )
  2972. {
  2973. if( theGame.IsFinalBuild() )
  2974. {
  2975. return false;
  2976. }
  2977.  
  2978. if(IsReleased(action))
  2979. thePlayer.DebugTeleportToPin();
  2980. }
  2981. ///////////////////////////
  2982. // @Boat
  2983. ///////////////////////////
  2984. event OnBoatDismount( action : SInputAction )
  2985. {
  2986. var boatComp : CBoatComponent;
  2987. var stopAction : SInputAction;
  2988.  
  2989. stopAction = theInput.GetAction('GI_Decelerate');
  2990.  
  2991. if( IsReleased(action) && ( theInput.LastUsedPCInput() || ( stopAction.value < 0.7 && stopAction.lastFrameValue < 0.7 ) ) )
  2992. {
  2993. if( thePlayer.IsActionAllowed( EIAB_DismountVehicle ) )
  2994. {
  2995. boatComp = (CBoatComponent)thePlayer.GetUsedVehicle().GetComponentByClassName( 'CBoatComponent' );
  2996. boatComp.IssueCommandToDismount( DT_normal );
  2997. }
  2998. else
  2999. {
  3000. thePlayer.DisplayActionDisallowedHudMessage(EIAB_DismountVehicle);
  3001. }
  3002. }
  3003. }
  3004.  
  3005. ///////////////////////////
  3006. // @Replacers
  3007. ///////////////////////////
  3008.  
  3009. event OnCiriDrawWeapon( action : SInputAction )
  3010. {
  3011. var duringCastSign : bool;
  3012.  
  3013. //draw weapon
  3014. if ( IsReleased(action) || ( IsPressed(action) && (thePlayer.GetCurrentMeleeWeaponType() == PW_None || thePlayer.GetCurrentMeleeWeaponType() == PW_Fists) ) )
  3015. {
  3016. if ( thePlayer.GetBIsInputAllowed() && thePlayer.GetBIsCombatActionAllowed() )
  3017. {
  3018. if (thePlayer.GetCurrentMeleeWeaponType() == PW_Steel && !thePlayer.IsThreatened() )
  3019. thePlayer.OnEquipMeleeWeapon( PW_None, false );
  3020. else
  3021. thePlayer.OnEquipMeleeWeapon( PW_Steel, false );
  3022. }
  3023. }
  3024. else if(IsReleased(action) || ( IsPressed(action) && (thePlayer.GetCurrentMeleeWeaponType() == PW_Steel || thePlayer.GetCurrentMeleeWeaponType() == PW_Silver) ) )
  3025. {
  3026. CiriSheatheWeapon();
  3027. }
  3028. }
  3029.  
  3030. event OnCiriHolsterWeapon( action : SInputAction )
  3031. {
  3032. var currWeaponType : EPlayerWeapon;
  3033.  
  3034. if(IsPressed( action ))
  3035. {
  3036. currWeaponType = thePlayer.GetCurrentMeleeWeaponType();
  3037.  
  3038. if(currWeaponType == PW_Steel || currWeaponType == PW_Silver)
  3039. {
  3040. CiriSheatheWeapon();
  3041. }
  3042. }
  3043. }
  3044.  
  3045. private final function CiriSheatheWeapon()
  3046. {
  3047. if ( thePlayer.GetBIsInputAllowed() && thePlayer.GetBIsCombatActionAllowed() && !thePlayer.IsThreatened() )
  3048. {
  3049. thePlayer.OnEquipMeleeWeapon( PW_None, false );
  3050. }
  3051. }
  3052.  
  3053. ///////////////////////////
  3054. // @Replacers
  3055. ///////////////////////////
  3056. event OnCommHoldFastMenu( action : SInputAction )
  3057. {
  3058. if(IsPressed(action))
  3059. {
  3060. holdFastMenuInvoked = true;
  3061. PushInventoryScreen();
  3062. }
  3063. }
  3064.  
  3065. event OnFastMenu( action : SInputAction )
  3066. {
  3067. if( IsReleased(action) )
  3068. {
  3069. if(holdFastMenuInvoked)
  3070. {
  3071. holdFastMenuInvoked = false;
  3072. return false;
  3073. }
  3074.  
  3075. if ( theGame.IsBlackscreenOrFading() )
  3076. {
  3077. return false;
  3078. }
  3079.  
  3080. if (theGame.GetGuiManager().IsAnyMenu())
  3081. {
  3082. return false;
  3083. }
  3084.  
  3085. if( IsActionAllowed( EIAB_OpenFastMenu ) )
  3086. {
  3087. theGame.SetMenuToOpen( '' );
  3088. theGame.RequestMenu('CommonMenu' );
  3089. }
  3090. else
  3091. {
  3092. thePlayer.DisplayActionDisallowedHudMessage(EIAB_OpenFastMenu);
  3093. }
  3094. }
  3095. }
  3096.  
  3097. event OnIngameMenu( action : SInputAction )
  3098. {
  3099. //Immersive Meditation++
  3100. var passedSecondsInGameTime : float;
  3101. var passedSecondsInRealTime : float;
  3102. var imInstalled : bool;
  3103. //Immersive Meditation--
  3104.  
  3105. var openedPanel : name;
  3106.  
  3107. openedPanel = theGame.GetMenuToOpen();
  3108. // #Y avoid opening menu on release after opening TutorialsMenu on hold
  3109. if( IsReleased(action) && openedPanel != 'GlossaryTutorialsMenu' && !theGame.GetGuiManager().IsAnyMenu() )
  3110. if( IsReleased(action) && openedPanel != 'GlossaryTutorialsMenu' && !theGame.GetGuiManager().IsAnyMenu() ) // #B very ugly :P
  3111. //Immersive Meditation++
  3112. if( StringToFloat( theGame.GetInGameConfigWrapper().GetVarValue('ImmersiveCamPositionsMeditation', 'medRotSpeed') ) >= 0.1 )
  3113. imInstalled = true;
  3114.  
  3115. if ( IsReleased(action) )
  3116. {
  3117. if( ((CMeditationUI)thePlayer.getMeditation()).getMedMenuBool() && imInstalled )
  3118. {
  3119. ((CMeditationUI)thePlayer.getMeditation()).NewMeditate();
  3120. passedSecondsInGameTime = GameTimeToSeconds(theGame.GetGameTime() - ((CMeditationUI)thePlayer.getMeditation()).getWaitStartTime());
  3121. passedSecondsInRealTime = ConvertGameSecondsToRealTimeSeconds(passedSecondsInGameTime);
  3122. if (passedSecondsInRealTime > 7.0)
  3123. {
  3124. ((W3Campfire)((CMeditationUI)thePlayer.getMeditation()).GetCampFire()).AddTimer('UnLight',1.7,false);
  3125. }
  3126. else
  3127. {
  3128. ((W3Campfire)((CMeditationUI)thePlayer.getMeditation()).GetCampFire()).AddTimer('UnLight',(8.7-passedSecondsInRealTime),false);
  3129. }
  3130. }
  3131. //Immersive Meditation--
  3132. else if( IsReleased(action) && openedPanel != 'GlossaryTutorialsMenu' && !theGame.GetGuiManager().IsAnyMenu() ) // #B very ugly :P
  3133. {
  3134. if ( theGame.IsBlackscreenOrFading() )
  3135. return false;
  3136.  
  3137. theGame.SetMenuToOpen( '' );
  3138. theGame.RequestMenu('CommonIngameMenu' );
  3139. }
  3140. }
  3141. }
  3142.  
  3143. event OnToggleHud( action : SInputAction )
  3144. {
  3145. var hud : CR4ScriptedHud;
  3146. if ( IsReleased(action) )
  3147. {
  3148. hud = (CR4ScriptedHud)theGame.GetHud();
  3149. if ( hud )
  3150. {
  3151. hud.ToggleHudByUser();
  3152. }
  3153. }
  3154. }
  3155.  
  3156. public final function Debug_ClearAllActionLocks(optional action : EInputActionBlock, optional all : bool)
  3157. {
  3158. var i : int;
  3159.  
  3160. if(all)
  3161. {
  3162. Dbg_UnlockAllActions();
  3163. }
  3164. else
  3165. {
  3166. OnActionLockChanged(action, false);
  3167. actionLocks[action].Clear();
  3168. }
  3169. }
  3170.  
  3171. public final function OnAutoLootRadiusLoot(action : SInputAction)
  3172. {
  3173. if(IsPressed(action))
  3174. {
  3175. AL_LootInRadius();
  3176. }
  3177. }
  3178. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement