public override void SpawnSetup(Map map, bool respawningAfterLoad)
 {
     base.SpawnSetup(map, respawningAfterLoad);
     channelsBasic    = this.TryGetUpgrade(ChannelsBasicUpgradeId);
     channelsAdvanced = this.TryGetUpgrade(ChannelsAdvancedUpgradeId);
     channels         = GetComp <CompChannelSelector>();
     power            = GetComp <CompPowerTrader>();
     ConfigureChannelComp();
 }
        public override string CompInspectStringExtra()
        {
            var s = new StringBuilder();

            if (WantsWork)
            {
                s.AppendFormat("Upgrade_labelPrefix".Translate(), Props.label);
                s.AppendLine();
                s.AppendFormat("Upgrade_workProgress".Translate(), Mathf.Round(WorkProgress * 100f));
                if (Props.costList.Any())
                {
                    s.Append("; ");
                    s.AppendFormat("Upgrade_deliveredIngredients".Translate(), ingredients.ContentsString);
                }
            }
            CompUpgrade firstUpgrade = null;
            var         anyComplete  = false;

            for (var i = 0; i < parent.AllComps.Count; i++)
            {
                var upgrade = parent.AllComps[i] as CompUpgrade;
                if (firstUpgrade == null)
                {
                    firstUpgrade = upgrade;
                }
                if (upgrade != null && upgrade.Complete)
                {
                    anyComplete = true;
                }
            }
            if (firstUpgrade == this && anyComplete)
            {
                if (s.Length > 0)
                {
                    s.AppendLine();
                }
                s.Append("Upgrade_installedUpgrades".Translate());
                var numEntries = 0;
                for (var i = 0; i < parent.AllComps.Count; i++)
                {
                    if (parent.AllComps[i] is CompUpgrade upgrade && upgrade.Complete)
                    {
                        if (numEntries > 0)
                        {
                            s.Append(", ");
                        }
                        s.Append(upgrade.Props.label);
                        numEntries++;
                    }
                }
            }
            return(s.ToString());
        }
 public override void SpawnSetup(Map map, bool respawningAfterLoad)
 {
     base.SpawnSetup(map, respawningAfterLoad);
     angleStat    = this.GetCachedStat(Resources.Stat.rxSensorAngle);
     speedStat    = this.GetCachedStat(Resources.Stat.rxSensorSpeed);
     rangeStat    = this.GetCachedStat(Resources.Stat.rxSensorRange);
     powerComp    = GetComp <CompPowerTrader>();
     wiredComp    = GetComp <CompWiredDetonationSender>();
     wirelessComp = GetComp <CompWirelessDetonationGridNode>();
     channelsComp = GetComp <CompChannelSelector>();
     brainComp    = this.TryGetUpgrade(AIUpgrageReferenceId);
     lightComp    = GetComp <CompAIPilotLight>();
     glowerComp   = GetComp <CompGlowerToggleable>();
     UpdateUpgradeableStuff();
 }
 private void GetCompRefs()
 {
     channelsUpgrade = this.TryGetUpgrade(ChannelsUpgradeId);
     node            = this.RequireComp <CompWirelessDetonationGridNode>();
     channelsComp    = GetComp <CompChannelSelector>()?.Configure(false, false, false, RemoteTechUtility.ChannelType.Basic);
 }