protected override void TraitDisabled(Actor self) { wsb.CancelCustomAnimation(self); }
void INotifyEnterTeleporter.Charging(Actor self, Actor teleporter) { body.PlayCustomAnimation(teleporter, info.ChargeSequence, () => body.CancelCustomAnimation(teleporter)); }
void INotifyTeslaCharging.Charging(Actor self, Target target) { wsb.PlayCustomAnimation(self, info.ChargeSequence, () => wsb.CancelCustomAnimation(self)); }
void ITick.Tick(Actor self) { if (!buildComplete || IsTraitDisabled) { return; } if (--ticks <= 0) { wsb.PlayCustomAnimation(self, Info.Sequences.Random(WarGame.CosmeticRandom), () => wsb.CancelCustomAnimation(self)); ticks = Info.Interval; } }
void ITick.Tick(Actor self) { switch (state) { case TechBunkerState.ClosedLocked: if (timer++ >= info.UnlockAfter && self.World.SharedRandom.Next(0, info.UnlockChance) == 0) { state = TechBunkerState.ClosedUnlocked; timer = 0; } break; case TechBunkerState.ClosedUnlocked: var nearbyActors = self.World.FindActorsInCircle(self.CenterPosition, info.TriggerRadius).Where(actor => !actor.Owner.NonCombatant) .ToArray(); if (!nearbyActors.Any()) { return; } var owner = nearbyActors[self.World.SharedRandom.Next(0, nearbyActors.Length - 1)].Owner; state = TechBunkerState.Opening; wsb.PlayCustomAnimation(self, info.SequenceOpening, () => { state = TechBunkerState.Opened; wsb.PlayCustomAnimationRepeating(self, info.SequenceOpened); EjectContents(self, owner); }); if (info.SoundOpen != null) { Game.Sound.Play(SoundType.World, info.SoundOpen.Random(self.World.SharedRandom), self.CenterPosition); } break; case TechBunkerState.Opened: if (self.World.WorldActor.Trait <TechBunkerBehavior>().Behavior == TechBunkerBehaviorType.Reusable && info.LockAfter != -1 && timer++ >= info.LockAfter) { state = TechBunkerState.Closing; timer = 0; wsb.PlayCustomAnimationBackwards(self, info.SequenceOpening, () => { state = TechBunkerState.ClosedLocked; wsb.CancelCustomAnimation(self); }); if (info.SoundClose != null) { Game.Sound.Play(SoundType.World, info.SoundClose.Random(self.World.SharedRandom), self.CenterPosition); } } break; } }
public void Delivered(Actor self) { wsb.CancelCustomAnimation(self); }