Exemple #1
0
        protected override void Created(Actor self)
        {
            base.Created(self);

            var actors = self.World.FindActorsInCircle(self.CenterPosition, new WDist(1024)).Where(a => a.Info.HasTraitInfo <OilpatchInfo>()).ToArray();

            if (actors.Any())
            {
                oilpatchActor = actors.First();
                self.World.AddFrameEndTask(world => world.Remove(oilpatchActor));
                oilpatch = oilpatchActor.Trait <Oilpatch>();
            }

            conditionManager = self.Trait <ConditionManager>();

            if (oilpatch != null)
            {
                token = conditionManager.GrantCondition(self, info.Condition);
            }
        }
Exemple #2
0
        void ITick.Tick(Actor self)
        {
            if (oilpatchActor == null)
            {
                return;
            }

            oilpatchActor.Tick();

            if (!oilpatchActor.IsDead)
            {
                return;
            }

            Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", "DrillrigEmpty", self.Owner.Faction.InternalName);
            oilpatchActor = null;
            oilpatch      = null;
            conditionManager.RevokeCondition(self, token);
            token = ConditionManager.InvalidConditionToken;
        }