Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***********************************************************************/
- /** © 2015 CD PROJEKT S.A. All rights reserved.
- /** THE WITCHER® is a trademark of CD PROJEKT S. A.
- /** The Witcher game is based on the prose of Andrzej Sapkowski.
- /***********************************************************************/
- // THIS VERSION IS ONLY FOR COMPATIBILITY WHEN ALSO USING THE MOD "RESTORED CONTENT - ADDITIONAL PERKS - NEXT-GEN" v1.3A
- abstract class W3RepairObjectEnhancement extends CBaseGameplayEffect
- {
- // ++Restored Content - Additional Perks - Next-Gen
- protected var usesPerkBonus : bool;
- protected var durUpdates : bool;
- // --Restored Content - Additional Perks - Next-Gen
- // ++Buff Charges - Grindstone and Workbench Only
- private saved var currCount : int;
- private saved var maxCount : int;
- // --Buff Charges - Grindstone and Workbench Only
- default isPositive = true;
- default isNeutral = false;
- default isNegative = false;
- default usesPerkBonus = false;
- public function OnTimeUpdated(dt : float)
- {
- // ++Restored Content - Additional Perks - Next-Gen
- var hasRuneword5 : bool;
- if(isOnPlayer)
- hasRuneword5 = GetWitcherPlayer().HasRunewordActive('Runeword 5 _Stats');
- else
- hasRuneword5 = false;
- if(hasRuneword5)
- {
- if( isActive && pauseCounters.Size() == 0)
- {
- timeActive += dt;
- }
- timeLeft = 0.f;
- durUpdates = false;
- return;
- }
- else if(!durUpdates)
- {
- timeLeft = duration - timeActive;
- durUpdates = true;
- }
- super.OnTimeUpdated(dt);
- }
- protected function CalculateDuration(optional setInitialDuration : bool)
- {
- var mul : SAbilityAttributeValue;
- super.CalculateDuration(setInitialDuration);
- if( isOnPlayer && GetWitcherPlayer() )
- {
- if( GetWitcherPlayer().CanUseSkill( S_Perk_26 ) )
- {
- mul = GetWitcherPlayer().GetSkillAttributeValue( S_Perk_26, 'duration', false, false );
- duration = mul.valueAdditive;
- }
- }
- // --Restored Content - Additional Perks - Next-Gen
- }
- // ++Buff Charges - Grindstone and Workbench Only
- event OnEffectAdded(customParams : W3BuffCustomParams)
- {
- var enhancementParams : W3EnhancementBuffParams;
- enhancementParams = (W3EnhancementBuffParams)customParams;
- if(enhancementParams)
- {
- currCount = enhancementParams.currCount;
- maxCount = enhancementParams.maxCount;
- }
- super.OnEffectAdded(customParams);
- }
- protected function Show( visible : bool )
- {
- if( visible )
- {
- }
- else
- {
- GetWitcherPlayer().RemoveBuff( this.effectType );
- }
- }
- public final function Reapply( newMax : int )
- {
- maxCount = newMax;
- currCount = newMax;
- }
- public final function ReduceAmmo()
- {
- if( currCount == 1 )
- {
- Show( false );
- }
- currCount = Max( 0, currCount - 1 );
- }
- public final function GetAmmoMaxCount() : int
- {
- return maxCount;
- }
- public final function GetAmmoCurrentCount() : int
- {
- return currCount;
- }
- }
- class W3EnhancementBuffParams extends W3BuffCustomParams
- {
- var currCount : int;
- var maxCount : int;
- // --Buff Charges - Grindstone and Workbench Only
- }
Advertisement
Comments
-
- 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"
-
- This file is only for The Witcher 3 Next-Gen update (4.0+) and corresponding versions of the mods.
- Buff Charges (only for the "Grindstone and Workbench Only" download):
- https://www.nexusmods.com/witcher3/mods/7383
- Restored Content - Additional Perks - Next-Gen
- https://www.nexusmods.com/witcher3/mods/7273
Add Comment
Please, Sign In to add comment
Advertisement