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()) { return; } oilpatchActor = actors.First(); self.World.AddFrameEndTask(world => world.Remove(oilpatchActor)); oilpatch = oilpatchActor.Trait <Oilpatch>(); oilpatch.StopBurning(); token = self.GrantCondition(info.Condition); }
void ITick.Tick(Actor self) { if (oilpatchActor == null) { return; } oilpatchActor.Tick(); if (!oilpatchActor.IsDead) { return; } // TODO unhardcode! Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", "DrillrigEmpty", self.Owner.Faction.InternalName); oilpatchActor = null; oilpatch = null; token = self.RevokeCondition(token); }