diff options
Diffstat (limited to 'Thronefall_1_57/Decompile/Thronefall/PerkRangeModifyer.cs')
| -rw-r--r-- | Thronefall_1_57/Decompile/Thronefall/PerkRangeModifyer.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Thronefall_1_57/Decompile/Thronefall/PerkRangeModifyer.cs b/Thronefall_1_57/Decompile/Thronefall/PerkRangeModifyer.cs new file mode 100644 index 0000000..5e685fa --- /dev/null +++ b/Thronefall_1_57/Decompile/Thronefall/PerkRangeModifyer.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +public class PerkRangeModifyer : MonoBehaviour +{ + public Equippable requiredPerk; + + [BalancingParameter(BalancingParameter.EType.PercentageModifyer)] + public float rangeMultiplyer; + + public AutoAttack autoAttack; + + public PathfindMovementPlayerunit pathfindMovement; + + public bool IsActive => PerkManager.IsEquipped(requiredPerk); + + private void Start() + { + if (PerkManager.IsEquipped(requiredPerk)) + { + foreach (TargetPriority targetPriority in autoAttack.targetPriorities) + { + targetPriority.range *= rangeMultiplyer; + } + if ((bool)pathfindMovement) + { + pathfindMovement.keepDistanceOf *= rangeMultiplyer; + } + } + Object.Destroy(this); + } +} |
