void MoveForward(Actor self)
        {
            var move = new WVec(0, -speed, 0).Rotate(new WRot(bm.Pitch, WAngle.Zero, bm.Facing));

            bm.SetPosition(self, bm.CenterPosition + move);
            if (!self.IsInWorld)
            {
                status = BMFlyStatus.Unknown;
            }
        }
예제 #2
0
        public void FlyToward(Actor self, BallisticMissile sbm)
        {
            var pos = WPos.LerpQuadratic(initPos, targetPos, sbm.Info.LaunchAngle, ticks, length);

            sbm.SetPosition(self, pos);
            sbm.Facing = GetEffectiveFacing();
        }
예제 #3
0
        public override bool Tick(Actor self)
        {
            var d    = targetPos - self.CenterPosition;
            var move = bm.FlyStep(bm.Facing);

            if (d.HorizontalLengthSquared < move.HorizontalLengthSquared)
            {
                // Snap to the target position to prevent overshooting.
                bm.SetPosition(self, targetPos);
                Queue(new CallFunc(() => self.Kill(self, bm.Info.DamageTypes)));
                return(true);
            }

            var pos = WPos.LerpQuadratic(initPos, targetPos, bm.Info.LaunchAngle, ticks, length);

            bm.SetPosition(self, pos);
            bm.Facing = GetEffectiveFacing();

            ticks++;
            return(false);
        }