示例#1
0
        public void AfterTransform(Actor toActor)
        {
            //When transform complete, assign the slaves to this transform actor
            SlaveMinerHarvester harvesterMaster = toActor.Trait <SlaveMinerHarvester>();

            foreach (var se in SlaveEntries)
            {
                se.SpawnerSlave.LinkMaster(se.Actor, toActor, harvesterMaster);
                se.SpawnerSlave.Stop(se.Actor);
                if (!se.Actor.IsDead)
                {
                    se.Actor.QueueActivity(new Follow(se.Actor, Target.FromActor(toActor), WDist.FromCells(1), WDist.FromCells(3), null));
                }
            }
            harvesterMaster.AssignSlavesToMaster(SlaveEntries);
            if (force)
            {
                harvesterMaster.LastOrderLocation = forceMovePos;
                toActor.QueueActivity(new SlaveMinerHarvesterHarvest(toActor));
            }
            else
            {
                toActor.QueueActivity(new SlaveMinerHarvesterHarvest(toActor));
            }
        }
示例#2
0
 public override void LinkMaster(Actor self, Actor master, BaseSpawnerMaster spawnerMaster)
 {
     base.LinkMaster(self, master, spawnerMaster);
     // Link master for the harvester trait.
     try
     {
         spawnerHarvesterMaster = Master.Trait <SlaveMinerHarvester>();
     }
     catch
     {
     }
 }