Exemplo n.º 1
0
        protected override void Created(Actor self)
        {
            base.Created(self);

            // Map placed actors are created in the closed state
            if (skippedMakeAnimation)
            {
                state = PopupState.Closed;
                wsb.PlayCustomAnimationRepeating(self, info.ClosedIdleSequence);
                turret.FaceTarget(self, Target.Invalid);
            }
        }
Exemplo n.º 2
0
        protected override bool CanAttack(Actor self, Target target)
        {
            if (state == PopupState.Transitioning || !building.Value.BuildComplete)
            {
                return(false);
            }

            if (!base.CanAttack(self, target))
            {
                return(false);
            }

            idleTicks = 0;
            if (state == PopupState.Closed)
            {
                state = PopupState.Transitioning;
                rb.PlayCustomAnimThen(self, "opening", () =>
                {
                    state = PopupState.Open;
                    rb.PlayCustomAnimRepeating(self, "idle");
                });
                return(false);
            }

            return(turret.FaceTarget(self, target));
        }
Exemplo n.º 3
0
        protected override bool CanAttack(Actor self, Target target)
        {
            if (state == PopupState.Transitioning || !building.Value.BuildComplete)
            {
                return(false);
            }

            if (!base.CanAttack(self, target))
            {
                return(false);
            }

            idleTicks = 0;
            if (state == PopupState.Closed)
            {
                state = PopupState.Transitioning;
                wsb.PlayCustomAnimation(self, info.OpeningSequence, () =>
                {
                    state = PopupState.Open;
                    wsb.PlayCustomAnimationRepeating(self, wsb.Info.Sequence);
                });
                return(false);
            }

            return(turret.FaceTarget(self, target));
        }