Fixes brace style (#248)

This commit is contained in:
Kamron Batman 2020-09-13 21:49:46 -07:00 • committed by GitHub
parent a236617ad9
commit 8149620b0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1503 changed files with 28575 additions and 1717 deletions

File diff suppressed because it is too large Load diff

View file

@ -12,7 +12,9 @@ namespace Server.Multis
Weight = 1.0;
if (!Core.AOS)
{
LootType = LootType.Newbied;
}
MultiID = id;
Offset = offset;
@ -58,7 +60,9 @@ namespace Server.Multis
}
if (Weight == 0.0)
{
Weight = 1.0;
}
}
public override void OnDoubleClick(Mobile from)
@ -74,9 +78,13 @@ namespace Server.Multis
else
{
if (Core.SE)
from.SendLocalizedMessage(502482); // Where do you wish to place the ship?
{
@from.SendLocalizedMessage(502482); // Where do you wish to place the ship?
}
else
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502482); // Where do you wish to place the ship?
{
@from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502482); // Where do you wish to place the ship?
}
from.Target = new InternalTarget(this);
}
@ -84,7 +92,10 @@ namespace Server.Multis
public void OnPlacement(Mobile from, Point3D p)
{
if (Deleted) return;
if (Deleted)
{
return;
}
if (!IsChildOf(from.Backpack))
{
@ -95,7 +106,9 @@ namespace Server.Multis
var map = from.Map;
if (map == null)
{
return;
}
if (from.AccessLevel < AccessLevel.GameMaster && (map == Map.Ilshenar || map == Map.Malas))
{
@ -116,7 +129,9 @@ namespace Server.Multis
var boat = Boat;
if (boat == null)
{
return;
}
p = new Point3D(p.X - Offset.X, p.Y - Offset.Y, p.Z - Offset.Z);
@ -130,10 +145,14 @@ namespace Server.Multis
var keyValue = boat.CreateKeys(from);
if (boat.PPlank != null)
{
boat.PPlank.KeyValue = keyValue;
}
if (boat.SPlank != null)
{
boat.SPlank.KeyValue = keyValue;
}
boat.MoveToWorld(p, map);
}
@ -156,18 +175,26 @@ namespace Server.Multis
if (o is IPoint3D ip)
{
if (ip is Item item)
{
ip = item.GetWorldTop();
}
var p = new Point3D(ip);
var region = Region.Find(p, from.Map);
if (region.IsPartOf<DungeonRegion>())
from.SendLocalizedMessage(502488); // You can not place a ship inside a dungeon.
{
@from.SendLocalizedMessage(502488); // You can not place a ship inside a dungeon.
}
else if (region.IsPartOf<HouseRegion>() || region.IsPartOf<ChampionSpawnRegion>())
from.SendLocalizedMessage(1042549); // A boat may not be placed in this area.
{
@from.SendLocalizedMessage(1042549); // A boat may not be placed in this area.
}
else
m_Deed.OnPlacement(from, p);
{
m_Deed.OnPlacement(@from, p);
}
}
}
}

View file

@ -69,17 +69,23 @@ namespace Server.Multis
m_ShipName = reader.ReadString();
if (version == 0)
{
reader.ReadUInt();
}
break;
}
}
if (LootType == LootType.Newbied)
{
LootType = LootType.Blessed;
}
if (Weight == 0.0)
{
Weight = 1.0;
}
}
public override void OnDoubleClick(Mobile from)
@ -99,22 +105,33 @@ namespace Server.Multis
public override void AddNameProperty(ObjectPropertyList list)
{
if (m_ShipName != null)
{
list.Add(m_ShipName);
}
else
{
base.AddNameProperty(list);
}
}
public override void OnSingleClick(Mobile from)
{
if (m_ShipName != null)
LabelTo(from, m_ShipName);
{
LabelTo(@from, m_ShipName);
}
else
base.OnSingleClick(from);
{
base.OnSingleClick(@from);
}
}
public void OnPlacement(Mobile from, Point3D p)
{
if (Deleted) return;
if (Deleted)
{
return;
}
if (!IsChildOf(from.Backpack))
{
@ -125,12 +142,16 @@ namespace Server.Multis
var map = from.Map;
if (map == null)
{
return;
}
var boat = Boat;
if (boat == null)
{
return;
}
p = new Point3D(p.X - Offset.X, p.Y - Offset.Y, p.Z - Offset.Z);
@ -146,10 +167,14 @@ namespace Server.Multis
var keyValue = boat.CreateKeys(from);
if (boat.PPlank != null)
{
boat.PPlank.KeyValue = keyValue;
}
if (boat.SPlank != null)
{
boat.SPlank.KeyValue = keyValue;
}
boat.MoveToWorld(p, map);
}
@ -172,18 +197,26 @@ namespace Server.Multis
if (o is IPoint3D ip)
{
if (ip is Item item)
{
ip = item.GetWorldTop();
}
var p = new Point3D(ip);
var region = Region.Find(p, from.Map);
if (region.IsPartOf<DungeonRegion>())
from.SendLocalizedMessage(502488); // You can not place a ship inside a dungeon.
{
@from.SendLocalizedMessage(502488); // You can not place a ship inside a dungeon.
}
else if (region.IsPartOf<HouseRegion>() || region.IsPartOf<ChampionSpawnRegion>())
from.SendLocalizedMessage(1042549); // A boat may not be placed in this area.
{
@from.SendLocalizedMessage(1042549); // A boat may not be placed in this area.
}
else
m_Model.OnPlacement(from, p);
{
m_Model.OnPlacement(@from, p);
}
}
}
}

