Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 • committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -29,7 +29,7 @@ namespace Server.Engines.ConPVP
{
if (m_TeamInfo?.Game != null)
{
from.CloseGump(typeof(DDBoardGump));
from.CloseGump<DDBoardGump>();
from.SendGump(new DDBoardGump(from, m_TeamInfo.Game));
}
}
@ -389,18 +389,10 @@ namespace Server.Engines.ConPVP
public DDTeamInfo[] TeamInfo{ get; private set; }
[CommandProperty(AccessLevel.GameMaster)]
public DDTeamInfo Team1
{
get => TeamInfo[0];
set { }
}
public DDTeamInfo Team1 => TeamInfo[0];
[CommandProperty(AccessLevel.GameMaster)]
public DDTeamInfo Team2
{
get => TeamInfo[1];
set { }
}
public DDTeamInfo Team2 => TeamInfo[1];
[CommandProperty(AccessLevel.GameMaster)]
public DDWayPoint PointA{ get; set; }
@ -501,7 +493,7 @@ namespace Server.Engines.ConPVP
for (int i = 0; i < m_Context.Participants.Count; ++i)
{
Participant p = m_Context.Participants[i] as Participant;
Participant p = m_Context.Participants[i];
for (int j = 0; j < p.Players.Length; ++j)
if (p.Players[j] != null)
@ -552,19 +544,12 @@ namespace Server.Engines.ConPVP
public void DelayBounce(TimeSpan ts, Mobile mob, Container corpse)
{
Timer.DelayCall(ts, new TimerStateCallback(DelayBounce_Callback), new object[] { mob, corpse });
Timer.DelayCall(ts, () => DelayBounce_Callback(mob, corpse));
}
private void DelayBounce_Callback(object state)
private void DelayBounce_Callback(Mobile mob, Container corpse)
{
object[] states = (object[])state;
Mobile mob = (Mobile)states[0];
Container corpse = (Container)states[1];
DuelPlayer dp = null;
if (mob is PlayerMobile mobile)
dp = mobile.DuelPlayer;
DuelPlayer dp = mob is PlayerMobile mobile ? mobile.DuelPlayer : null;
m_Context.RemoveAggressions(mob);
@ -613,7 +598,7 @@ namespace Server.Engines.ConPVP
}
}
mob.CloseGump(typeof(DDBoardGump));
mob.CloseGump<DDBoardGump>();
mob.SendGump(new DDBoardGump(mob, this));
m_Context.Requip(mob, corpse);
@ -653,7 +638,7 @@ namespace Server.Engines.ConPVP
Controller.PointB.Game = this;
for (int i = 0; i < m_Context.Participants.Count; ++i)
ApplyHues(m_Context.Participants[i] as Participant,
ApplyHues(m_Context.Participants[i],
Controller.TeamInfo[i % Controller.TeamInfo.Length].Color);
m_FinishTimer?.Stop();
@ -674,37 +659,37 @@ namespace Server.Engines.ConPVP
teams.Sort((a, b) => b.Score - a.Score);
Tournament tourny = m_Context.m_Tournament;
Tournament tourney = m_Context.m_Tournament;
StringBuilder sb = new StringBuilder();
if (tourny != null && tourny.TournyType == TournyType.FreeForAll)
if (tourney != null && tourney.TourneyType == TourneyType.FreeForAll)
{
sb.Append(m_Context.Participants.Count * tourny.PlayersPerParticipant);
sb.Append(m_Context.Participants.Count * tourney.PlayersPerParticipant);
sb.Append("-man FFA");
}
else if (tourny != null && tourny.TournyType == TournyType.RandomTeam)
else if (tourney != null && tourney.TourneyType == TourneyType.RandomTeam)
{
sb.Append(tourny.ParticipantsPerMatch);
sb.Append(tourney.ParticipantsPerMatch);
sb.Append("-team");
}
else if (tourny != null && tourny.TournyType == TournyType.RedVsBlue)
else if (tourney != null && tourney.TourneyType == TourneyType.RedVsBlue)
{
sb.Append("Red v Blue");
}
else if (tourny != null && tourny.TournyType == TournyType.Faction)
else if (tourney != null && tourney.TourneyType == TourneyType.Faction)
{
sb.Append(tourny.ParticipantsPerMatch);
sb.Append(tourney.ParticipantsPerMatch);
sb.Append("-team Faction");
}
else if (tourny != null)
else if (tourney != null)
{
for (int i = 0; i < tourny.ParticipantsPerMatch; ++i)
for (int i = 0; i < tourney.ParticipantsPerMatch; ++i)
{
if (sb.Length > 0)
sb.Append('v');
sb.Append(tourny.PlayersPerParticipant);
sb.Append(tourney.PlayersPerParticipant);
}
}
@ -797,7 +782,7 @@ namespace Server.Engines.ConPVP
for (int i = 0; i < m_Context.Participants.Count; ++i)
{
Participant p = m_Context.Participants[i] as Participant;
Participant p = m_Context.Participants[i];
for (int j = 0; j < p.Players.Length; ++j)
{
@ -805,7 +790,7 @@ namespace Server.Engines.ConPVP
if (dp?.Mobile != null)
{
dp.Mobile.CloseGump(typeof(DDBoardGump));
dp.Mobile.CloseGump<DDBoardGump>();
dp.Mobile.SendGump(new DDBoardGump(dp.Mobile, this));
}
}
@ -818,7 +803,7 @@ namespace Server.Engines.ConPVP
p.Players[j].Eliminated = true;
}
m_Context.Finish(m_Context.Participants[winner.TeamID] as Participant);
m_Context.Finish(m_Context.Participants[winner.TeamID]);
}
public override void OnStop()
@ -854,7 +839,7 @@ namespace Server.Engines.ConPVP
}
for (int i = 0; i < m_Context.Participants.Count; ++i)
ApplyHues(m_Context.Participants[i] as Participant, -1);
ApplyHues(m_Context.Participants[i], -1);
m_FinishTimer?.Stop();
m_FinishTimer = null;