Formatting #2 (#59)

This commit is contained in:
Kamron Batman 2019-10-05 00:37:03 -07:00 • committed by GitHub
parent 096d39609e
commit 8e9221bb5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
400 changed files with 3688 additions and 5969 deletions

View file

@ -68,22 +68,13 @@ namespace Server.Engines.Quests.Haven
public void DoFireEffect(IPoint3D target)
{
Point3D from;
switch (CannonDirection)
var from = CannonDirection switch
{
case CannonDirection.North:
from = new Point3D(X, Y - 1, Z);
break;
case CannonDirection.East:
from = new Point3D(X + 1, Y, Z);
break;
case CannonDirection.South:
from = new Point3D(X, Y + 1, Z);
break;
default:
from = new Point3D(X - 1, Y, Z);
break;
}
CannonDirection.North => new Point3D(X, Y - 1, Z),
CannonDirection.East => new Point3D(X + 1, Y, Z),
CannonDirection.South => new Point3D(X, Y + 1, Z),
_ => new Point3D(X - 1, Y, Z)
};
Effects.SendLocationEffect(from, Map, 0x36B0, 16, 1);
Effects.PlaySound(from, Map, 0x11D);
@ -104,22 +95,13 @@ namespace Server.Engines.Quests.Haven
if (!(Canoneer?.Deleted == false && Canoneer.Active))
return;
bool canFire;
switch (CannonDirection)
var canFire = CannonDirection switch
{
case CannonDirection.North:
canFire = m.X >= X - 7 && m.X <= X + 7 && m.Y == Y - 7 && oldLocation.Y < Y - 7;
break;
case CannonDirection.East:
canFire = m.Y >= Y - 7 && m.Y <= Y + 7 && m.X == X + 7 && oldLocation.X > X + 7;
break;
case CannonDirection.South:
canFire = m.X >= X - 7 && m.X <= X + 7 && m.Y == Y + 7 && oldLocation.Y > Y + 7;
break;
default:
canFire = m.Y >= Y - 7 && m.Y <= Y + 7 && m.X == X - 7 && oldLocation.X < X - 7;
break;
}
CannonDirection.North => (m.X >= X - 7 && m.X <= X + 7 && m.Y == Y - 7 && oldLocation.Y < Y - 7),
CannonDirection.East => (m.Y >= Y - 7 && m.Y <= Y + 7 && m.X == X + 7 && oldLocation.X > X + 7),
CannonDirection.South => (m.X >= X - 7 && m.X <= X + 7 && m.Y == Y + 7 && oldLocation.Y > Y + 7),
_ => (m.Y >= Y - 7 && m.Y <= Y + 7 && m.X == X - 7 && oldLocation.X < X - 7)
};
if (canFire && Canoneer.WillFire(this, m))
Fire(Canoneer, m);

View file

@ -33,28 +33,15 @@ namespace Server.Engines.Quests.Haven
AddItem(new LeatherGloves());
AddItem(new LeatherGorget());
Item weapon;
switch (Utility.Random(6))
var weapon = Utility.Random(6) switch
{
case 0:
weapon = new Broadsword();
break;
case 1:
weapon = new Cutlass();
break;
case 2:
weapon = new Katana();
break;
case 3:
weapon = new Longsword();
break;
case 4:
weapon = new Scimitar();
break;
default:
weapon = new VikingSword();
break;
}
0 => (Item)new Broadsword(),
1 => new Cutlass(),
2 => new Katana(),
3 => new Longsword(),
4 => new Scimitar(),
_ => new VikingSword()
};
weapon.Movable = false;
AddItem(weapon);

View file

@ -112,7 +112,7 @@ namespace Server.Engines.Quests.Haven
if (m is PlayerMobile && !m.Frozen && !m.Alive && InRange(m, 4) && !InRange(oldLocation, 4) && InLOS(m))
{
if (m.Map == null || !m.Map.CanFit(m.Location, 16, false, false))
if (m.Map?.CanFit(m.Location, 16, false, false) != true)
{
m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
}

View file

@ -305,28 +305,15 @@ namespace Server.Engines.Quests.Haven
}
else
{
BaseWeapon weapon;
switch (Utility.Random(6))
var weapon = Utility.Random(6) switch
{
case 0:
weapon = new Broadsword();
break;
case 1:
weapon = new Cutlass();
break;
case 2:
weapon = new Katana();
break;
case 3:
weapon = new Longsword();
break;
case 4:
weapon = new Scimitar();
break;
default:
weapon = new VikingSword();
break;
}
0 => (BaseWeapon)new Broadsword(),
1 => new Cutlass(),
2 => new Katana(),
3 => new Longsword(),
4 => new Scimitar(),
_ => new VikingSword()
};
if (Core.AOS)
{
@ -392,7 +379,7 @@ namespace Server.Engines.Quests.Haven
if (m is PlayerMobile && !m.Frozen && !m.Alive && InRange(m, 4) && !InRange(oldLocation, 4) && InLOS(m))
{
if (m.Map == null || !m.Map.CanFit(m.Location, 16, false, false))
if (m.Map?.CanFit(m.Location, 16, false, false) != true)
{
m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
}

View file

@ -76,27 +76,23 @@ namespace Server.Engines.Quests.Haven
{
get
{
switch (Step)
return Step switch
{
case KillHordeMinionsStep.First:
/* Find the mountain pass beyond the house which lies at the
KillHordeMinionsStep.First =>
/* Find the mountain pass beyond the house which lies at the
* end of the runic road.<BR><BR>
*
* Assist the city Militia by slaying <I>Horde Minions</I>
*/
return 1049089;
case KillHordeMinionsStep.LearnKarma:
/* You have just gained some <a href="?ForceTopic45">Karma</a>
1049089,
KillHordeMinionsStep.LearnKarma =>
/* You have just gained some <a href="?ForceTopic45">Karma</a>
* for killing the horde minion. <a href="?ForceTopic134">Learn</a>
* how this affects your Paladin abilities.
*/
return 1060389;
default:
// Continue driving back the Horde Minions, as Uzeraan instructed you to do.
return 1060507;
}
1060389,
_ => 1060507
};
}
}
@ -105,12 +101,12 @@ namespace Server.Engines.Quests.Haven
get
{
if (System.From.Profession == 5) // paladin
switch (Step)
return Step switch
{
case KillHordeMinionsStep.First: return 1;
case KillHordeMinionsStep.LearnKarma: return 2;
default: return 5;
}
KillHordeMinionsStep.First => 1,
KillHordeMinionsStep.LearnKarma => 2,
_ => 5
};
return 5;
}

View file

@ -66,12 +66,12 @@ namespace Server.Engines.Quests.Haven
{
get
{
switch (From.Profession)
return From.Profession switch
{
case 1: return 0x15C9; // warrior
case 2: return 0x15C1; // magician
default: return 0x15D3; // paladin
}
1 => 0x15C9, // warrior
2 => 0x15C1, // magician
_ => 0x15D3
};
}
}
@ -164,4 +164,4 @@ namespace Server.Engines.Quests.Haven
return false;
}
}
}
}