Esempio n. 1
0
 public override void PostSpawnSetup(bool respawningAfterLoad)
 {
     props = RemoteTechController.Instance.CloneObject(props);             // make a copy of our props so we can manipulate them
     this.RequireComponent(BatteryProps);
     base.PostSpawnSetup(respawningAfterLoad);
     statMaxEnergy = parent.GetCachedStat(Resources.Stat.rxPowerCapacity);
     UpdateStoredEnergyMax();
     if (statMaxEnergy <= 0f)
     {
         RemoteTechController.Instance.Logger.Error($"{nameof(CompStatBattery)} has zero power capacity. Missing rxPowerCapacity stat in def {parent.def.defName}?");
     }
 }
Esempio n. 2
0
 public override void SpawnSetup(Map map, bool respawningAfterLoad)
 {
     base.SpawnSetup(map, respawningAfterLoad);
     powerComp      = GetComp <CompPowerTrader>();
     statVentAmount = this.GetCachedStat(Resources.Stat.rxVentingPower);
     targetCell     = Position + IntVec3.North.RotatedBy(Rotation);
     sourceCell     = Position + IntVec3.South.RotatedBy(Rotation);
     ventProps      = def.building as BuildingProperties_GasVent;
     if (ventProps == null)
     {
         RemoteTechController.Instance.Logger.Error("Building_GasVent requires BuildingProperties_GasVent");
     }
 }
 public CompChannelSelector()
 {
     gizmoCallback = c => {
         DesiredChannel = c;
         if (!manualSwitching)
         {
             DoSwitch();
         }
         parent.BroadcastCompSignal(DesiredChannelChangedSignal);
     };
     channelPopulation = new CachedValue <Dictionary <int, List <IWirelessDetonationReceiver> > >(
         () => readPopulation ? RemoteTechUtility.FindReceiversInNetworkRange(parent) : null
         );
 }
 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();
 }
Esempio n. 5
0
 public override void PostSpawnSetup(bool respawningAfterLoad)
 {
     statPowerConsumption = parent.GetCachedStat(Resources.Stat.rxPowerConsumption);
     statSunExposure      = parent.GetCachedStat(Resources.Stat.rxSunExposure);
 }