Exemple #1
0
        public bool StopMove(bool message)
        {
            if (CheckDecay())
            {
                return(false);
            }

            if (CurrentMoveTimer == null)
            {
                if (message && TillerMan != null)
                {
                    TillerMan.TillerManSay(501443);                     // Er, the ship is not moving sir.
                }
                return(false);
            }

            Moving = Direction.North;

            if (CurrentMoveTimer != null)
            {
                CurrentMoveTimer.Stop();
            }

            if (message && TillerMan != null)
            {
                TillerMan.TillerManSay(501429);                 // Aye aye sir.
            }
            return(true);
        }
Exemple #2
0
        public override void OnAfterDelete()
        {
            foreach (IEntity obj in ContainedObjects.ToList()) // toList necessary for enumeration modification
            {
                if (obj is Item)
                {
                    ((Item)obj).Delete();
                }
                else if (obj is ICrew)
                {
                    ((ICrew)obj).Delete();
                }
                else if (obj is Mobile)
                {
                    ((Mobile)obj).Transport = null;
                }
            }

            if (CurrentMoveTimer != null)
            {
                CurrentMoveTimer.Stop();
            }

            if (CurrentTurnTimer != null)
            {
                CurrentTurnTimer.Stop();
            }

            this.TillerManMobile.Delete();

            Instances.Remove(this);
        }
Exemple #3
0
        public bool StartCourse(bool single, bool message)
        {
            if (Anchored)
            {
                if (message && TillerMan != null)
                {
                    TillerMan.Say(501419); // Ar, the anchor is down sir!
                }
                return(false);
            }

            if (CheckDecay())
            {
                return(false);
            }

            if (MapItem == null || MapItem.Deleted)
            {
                if (message && TillerMan != null)
                {
                    TillerMan.Say(502513); // I have seen no map, sir.
                }
                return(false);
            }
            else if (Map != MapItem.Map || !Contains(MapItem.GetWorldLocation()))
            {
                if (message && TillerMan != null)
                {
                    TillerMan.Say(502514); // The map is too far away from me, sir.
                }
                return(false);
            }
            else if ((Map != Map.Trammel && Map != Map.Felucca) || NextNavPoint < 0 || NextNavPoint >= MapItem.Pins.Count)
            {
                if (message && TillerMan != null)
                {
                    TillerMan.Say(1042551); // I don't see that navpoint, sir.
                }
                return(false);
            }

            Order = single ? BoatOrder.Single : BoatOrder.Course;

            if (CurrentMoveTimer != null)
            {
                CurrentMoveTimer.Stop();
            }

            CurrentCourseMoveTimer = new CourseMoveTimer(this, FastInterval, SpeedCode.Fast, false);
            CurrentCourseMoveTimer.Start();

            if (message && TillerMan != null)
            {
                TillerMan.Say(501429); // Aye aye sir.
            }
            return(true);
        }