public override Activity Tick( Actor self ) { if (started) { // Don't break the actor if someone has overriden the animation prematurely if (rb.anim.CurrentSequence.Name != "make") { complete = true; OnComplete(); } return complete ? NextActivity : this; } started = true; rb = self.Trait<RenderBuilding>(); if (Reversed) { // TODO: These don't belong here var bi = self.Info.Traits.GetOrDefault<BuildingInfo>(); if (bi != null) foreach (var s in bi.SellSounds) Sound.PlayToPlayer(self.Owner, s, self.CenterLocation); rb.PlayCustomAnimBackwards(self, "make", () => { OnComplete(); complete = true;}); } else rb.PlayCustomAnimThen(self, "make", () => { OnComplete(); complete = true;}); return this; }
public Transform(Actor self, string toActor, int2 offset, int facing, string[] sounds) { this.actor = toActor; this.offset = offset; this.sounds = sounds; this.facing = facing; rb = self.TraitOrDefault<RenderBuilding>(); }
public AttackPopupTurreted(ActorInitializer init, AttackPopupTurretedInfo info) : base(init.self, info) { this.info = info; turret = turrets.FirstOrDefault(); rb = init.self.Trait <RenderBuilding>(); skippedMakeAnimation = init.Contains <SkipMakeAnimsInit>(); }
public HarvesterDockSequence(Actor self, Actor proc) { this.proc = proc; state = State.Turn; harv = self.Trait<Harvester>(); rb = proc.Trait<RenderBuilding>(); startDock = self.Trait<IHasLocation>().PxPosition; endDock = proc.Trait<IHasLocation>().PxPosition + new int2(-15,8); }
public override Activity Tick(Actor self) { if (self.IsDead()) { return(NextActivity); } if (started) { // Don't break the actor if someone has overriden the animation prematurely if (rb.DefaultAnimation.CurrentSequence.Name != "make") { complete = true; OnComplete(); } return(complete ? NextActivity : this); } started = true; rb = self.Trait <RenderBuilding>(); if (Reversed) { // TODO: These don't belong here var bi = self.Info.Traits.GetOrDefault <BuildingInfo>(); if (bi != null) { foreach (var s in bi.SellSounds) { Sound.PlayToPlayer(self.Owner, s, self.CenterPosition); } } rb.PlayCustomAnimBackwards(self, "make", () => { OnComplete(); complete = true; }); } else { rb.PlayCustomAnimThen(self, "make", () => { OnComplete(); complete = true; }); } return(this); }
public WithDeliveryAnimation(Actor self, WithDeliveryAnimationInfo info) { building = self.Trait <RenderBuilding>(); this.info = info; }