public override void SpawnSetup(Map map, bool respawningAfterLoad) { _energySource = EnergySourceUtility.Find(this); _shield = ShieldUtility.FindComp(this); _heatSink = HeatsinkUtility.FindComp(this); _activeLastTick = IsActive; base.SpawnSetup(map, respawningAfterLoad); }
public override void PostSpawnSetup(bool respawningAfterLoad) { base.PostSpawnSetup(respawningAfterLoad); _cellCount = GenRadial.NumCellsInRadius(_fieldRadius); _positionLast = parent.Position; _radiusLast = (int)Radius; _energySource = EnergySourceUtility.Find(parent); _heatSink = HeatsinkUtility.Find(parent); _resistance = parent.TryGetComp <Comp_ShieldResistance>(); parent.Map.GetComponent <ShieldManager>().Add(this); LessonAutoActivator.TeachOpportunity(ConceptDef.Named("FD_Shields"), OpportunityType.Critical); }
// use LINQ instead? : public int GetActiveBodyParts( BodyPartTypes type ) public Result Harvest(IEnergySource target) { var result = new Result { TypeID = ResultTypes.UnknownError }; int range = Pos.GetRangeTo(target.Pos); if (range <= 1) { result = Game.AddAction(new CreepHarvest(this, target)); } else { result = new Result { TypeID = ResultTypes.TooFar }; } return(result); }
public CreepTransfer(Creep crp, IEnergySource src) { Creep = crp; Source = src; }
public CreepHarvest(Creep crp, IEnergySource src) { Creep = crp; Source = src; }