104 lines
4.3 KiB
C#
104 lines
4.3 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace GazeLab.Data
|
|
{
|
|
public enum MetaUpgradeEffectType
|
|
{
|
|
StartingScrapFlat,
|
|
StartingGoldAndUranium,
|
|
ResourceYieldAndMagnet,
|
|
BaseHullMultiplier,
|
|
BaseShieldAndRegen,
|
|
ReactiveArmorCore,
|
|
BaseFireRateMultiplier,
|
|
BaseDamageMultiplier,
|
|
NeuralGazeSynchronizer,
|
|
AbilityCooldownReduction,
|
|
TechTreeCostDiscount,
|
|
ApexCommandLegacy
|
|
}
|
|
|
|
[Serializable]
|
|
public struct MetaNodePrerequisite
|
|
{
|
|
public MetaUpgradeNodeSO parentNode;
|
|
[Tooltip("Minimum rank the parent node must reach before this node unlocks.")]
|
|
[Range(1, 5)] public int minRequiredRank;
|
|
}
|
|
|
|
[CreateAssetMenu(fileName = "MetaNode_", menuName = "GazeLab/Meta/Meta Upgrade Node", order = 1)]
|
|
public sealed class MetaUpgradeNodeSO : ScriptableObject
|
|
{
|
|
[Header("Node Identity & Track")]
|
|
public string nodeId = "meta_pioneer_protocol";
|
|
public string displayName = "Pioneer Protocol";
|
|
[TextArea(2, 3)]
|
|
public string description = "+15 Starting Scrap on every run.";
|
|
public string shortName = "PIONEER";
|
|
public TechBranchTrack branchTrack = TechBranchTrack.Core;
|
|
public int treeTier = 1;
|
|
public Vector2 normalizedGraphPosition = new Vector2(0.08f, 0.5f);
|
|
|
|
[Header("Progression & Cost")]
|
|
[Range(1, 5)] public int maxRank = 1;
|
|
[Tooltip("Cost in Mastery Points per rank.")]
|
|
[Range(1, 5)] public int pointCostPerRank = 1;
|
|
|
|
[Header("Prerequisites")]
|
|
public MetaNodePrerequisite[] prerequisites;
|
|
|
|
[Header("Visuals & Container")]
|
|
public Sprite icon;
|
|
public TechNodeContainerStyle containerStyle = TechNodeContainerStyle.Small;
|
|
public Sprite customContainerSprite;
|
|
|
|
[Header("Bonus Effect Mechanics")]
|
|
public MetaUpgradeEffectType effectType;
|
|
[Tooltip("Primary effect value added/multiplied per rank.")]
|
|
public float primaryValuePerRank;
|
|
[Tooltip("Secondary effect value (e.g. Uranium or Magnet Range) per rank.")]
|
|
public float secondaryValuePerRank;
|
|
|
|
public int TotalPointCost => maxRank * pointCostPerRank;
|
|
|
|
public string GetEffectDescriptionForRank(int rank)
|
|
{
|
|
if (rank <= 0) return "Not unlocked yet.";
|
|
float pVal = primaryValuePerRank * rank;
|
|
float sVal = secondaryValuePerRank * rank;
|
|
|
|
switch (effectType)
|
|
{
|
|
case MetaUpgradeEffectType.StartingScrapFlat:
|
|
return $"+{Mathf.RoundToInt(pVal)} Starting Scrap";
|
|
case MetaUpgradeEffectType.StartingGoldAndUranium:
|
|
return $"+{Mathf.RoundToInt(pVal)} Starting Gold & +{Mathf.RoundToInt(sVal)} Starting Uranium";
|
|
case MetaUpgradeEffectType.ResourceYieldAndMagnet:
|
|
return $"+{pVal:F0}% Resource Drop Yield & +{sVal:F2}m Magnet Radius";
|
|
case MetaUpgradeEffectType.BaseHullMultiplier:
|
|
return $"+{pVal:F0}% Station Base Max Hull";
|
|
case MetaUpgradeEffectType.BaseShieldAndRegen:
|
|
return $"+{pVal:F0}% Base Shield Capacity & +{sVal:F1} Shield Regen/sec";
|
|
case MetaUpgradeEffectType.ReactiveArmorCore:
|
|
return $"+{pVal:F0}% Flat Damage Reduction & +{Mathf.RoundToInt(sVal)} Base Max Hull";
|
|
case MetaUpgradeEffectType.BaseFireRateMultiplier:
|
|
return $"+{pVal:F0}% Base Turret Fire Rate";
|
|
case MetaUpgradeEffectType.BaseDamageMultiplier:
|
|
return $"+{pVal:F0}% Base Turret Projectile Damage";
|
|
case MetaUpgradeEffectType.NeuralGazeSynchronizer:
|
|
return $"-{pVal:F0}% Gaze Lock Dwell Time & +{sVal:F0}% Auto-Turret Fire Rate";
|
|
case MetaUpgradeEffectType.AbilityCooldownReduction:
|
|
return $"+{pVal:F0}% Ability Cooldown Recovery Speed";
|
|
case MetaUpgradeEffectType.TechTreeCostDiscount:
|
|
return $"-{pVal:F0}% In-Run Tech Tree Resource Costs";
|
|
case MetaUpgradeEffectType.ApexCommandLegacy:
|
|
return "Start runs with Harpoon Ability & +1 Extra Turret Hardpoint";
|
|
default:
|
|
return description;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|