Advertisement
lufusol

repairObjectEnhancement.ws

Dec 26th, 2022 (edited)
1,478
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /***********************************************************************/
  2. /**     © 2015 CD PROJEKT S.A. All rights reserved.
  3. /**     THE WITCHER® is a trademark of CD PROJEKT S. A.
  4. /**     The Witcher game is based on the prose of Andrzej Sapkowski.
  5. /***********************************************************************/
  6. // THIS VERSION IS ONLY FOR COMPATIBILITY WHEN ALSO USING THE MOD "RESTORED CONTENT - ADDITIONAL PERKS - NEXT-GEN" v1.3A
  7.  
  8.  
  9.  
  10. abstract class W3RepairObjectEnhancement extends CBaseGameplayEffect
  11. {
  12.     // ++Restored Content - Additional Perks - Next-Gen
  13.     protected var usesPerkBonus : bool;
  14.     protected var durUpdates : bool;
  15.     // --Restored Content - Additional Perks - Next-Gen
  16.    
  17.     // ++Buff Charges - Grindstone and Workbench Only
  18.     private saved var currCount : int;         
  19.     private saved var maxCount : int;  
  20.     // --Buff Charges - Grindstone and Workbench Only
  21.    
  22.     default isPositive = true;
  23.     default isNeutral = false;
  24.     default isNegative = false;
  25.     default usesPerkBonus = false;
  26.    
  27.     public function OnTimeUpdated(dt : float)
  28.     {
  29.     // ++Restored Content - Additional Perks - Next-Gen
  30.         var hasRuneword5 : bool;
  31.        
  32.        
  33.         if(isOnPlayer)
  34.             hasRuneword5 = GetWitcherPlayer().HasRunewordActive('Runeword 5 _Stats');
  35.         else
  36.             hasRuneword5 = false;
  37.        
  38.         if(hasRuneword5)
  39.         {
  40.             if( isActive && pauseCounters.Size() == 0)
  41.             {
  42.                 timeActive += dt;  
  43.             }
  44.            
  45.             timeLeft = 0.f;
  46.             durUpdates = false;
  47.             return;
  48.         }
  49.         else if(!durUpdates)
  50.         {
  51.             timeLeft = duration - timeActive;
  52.             durUpdates = true;
  53.         }
  54.        
  55.         super.OnTimeUpdated(dt);
  56.     }
  57.    
  58.     protected function CalculateDuration(optional setInitialDuration : bool)
  59.     {
  60.         var  mul : SAbilityAttributeValue;
  61.  
  62.         super.CalculateDuration(setInitialDuration);
  63.  
  64.         if( isOnPlayer && GetWitcherPlayer() )
  65.         {  
  66.             if( GetWitcherPlayer().CanUseSkill( S_Perk_26 ) )
  67.             {
  68.                 mul = GetWitcherPlayer().GetSkillAttributeValue( S_Perk_26, 'duration', false, false );
  69.                 duration = mul.valueAdditive;
  70.             }
  71.         }
  72.     // --Restored Content - Additional Perks - Next-Gen
  73.     }
  74.  
  75.     // ++Buff Charges - Grindstone and Workbench Only
  76.     event OnEffectAdded(customParams : W3BuffCustomParams)
  77.     {
  78.         var enhancementParams : W3EnhancementBuffParams;       
  79.        
  80.         enhancementParams = (W3EnhancementBuffParams)customParams;
  81.         if(enhancementParams)
  82.         {
  83.             currCount = enhancementParams.currCount;
  84.             maxCount = enhancementParams.maxCount;
  85.         }
  86.        
  87.         super.OnEffectAdded(customParams);
  88.     }
  89.    
  90.     protected function Show( visible : bool )
  91.     {  
  92.         if( visible )
  93.         {
  94.         }
  95.         else
  96.         {
  97.             GetWitcherPlayer().RemoveBuff( this.effectType );
  98.         }  
  99.     }
  100.    
  101.     public final function Reapply( newMax : int )
  102.     {
  103.         maxCount = newMax;
  104.         currCount = newMax;    
  105.     }
  106.    
  107.     public final function ReduceAmmo()
  108.     {
  109.         if( currCount == 1 )
  110.         {
  111.             Show( false );
  112.         }
  113.        
  114.         currCount = Max( 0, currCount - 1 );
  115.     }
  116.    
  117.     public final function GetAmmoMaxCount() : int
  118.     {
  119.         return maxCount;
  120.     }
  121.  
  122.     public final function GetAmmoCurrentCount() : int
  123.     {
  124.         return currCount;
  125.     }
  126. }
  127.  
  128. class W3EnhancementBuffParams extends W3BuffCustomParams
  129. {
  130.     var currCount : int;
  131.     var maxCount : int;
  132.     // --Buff Charges - Grindstone and Workbench Only
  133. }
  134.  
Advertisement
Comments
  • lufusol
    1 year
    # text 0.53 KB | 0 0
    1. This script creates compatibility between the mods "Buff Charges (Grindstone and Workbench Only)" and "Restored Content - Additional Perks - Next-Gen". To make use of it, you must first install both mods, then search both mod subfolders for "repairObjectEnhancement.ws" and either replace both of those files with this one, or replace one of them and delete the other (doesn't matter which). Be sure you re-run ScriptMerger and delete your existing script(s) and re-merge, if you already had a merge which affected "repairObjectEnhancement.ws"
  • lufusol
    1 year
    # text 0.31 KB | 0 0
    1. This file is only for The Witcher 3 Next-Gen update (4.0+) and corresponding versions of the mods.
    2.  
    3. Buff Charges (only for the "Grindstone and Workbench Only" download):
    4. https://www.nexusmods.com/witcher3/mods/7383
    5.  
    6. Restored Content - Additional Perks - Next-Gen
    7. https://www.nexusmods.com/witcher3/mods/7273
Add Comment
Please, Sign In to add comment
Advertisement