View file

@ -32,7 +32,9 @@ namespace Server.Multis
public override void OnResponse(NetState state, RelayInfo info)
{
if (info.ButtonID == 2)
{
m_Boat.EndDryDock(m_From);
}
}
}
}

View file

@ -34,7 +34,9 @@ namespace Server.Items
public override bool OnDragDrop(Mobile from, Item item)
{
if (m_Boat?.Contains(from) != true || m_Boat.IsMoving)
{
return false;
}
return base.OnDragDrop(from, item);
}
@ -42,7 +44,9 @@ namespace Server.Items
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
{
if (m_Boat?.Contains(from) != true || m_Boat.IsMoving)
{
return false;
}
return base.OnDragDropInto(from, item, p);
}
@ -50,7 +54,9 @@ namespace Server.Items
public override bool CheckItemUse(Mobile from, Item item)
{
if (item != this && (m_Boat?.Contains(from) != true || m_Boat.IsMoving))
{
return false;
}
return base.CheckItemUse(from, item);
}
@ -58,7 +64,9 @@ namespace Server.Items
public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
{
if (m_Boat?.Contains(from) != true || m_Boat.IsMoving)
{
return false;
}
return base.CheckLift(from, item, ref reject);
}
@ -71,11 +79,17 @@ namespace Server.Items
public override void OnDoubleClick(Mobile from)
{
if (m_Boat?.Contains(from) != true)
{
m_Boat.TillerMan?.Say(502490); // You must be on the ship to open the hold.
}
else if (m_Boat.IsMoving)
{
m_Boat.TillerMan?.Say(502491); // I can not open the hold while the ship is moving.
}
else
base.OnDoubleClick(from);
{
base.OnDoubleClick(@from);
}
}
public override void Serialize(IGenericWriter writer)
@ -100,7 +114,9 @@ namespace Server.Items
m_Boat = reader.ReadItem() as BaseBoat;
if (m_Boat == null || Parent != null)
{
Delete();
}
Movable = false;

View file

