Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
        // 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);
        }
Exemplo n.º 4
0
 public CreepTransfer(Creep crp, IEnergySource src)
 {
     Creep  = crp;
     Source = src;
 }
Exemplo n.º 5
0
 public CreepHarvest(Creep crp, IEnergySource src)
 {
     Creep  = crp;
     Source = src;
 }