Esempio n. 1
0
        public override void Replenish(Actor self, BaseSpawnerChildEntry entry)
        {
            base.Replenish(self, entry);

            if (conditionManager != null && !string.IsNullOrEmpty(info.LoadedCondition))
            {
                loadedTokens.Push(conditionManager.GrantCondition(self, info.LoadedCondition));
            }
        }
Esempio n. 2
0
        public override void InitializeChildEntry(Actor child, BaseSpawnerChildEntry entry)
        {
            var carrierChildEntry = entry as CarrierChildEntry;

            base.InitializeChildEntry(child, carrierChildEntry);

            carrierChildEntry.RearmTicks   = 0;
            carrierChildEntry.IsLaunched   = false;
            carrierChildEntry.SpawnerChild = child.Trait <CarrierChild>();
        }
Esempio n. 3
0
        public virtual BaseSpawnerChildEntry[] CreateChildEntries(BaseSpawnerParentInfo info)
        {
            var childEntries = new BaseSpawnerChildEntry[info.Actors.Length];

            for (var i = 0; i < childEntries.Length; i++)
            {
                childEntries[i] = new BaseSpawnerChildEntry();
            }

            return(childEntries);
        }
Esempio n. 4
0
        /// <summary>
        /// Replenish one child entry.
        /// </summary>
        public virtual void Replenish(Actor self, BaseSpawnerChildEntry entry)
        {
            if (entry.IsValid)
            {
                throw new InvalidOperationException("Replenish must not be run on a valid entry!");
            }

            // Some members are missing. Create a new one.
            var child = self.World.CreateActor(false, entry.ActorName,
                                               new TypeDictionary {
                new OwnerInit(self.Owner)
            });

            InitializeChildEntry(child, entry);
            entry.SpawnerChild.LinkParent(entry.Actor, self, this);
        }
Esempio n. 5
0
 /// <summary>
 /// Child entry initializer function.
 /// Override this function from derived classes to initialize their own specific stuff.
 /// </summary>
 public virtual void InitializeChildEntry(Actor child, BaseSpawnerChildEntry entry)
 {
     entry.Actor        = child;
     entry.SpawnerChild = child.Trait <BaseSpawnerChild>();
 }