@ -77,7 +77,9 @@ namespace Server.Items
KeyValue = reader.ReadUInt();
if (Boat == null)
{
Delete();
}
break;
}
@ -93,6 +95,7 @@ namespace Server.Items
public void SetFacing(Direction dir)
{
if (IsOpen)
{
ItemID = dir switch
{
Direction.North => Starboard ? 0x3ED4 : 0x3ED5,
@ -101,7 +104,9 @@ namespace Server.Items
Direction.West => Starboard ? 0x3E89 : 0x3E84,
_ => ItemID
};
}
else
{
ItemID = dir switch
{
Direction.North => Starboard ? 0x3EB2 : 0x3EB1,
@ -110,12 +115,15 @@ namespace Server.Items
Direction.West => Starboard ? 0x3E8A : 0x3E85,
_ => ItemID
};
}
}
public void Open()
{
if (IsOpen || Deleted)
{
return;
}
m_CloseTimer?.Stop();
@ -139,26 +147,40 @@ namespace Server.Items
if (IsOpen)
{
if (from is BaseFactionGuard)
{
return false;
}
if ((from.Direction & Direction.Running) != 0 || Boat?.Contains(from) == false)
{
return true;
}
var map = Map;
if (map == null)
{
return false;
}
int rx = 0, ry = 0;
if (ItemID == 0x3ED4)
{
rx = 1;
}
else if (ItemID == 0x3ED5)
{
rx = -1;
}
else if (ItemID == 0x3E84)
{
ry = 1;
}
else if (ItemID == 0x3E89)
{
ry = -1;
}
for (var i = 1; i <= 6; ++i)
{
@ -174,7 +196,9 @@ namespace Server.Items
!Region.Find(new Point3D(x, y, z), map).IsPartOf<StrongholdRegion>())
{
if (i == 1 && j >= -2 && j <= 2)
{
return true;
}
from.Location = new Point3D(x, y, z);
return false;
@ -187,7 +211,9 @@ namespace Server.Items
!Region.Find(new Point3D(x, y, z), map).IsPartOf<StrongholdRegion>())
{
if (i == 1)
{
return true;
}
from.Location = new Point3D(x, y, z);
return false;
@ -205,7 +231,9 @@ namespace Server.Items
public void Close()
{
if (!IsOpen || !CanClose() || Deleted)
{
return;
}
m_CloseTimer?.Stop();
@ -231,16 +259,22 @@ namespace Server.Items
public override void OnDoubleClick(Mobile from)
{
if (Boat == null)
{
return;
}
if (from.InRange(GetWorldLocation(), 8))
{
if (Boat.Contains(from))
{
if (IsOpen)
{
Close();
}
else
{
Open();
}
}
else
{

View file

@ -93,7 +93,9 @@ namespace Server.Misc
var map = from.Map;
if (map == null)
{
return false;
}
var surface = map.GetTopSurface(from.Location);
@ -118,22 +120,34 @@ namespace Server.Misc
public static void EventSink_Login(Mobile from)
{
if (!IsStranded(from))
{
return;
}
var map = from.Map;
Point2D[] list;
if (map == Map.Felucca)
{
list = m_Felucca;
}
else if (map == Map.Trammel)
{
list = m_Trammel;
}
else if (map == Map.Ilshenar)
{
list = m_Ilshenar;
}
else if (map == Map.Tokuno)
{
list = m_Tokuno;
}
else
{
return;
}
var p = Point2D.Zero;
var pdist = double.MaxValue;
@ -157,20 +171,28 @@ namespace Server.Misc
canFit = map.CanSpawnMobile(x, y, z);
for (var i = 1; !canFit && i <= 40; i += 2)
{
for (var xo = -1; !canFit && xo <= 1; ++xo)
{
for (var yo = -1; !canFit && yo <= 1; ++yo)
{
if (xo == 0 && yo == 0)
{
continue;
}
x = p.X + xo * i;
y = p.Y + yo * i;
z = map.GetAverageZ(x, y);
canFit = map.CanSpawnMobile(x, y, z);
}
}
}
if (canFit)
from.Location = new Point3D(x, y, z);
{
@from.Location = new Point3D(x, y, z);
}
}
}
}

View file

@ -49,31 +49,45 @@ namespace Server.Items
public override void AddNameProperty(ObjectPropertyList list)
{
if (m_Boat?.ShipName != null)
{
list.Add(1042884, m_Boat.ShipName); // the tiller man of the ~1_SHIP_NAME~
}
else
{
base.AddNameProperty(list);
}
}
public override void OnSingleClick(Mobile from)
{
if (m_Boat?.ShipName != null)
LabelTo(from, 1042884, m_Boat.ShipName); // the tiller man of the ~1_SHIP_NAME~
{
LabelTo(@from, 1042884, m_Boat.ShipName); // the tiller man of the ~1_SHIP_NAME~
}
else
base.OnSingleClick(from);
{
base.OnSingleClick(@from);
}
}
public override void OnDoubleClick(Mobile from)
{
if (m_Boat?.Contains(from) == true)
m_Boat.BeginRename(from);
{
m_Boat.BeginRename(@from);
}
else
m_Boat?.BeginDryDock(from);
{
m_Boat?.BeginDryDock(@from);
}
}
public override bool OnDragDrop(Mobile from, Item dropped)
{
if (dropped is MapItem item && m_Boat?.CanCommand(from) == true && m_Boat.Contains(from))
{
m_Boat.AssociateMap(item);
}
return false;
}
@ -105,7 +119,9 @@ namespace Server.Items
m_Boat = reader.ReadItem() as BaseBoat;
if (m_Boat == null)
{
Delete();
}
break;
}