Ejemplo n.º 1
0
        public void PickupChild(Actor self, Actor child)
        {
            if (info.InstantRepair)
            {
                var health = child.Trait <Health>();
                child.InflictDamage(child, new Damage(-health.MaxHP));
            }

            CarrierChildEntry childEntry = null;

            foreach (var carrierChildEntry in childEntries)
            {
                if (carrierChildEntry.Actor == child)
                {
                    childEntry = carrierChildEntry;
                    break;
                }
            }

            if (childEntry == null)
            {
                throw new InvalidOperationException("An actor that isn't my child entered me?");
            }

            childEntry.IsLaunched = false;

            childEntry.RearmTicks = Util.ApplyPercentageModifiers(info.RearmTicks, reloadModifiers.Select(rm => rm.GetReloadModifier()));

            if (conditionManager != null && !string.IsNullOrEmpty(info.LoadedCondition))
            {
                loadedTokens.Push(conditionManager.GrantCondition(self, info.LoadedCondition));
            }
        }
Ejemplo n.º 2
0
        public override BaseSpawnerChildEntry[] CreateChildEntries(BaseSpawnerParentInfo info)
        {
            childEntries = new CarrierChildEntry[info.Actors.Length];

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

            return(childEntries);
        }