public void AssociateMap(MapItem map) { if (CheckDecay()) { return; } if (map is BlankMap) { if (TillerMan != null) { TillerMan.Say(502575); // Ar, that is not a map, tis but a blank piece of paper! } } else if (map.Pins.Count == 0) { if (TillerMan != null) { TillerMan.Say(502576); // Arrrr, this map has no course on it! } } else { StopMove(false); MapItem = map; NextNavPoint = -1; if (TillerMan != null) { TillerMan.Say(502577); // A map! } } }
public override void Rename(string newName) { if (CheckDecay()) { return; } if (newName != null && newName.Length > 40) { newName = newName.Substring(0, 40); } if (ShipName == newName) { if (TillerMan != null) { TillerMan.Say(502531); // Yes, sir. } return; } ShipName = newName; if (TillerMan != null && ShipName != null) { TillerMan.Say(1042885, ShipName); // This ship is now called the ~1_NEW_SHIP_NAME~. } else if (TillerMan != null) { TillerMan.Say(502534); // This ship now has no name. } }
public bool StopMove(bool message) { if (CheckDecay()) { return(false); } if (CurrentMoveTimer == null) { if (message && TillerMan != null) { TillerMan.Say(501443); // Er, the ship is not moving sir. } return(false); } Moving = Direction.North; if (CurrentMoveTimer != null) { CurrentMoveTimer.Stop(); } if (message && TillerMan != null) { TillerMan.Say(501429); // Aye aye sir. } return(true); }
public bool LowerAnchor(bool message) { if (CheckDecay()) { return(false); } if (Anchored) { if (message && TillerMan != null) { TillerMan.Say(501445); // Ar, the anchor was already dropped sir. } return(false); } EndMove(); Anchored = true; if (message && TillerMan != null) { TillerMan.Say(501444); // Ar, anchor dropped sir. } return(true); }
public bool CourseTurn(int offset, bool message) { if (CurrentTurnTimer != null) { CurrentTurnTimer.Stop(); } if (CheckDecay()) { return(false); } if (Anchored) { if (message) { TillerMan.Say(501419); // Ar, the anchor is down sir! } return(false); } else if (SetFacing((Direction)(((int)Facing + offset) & 0x7))) { return(true); } else { if (message) { TillerMan.Say(501423); // Ar, can't turn sir. } return(false); } }
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); }
public void EmergencyRepairs() { if (NextRepairTime < DateTime.Now) { //TillerMan.Say(1116597, "5, 5, 5"); Durability = 50; NextRepairTime = DateTime.Now + TimeSpan.FromMinutes(5.0); } else { TimeSpan TimeBeforeRepair = NextRepairTime - DateTime.Now; TillerMan.Say(1116592, TimeBeforeRepair.ToString()); } }
protected override bool EndMove() { if (!base.EndMove()) { return(false); } if (TillerMan != null) { TillerMan.Say(501424); //Ar, we've stopped sir. } return(true); }
protected override bool Move(Direction dir, SpeedCode speed) { if (base.Move(dir, speed)) { return(true); } else { if (TillerMan != null) { TillerMan.Say(501424); //Ar, we've stopped sir. } return(false); } }
public bool StartCourse(string navPoint, bool single, bool message) { int number = -1; int start = -1; for (int i = 0; i < navPoint.Length; i++) { if (Char.IsDigit(navPoint[i])) { start = i; break; } } if (start != -1) { string sNumber = navPoint.Substring(start); if (!int.TryParse(sNumber, out number)) { number = -1; } if (number != -1) { number--; if (MapItem == null || number < 0 || number >= MapItem.Pins.Count) { number = -1; } } } if (number == -1) { if (message && TillerMan != null) { TillerMan.Say(1042551); // I don't see that navpoint, sir. } return(false); } NextNavPoint = number; return(StartCourse(single, message)); }
public override void BeginRename(Mobile from) { if (from.AccessLevel < AccessLevel.GameMaster && from != Owner) { if (TillerMan != null) { TillerMan.Say(Utility.Random(1042876, 4)); // Arr, don't do that! | Arr, leave me alone! | Arr, watch what thour'rt doing, matey! | Arr! Do that again and I’ll throw ye overhead! } return; } if (TillerMan != null) { TillerMan.Say(502580); // What dost thou wish to name thy ship? } base.BeginRename(from); }
public override void SetName(SpeechEventArgs e) { if (e.Mobile.AccessLevel < AccessLevel.GameMaster && e.Mobile != Owner) { if (TillerMan != null) { TillerMan.Say(1042880); // Arr! Only the owner of the ship may change its name! } return; } else if (!e.Mobile.Alive) { if (TillerMan != null) { TillerMan.Say(502582); // You appear to be dead. } return; } base.SetName(e); }
public override void EndRename(Mobile from, string newName) { if (from.AccessLevel < AccessLevel.GameMaster && from != Owner) { if (TillerMan != null) { TillerMan.Say(1042880); // Arr! Only the owner of the ship may change its name! } return; } else if (!from.Alive) { if (TillerMan != null) { TillerMan.Say(502582); // You appear to be dead. } return; } base.EndRename(from, newName); }
public override void RemoveName(Mobile m) { if (CheckDecay()) { return; } if (m.AccessLevel < AccessLevel.GameMaster && m != Owner) { if (TillerMan != null) { TillerMan.Say(1042880); // Arr! Only the owner of the ship may change its name! } return; } else if (!m.Alive) { if (TillerMan != null) { TillerMan.Say(502582); // You appear to be dead. } return; } if (ShipName == null) { if (TillerMan != null) { TillerMan.Say(502526); // Ar, this ship has no name. } return; } ShipName = null; if (TillerMan != null) { TillerMan.Say(502534); // This ship now has no name. } }
public void GiveNavPoint() { if (TillerMan == null || CheckDecay()) { return; } if (NextNavPoint < 0) { if (TillerMan != null) { TillerMan.Say(1042882); // I have no current nav point. } } else { if (TillerMan != null) { TillerMan.Say(1042883, (NextNavPoint + 1).ToString()); // My current destination navpoint is nav ~1_NAV_POINT_NUM~. } } }
public override void GiveName(Mobile m) { if (CheckDecay()) { return; } if (ShipName == null) { if (TillerMan != null) { TillerMan.Say(502526); // Ar, this ship has no name. } } else { if (TillerMan != null) { TillerMan.Say(1042881, ShipName); // This is the ~1_BOAT_NAME~. } } }
public bool RaiseAnchor(bool message) { if (CheckDecay()) { return(false); } if (!Anchored) { if (message && TillerMan != null) { TillerMan.Say(501447); // Ar, the anchor has not been dropped sir. } return(false); } Anchored = false; if (message && TillerMan != null) { TillerMan.Say(501446); // Ar, anchor raised sir. } return(true); }
public bool DoMove() { Direction dir; SpeedCode speed; if (Order == BoatOrder.Move) { dir = Moving; speed = Speed; } else if (MapItem == null || MapItem.Deleted) { if (TillerMan != null) { TillerMan.Say(502513); // I have seen no map, sir. } return(false); } else if (Map != MapItem.Map || !Contains(MapItem.GetWorldLocation())) { if (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 (TillerMan != null) { TillerMan.Say(1042551); // I don't see that navpoint, sir. } return(false); } else { Point2D dest = (Point2D)MapItem.Pins[NextNavPoint]; int x, y; MapItem.ConvertToWorld(dest.X, dest.Y, out x, out y); int maxSpeed; dir = GetMovementFor(x, y, out maxSpeed); if (maxSpeed == 0) { if (Order == BoatOrder.Single && TillerMan != null) { TillerMan.Say(1042874, (NextNavPoint + 1).ToString()); // We have arrived at nav point ~1_POINT_NUM~ , sir. } if (NextNavPoint + 1 < MapItem.Pins.Count) { NextNavPoint++; if (Order == BoatOrder.Course) { if (TillerMan != null) { TillerMan.Say(1042875, (NextNavPoint + 1).ToString()); // Heading to nav point ~1_POINT_NUM~, sir. } return(true); } return(false); } else { this.NextNavPoint = -1; if (Order == BoatOrder.Course && TillerMan != null) { TillerMan.Say(502515); // The course is completed, sir. } return(false); } } speed = (SpeedCode)Math.Min((int)SpeedCode.Fast, maxSpeed); } Turn(dir); return(BeginCourse(dir, speed)); }