Adds style cop (#109)
This commit is contained in:
parent
3e715bcb60
commit
556a17aba8
1725 changed files with 33831 additions and 38046 deletions
|
|
@ -14,14 +14,13 @@ namespace Server.Engines.ConPVP
|
|||
private const int LabelColor32 = 0xFFFFFF;
|
||||
private bool m_Active;
|
||||
|
||||
private Mobile m_From;
|
||||
private List<Mobile> m_Players;
|
||||
private Mobile m_Registrar;
|
||||
private Mobile m_Requested;
|
||||
private Tournament m_Tournament;
|
||||
private readonly Mobile m_From;
|
||||
private readonly List<Mobile> m_Players;
|
||||
private readonly Mobile m_Registrar;
|
||||
private readonly Mobile m_Requested;
|
||||
private readonly Tournament m_Tournament;
|
||||
|
||||
public AcceptTeamGump(Mobile from, Mobile requested, Tournament tourney, Mobile registrar, List<Mobile> players) :
|
||||
base(50, 50)
|
||||
public AcceptTeamGump(Mobile from, Mobile requested, Tournament tourney, Mobile registrar, List<Mobile> players) : base(50, 50)
|
||||
{
|
||||
m_From = from;
|
||||
m_Requested = requested;
|
||||
|
|
@ -31,8 +30,6 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
m_Active = true;
|
||||
|
||||
#region Rules
|
||||
|
||||
Ruleset ruleset = tourney.Ruleset;
|
||||
Ruleset basedef = ruleset.Base;
|
||||
|
||||
|
|
@ -66,8 +63,6 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
height += 10 + 22 + 25 + 25;
|
||||
|
||||
#endregion
|
||||
|
||||
Closable = false;
|
||||
|
||||
AddPage(0);
|
||||
|
|
@ -124,8 +119,6 @@ namespace Server.Engines.ConPVP
|
|||
AddImageTiled(32, 88, 264, 1, 9107);
|
||||
AddImageTiled(42, 90, 264, 1, 9157);
|
||||
|
||||
#region Rules
|
||||
|
||||
int y = 100;
|
||||
|
||||
var groupText = tourney.GroupType switch
|
||||
|
|
@ -144,8 +137,8 @@ namespace Server.Engines.ConPVP
|
|||
TieType.Random => "Random",
|
||||
TieType.Highest => "Highest advances",
|
||||
TieType.Lowest => "Lowest advances",
|
||||
TieType.FullAdvancement => (tourney.ParticipantsPerMatch == 2 ? "Both advance" : "Everyone advances"),
|
||||
TieType.FullElimination => (tourney.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated"),
|
||||
TieType.FullAdvancement => tourney.ParticipantsPerMatch == 2 ? "Both advance" : "Everyone advances",
|
||||
TieType.FullElimination => tourney.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated",
|
||||
_ => null
|
||||
};
|
||||
|
||||
|
|
@ -205,8 +198,6 @@ namespace Server.Engines.ConPVP
|
|||
y += 20;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
y += 8;
|
||||
AddImageTiled(32, y - 1, 264, 1, 9107);
|
||||
AddImageTiled(42, y + 1, 264, 1, 9157);
|
||||
|
|
|
|||
|
|
@ -72,11 +72,11 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public class ArenaGump : Gump
|
||||
{
|
||||
private List<Arena> m_Arenas;
|
||||
private readonly List<Arena> m_Arenas;
|
||||
|
||||
private int m_ColumnX = 12;
|
||||
private Mobile m_From;
|
||||
private ArenasMoongate m_Gate;
|
||||
private readonly Mobile m_From;
|
||||
private readonly ArenasMoongate m_Gate;
|
||||
|
||||
public ArenaGump(Mobile from, ArenasMoongate gate) : base(50, 50)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
private const int BlackColor32 = 0x000008;
|
||||
private const int LabelColor32 = 0xFFFFFF;
|
||||
private Mobile m_From;
|
||||
private List<Mobile> m_Players;
|
||||
private Mobile m_Registrar;
|
||||
private Tournament m_Tournament;
|
||||
private readonly Mobile m_From;
|
||||
private readonly List<Mobile> m_Players;
|
||||
private readonly Mobile m_Registrar;
|
||||
private readonly Tournament m_Tournament;
|
||||
|
||||
public ConfirmSignupGump(Mobile from, Mobile registrar, Tournament tourney, List<Mobile> players) : base(50, 50)
|
||||
{
|
||||
|
|
@ -31,8 +31,6 @@ namespace Server.Engines.ConPVP
|
|||
m_From.CloseGump<DuelContextGump>();
|
||||
m_From.CloseGump<ConfirmSignupGump>();
|
||||
|
||||
#region Rules
|
||||
|
||||
Ruleset ruleset = tourney.Ruleset;
|
||||
Ruleset basedef = ruleset.Base;
|
||||
|
||||
|
|
@ -69,21 +67,19 @@ namespace Server.Engines.ConPVP
|
|||
if (tourney.PlayersPerParticipant > 1)
|
||||
height += 36 + tourney.PlayersPerParticipant * 20;
|
||||
|
||||
#endregion
|
||||
|
||||
Closable = false;
|
||||
|
||||
AddPage(0);
|
||||
|
||||
//AddBackground( 0, 0, 400, 220, 9150 );
|
||||
// AddBackground( 0, 0, 400, 220, 9150 );
|
||||
AddBackground(1, 1, 398, height, 3600);
|
||||
//AddBackground( 16, 15, 369, 189, 9100 );
|
||||
// AddBackground( 16, 15, 369, 189, 9100 );
|
||||
|
||||
AddImageTiled(16, 15, 369, height - 29, 3604);
|
||||
AddAlphaRegion(16, 15, 369, height - 29);
|
||||
|
||||
AddImage(215, -43, 0xEE40);
|
||||
//AddImage( 330, 141, 0x8BA );
|
||||
// AddImage( 330, 141, 0x8BA );
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
|
@ -128,8 +124,6 @@ namespace Server.Engines.ConPVP
|
|||
AddImageTiled(32, 88, 264, 1, 9107);
|
||||
AddImageTiled(42, 90, 264, 1, 9157);
|
||||
|
||||
#region Rules
|
||||
|
||||
int y = 100;
|
||||
|
||||
var groupText = tourney.GroupType switch
|
||||
|
|
@ -148,8 +142,8 @@ namespace Server.Engines.ConPVP
|
|||
TieType.Random => "Random",
|
||||
TieType.Highest => "Highest advances",
|
||||
TieType.Lowest => "Lowest advances",
|
||||
TieType.FullAdvancement => (tourney.ParticipantsPerMatch == 2 ? "Both advance" : "Everyone advances"),
|
||||
TieType.FullElimination => (tourney.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated"),
|
||||
TieType.FullAdvancement => tourney.ParticipantsPerMatch == 2 ? "Both advance" : "Everyone advances",
|
||||
TieType.FullElimination => tourney.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated",
|
||||
_ => null
|
||||
};
|
||||
|
||||
|
|
@ -209,10 +203,6 @@ namespace Server.Engines.ConPVP
|
|||
y += 20;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Team
|
||||
|
||||
if (tourney.PlayersPerParticipant > 1)
|
||||
{
|
||||
y += 8;
|
||||
|
|
@ -244,8 +234,6 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
y += 8;
|
||||
AddImageTiled(32, y - 1, 264, 1, 9107);
|
||||
AddImageTiled(42, y + 1, 264, 1, 9157);
|
||||
|
|
@ -300,141 +288,141 @@ namespace Server.Engines.ConPVP
|
|||
switch (tourney.Stage)
|
||||
{
|
||||
case TournamentStage.Fighting:
|
||||
{
|
||||
if (m_Registrar != null)
|
||||
{
|
||||
if (m_Tournament.HasParticipant(from))
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "Excuse me? You are already signed up.", from.NetState);
|
||||
else
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x22, false, "The tournament has already begun. You are too late to signup now.",
|
||||
from.NetState);
|
||||
}
|
||||
if (m_Registrar != null)
|
||||
{
|
||||
if (m_Tournament.HasParticipant(from))
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "Excuse me? You are already signed up.", from.NetState);
|
||||
else
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x22, false, "The tournament has already begun. You are too late to signup now.",
|
||||
from.NetState);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case TournamentStage.Inactive:
|
||||
{
|
||||
m_Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "The tournament is closed.", from.NetState);
|
||||
|
||||
break;
|
||||
}
|
||||
case TournamentStage.Signup:
|
||||
{
|
||||
if (m_Players.Count != tourney.PlayersPerParticipant)
|
||||
{
|
||||
m_Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "You have not yet chosen your team.", from.NetState);
|
||||
|
||||
m_From.SendGump(new ConfirmSignupGump(m_From, m_Registrar, m_Tournament, m_Players));
|
||||
break;
|
||||
}
|
||||
|
||||
Ladder ladder = Ladder.Instance;
|
||||
|
||||
for (int i = 0; i < m_Players.Count; ++i)
|
||||
case TournamentStage.Inactive:
|
||||
{
|
||||
Mobile mob = m_Players[i];
|
||||
m_Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "The tournament is closed.", from.NetState);
|
||||
|
||||
LadderEntry entry = ladder?.Find(mob);
|
||||
|
||||
if (entry != null && Ladder.GetLevel(entry.Experience) < tourney.LevelRequirement)
|
||||
{
|
||||
if (m_Registrar != null)
|
||||
{
|
||||
if (mob == from)
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "You have not yet proven yourself a worthy dueler.", from.NetState);
|
||||
else
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, $"{mob.Name} has not yet proven themselves a worthy dueler.",
|
||||
from.NetState);
|
||||
}
|
||||
|
||||
m_From.SendGump(new ConfirmSignupGump(m_From, m_Registrar, m_Tournament, m_Players));
|
||||
return;
|
||||
}
|
||||
|
||||
if (tourney.IsFactionRestricted && Faction.Find(mob) == null)
|
||||
break;
|
||||
}
|
||||
case TournamentStage.Signup:
|
||||
{
|
||||
if (m_Players.Count != tourney.PlayersPerParticipant)
|
||||
{
|
||||
m_Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "Only those who have declared their faction allegiance may participate.",
|
||||
from.NetState);
|
||||
0x35, false, "You have not yet chosen your team.", from.NetState);
|
||||
|
||||
m_From.SendGump(new ConfirmSignupGump(m_From, m_Registrar, m_Tournament, m_Players));
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
if (tourney.HasParticipant(mob))
|
||||
Ladder ladder = Ladder.Instance;
|
||||
|
||||
for (int i = 0; i < m_Players.Count; ++i)
|
||||
{
|
||||
if (m_Registrar != null)
|
||||
Mobile mob = m_Players[i];
|
||||
|
||||
LadderEntry entry = ladder?.Find(mob);
|
||||
|
||||
if (entry != null && Ladder.GetLevel(entry.Experience) < tourney.LevelRequirement)
|
||||
{
|
||||
if (mob == from)
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "You have already entered this tournament.", from.NetState);
|
||||
else
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, $"{mob.Name} has already entered this tournament.", from.NetState);
|
||||
if (m_Registrar != null)
|
||||
{
|
||||
if (mob == from)
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "You have not yet proven yourself a worthy dueler.", from.NetState);
|
||||
else
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, $"{mob.Name} has not yet proven themselves a worthy dueler.",
|
||||
from.NetState);
|
||||
}
|
||||
|
||||
m_From.SendGump(new ConfirmSignupGump(m_From, m_Registrar, m_Tournament, m_Players));
|
||||
return;
|
||||
}
|
||||
|
||||
m_From.SendGump(new ConfirmSignupGump(m_From, m_Registrar, m_Tournament, m_Players));
|
||||
return;
|
||||
if (tourney.IsFactionRestricted && Faction.Find(mob) == null)
|
||||
{
|
||||
m_Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "Only those who have declared their faction allegiance may participate.",
|
||||
from.NetState);
|
||||
|
||||
m_From.SendGump(new ConfirmSignupGump(m_From, m_Registrar, m_Tournament, m_Players));
|
||||
return;
|
||||
}
|
||||
|
||||
if (tourney.HasParticipant(mob))
|
||||
{
|
||||
if (m_Registrar != null)
|
||||
{
|
||||
if (mob == from)
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, "You have already entered this tournament.", from.NetState);
|
||||
else
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, $"{mob.Name} has already entered this tournament.", from.NetState);
|
||||
}
|
||||
|
||||
m_From.SendGump(new ConfirmSignupGump(m_From, m_Registrar, m_Tournament, m_Players));
|
||||
return;
|
||||
}
|
||||
|
||||
if (mob is PlayerMobile mobile && mobile.DuelContext != null)
|
||||
{
|
||||
if (mob == from)
|
||||
m_Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false,
|
||||
"You are already assigned to a duel. You must yield it before joining this tournament.",
|
||||
from.NetState);
|
||||
else
|
||||
m_Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false,
|
||||
$"{mobile.Name} is already assigned to a duel. They must yield it before joining this tournament.",
|
||||
from.NetState);
|
||||
|
||||
m_From.SendGump(new ConfirmSignupGump(m_From, m_Registrar, m_Tournament, m_Players));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (mob is PlayerMobile mobile && mobile.DuelContext != null)
|
||||
if (m_Registrar != null)
|
||||
{
|
||||
if (mob == from)
|
||||
m_Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false,
|
||||
"You are already assigned to a duel. You must yield it before joining this tournament.",
|
||||
from.NetState);
|
||||
string fmt;
|
||||
|
||||
if (tourney.PlayersPerParticipant == 1)
|
||||
fmt =
|
||||
"As you say m'{0}. I've written your name to the bracket. The tournament will begin {1}.";
|
||||
else if (tourney.PlayersPerParticipant == 2)
|
||||
fmt =
|
||||
"As you wish m'{0}. The tournament will begin {1}, but first you must name your partner.";
|
||||
else
|
||||
m_Registrar?.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false,
|
||||
$"{mobile.Name} is already assigned to a duel. They must yield it before joining this tournament.",
|
||||
from.NetState);
|
||||
fmt = "As you wish m'{0}. The tournament will begin {1}, but first you must name your team.";
|
||||
|
||||
m_From.SendGump(new ConfirmSignupGump(m_From, m_Registrar, m_Tournament, m_Players));
|
||||
return;
|
||||
string timeUntil;
|
||||
int minutesUntil = (int)Math.Round((tourney.SignupStart + tourney.SignupPeriod - DateTime.UtcNow)
|
||||
.TotalMinutes);
|
||||
|
||||
if (minutesUntil == 0)
|
||||
timeUntil = "momentarily";
|
||||
else
|
||||
timeUntil = $"in {minutesUntil} minute{(minutesUntil == 1 ? "" : "s")}";
|
||||
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, string.Format(fmt, from.Female ? "Lady" : "Lord", timeUntil), from.NetState);
|
||||
}
|
||||
|
||||
TourneyParticipant part = new TourneyParticipant(from);
|
||||
part.Players.Clear();
|
||||
part.Players.AddRange(m_Players);
|
||||
|
||||
tourney.Participants.Add(part);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_Registrar != null)
|
||||
{
|
||||
string fmt;
|
||||
|
||||
if (tourney.PlayersPerParticipant == 1)
|
||||
fmt =
|
||||
"As you say m'{0}. I've written your name to the bracket. The tournament will begin {1}.";
|
||||
else if (tourney.PlayersPerParticipant == 2)
|
||||
fmt =
|
||||
"As you wish m'{0}. The tournament will begin {1}, but first you must name your partner.";
|
||||
else
|
||||
fmt = "As you wish m'{0}. The tournament will begin {1}, but first you must name your team.";
|
||||
|
||||
string timeUntil;
|
||||
int minutesUntil = (int)Math.Round((tourney.SignupStart + tourney.SignupPeriod - DateTime.UtcNow)
|
||||
.TotalMinutes);
|
||||
|
||||
if (minutesUntil == 0)
|
||||
timeUntil = "momentarily";
|
||||
else
|
||||
timeUntil = $"in {minutesUntil} minute{(minutesUntil == 1 ? "" : "s")}";
|
||||
|
||||
m_Registrar.PrivateOverheadMessage(MessageType.Regular,
|
||||
0x35, false, string.Format(fmt, from.Female ? "Lady" : "Lord", timeUntil), from.NetState);
|
||||
}
|
||||
|
||||
TourneyParticipant part = new TourneyParticipant(from);
|
||||
part.Players.Clear();
|
||||
part.Players.AddRange(m_Players);
|
||||
|
||||
tourney.Participants.Add(part);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (info.ButtonID > 1)
|
||||
|
|
|
|||
|
|
@ -52,9 +52,9 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
public Mobile From{ get; }
|
||||
public Mobile From { get; }
|
||||
|
||||
public DuelContext Context{ get; }
|
||||
public DuelContext Context { get; }
|
||||
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
|
|
@ -80,56 +80,56 @@ namespace Server.Engines.ConPVP
|
|||
switch (index)
|
||||
{
|
||||
case -1: // CloseGump
|
||||
{
|
||||
break;
|
||||
}
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 0: // closed
|
||||
{
|
||||
Context.Unregister();
|
||||
break;
|
||||
}
|
||||
{
|
||||
Context.Unregister();
|
||||
break;
|
||||
}
|
||||
case 1: // Rules
|
||||
{
|
||||
//m_From.SendGump( new RulesetGump( m_From, m_Context.Ruleset, m_Context.Ruleset.Layout, m_Context ) );
|
||||
From.SendGump(new PickRulesetGump(From, Context, Context.Ruleset));
|
||||
break;
|
||||
}
|
||||
{
|
||||
// m_From.SendGump( new RulesetGump( m_From, m_Context.Ruleset, m_Context.Ruleset.Layout, m_Context ) );
|
||||
From.SendGump(new PickRulesetGump(From, Context, Context.Ruleset));
|
||||
break;
|
||||
}
|
||||
case 2: // Start
|
||||
{
|
||||
if (Context.CheckFull())
|
||||
{
|
||||
Context.CloseAllGumps();
|
||||
Context.SendReadyUpGump();
|
||||
//m_Context.SendReadyGump();
|
||||
}
|
||||
else
|
||||
{
|
||||
From.SendMessage("You cannot start the duel before all participating players have been assigned.");
|
||||
From.SendGump(new DuelContextGump(From, Context));
|
||||
}
|
||||
if (Context.CheckFull())
|
||||
{
|
||||
Context.CloseAllGumps();
|
||||
Context.SendReadyUpGump();
|
||||
// m_Context.SendReadyGump();
|
||||
}
|
||||
else
|
||||
{
|
||||
From.SendMessage("You cannot start the duel before all participating players have been assigned.");
|
||||
From.SendGump(new DuelContextGump(From, Context));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3: // New Participant
|
||||
{
|
||||
if (Context.Participants.Count < 10)
|
||||
Context.Participants.Add(new Participant(Context, 1));
|
||||
else
|
||||
From.SendMessage("The number of participating parties may not be increased further.");
|
||||
{
|
||||
if (Context.Participants.Count < 10)
|
||||
Context.Participants.Add(new Participant(Context, 1));
|
||||
else
|
||||
From.SendMessage("The number of participating parties may not be increased further.");
|
||||
|
||||
From.SendGump(new DuelContextGump(From, Context));
|
||||
From.SendGump(new DuelContextGump(From, Context));
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: // Participant
|
||||
{
|
||||
index -= 4;
|
||||
{
|
||||
index -= 4;
|
||||
|
||||
if (index >= 0 && index < Context.Participants.Count)
|
||||
From.SendGump(new ParticipantGump(From, Context, Context.Participants[index]));
|
||||
if (index >= 0 && index < Context.Participants.Count)
|
||||
From.SendGump(new ParticipantGump(From, Context, Context.Participants[index]));
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public LadderController Ladder{ get; set; }
|
||||
public LadderController Ladder { get; set; }
|
||||
|
||||
public override string DefaultName => "1v1 leaderboard";
|
||||
|
||||
|
|
@ -37,10 +37,10 @@ namespace Server.Engines.ConPVP
|
|||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
Ladder = reader.ReadItem<LadderController>();
|
||||
break;
|
||||
}
|
||||
{
|
||||
Ladder = reader.ReadItem<LadderController>();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,10 +66,10 @@ namespace Server.Engines.ConPVP
|
|||
public class LadderGump : Gump
|
||||
{
|
||||
private int m_ColumnX = 12;
|
||||
private Ladder m_Ladder;
|
||||
private readonly Ladder m_Ladder;
|
||||
|
||||
private List<LadderEntry> m_List;
|
||||
private int m_Page;
|
||||
private readonly List<LadderEntry> m_List;
|
||||
private readonly int m_Page;
|
||||
|
||||
public LadderGump(Ladder ladder, int page = 0) : base(50, 50)
|
||||
{
|
||||
|
|
@ -153,7 +153,7 @@ namespace Server.Engines.ConPVP
|
|||
else
|
||||
width = (109 * xpOffset + xpAdvance / 2) / (xpAdvance - 1);
|
||||
|
||||
//AddImageTiled( 21, y + 6, width, 8, 0x2617 );
|
||||
// AddImageTiled( 21, y + 6, width, 8, 0x2617 );
|
||||
AddImageTiled(x + 3, y + 4, width, 11, 0x806);
|
||||
AddBorderedText(x, y, 115, Center(level.ToString()), 0xFFFFFF, 0);
|
||||
x += 115;
|
||||
|
|
@ -174,7 +174,7 @@ namespace Server.Engines.ConPVP
|
|||
AddBorderedText(x, y, 60, Center(entry.Losses.ToString()), 0xFFFFFF, 0);
|
||||
x += 60;
|
||||
|
||||
//AddBorderedText( 292 + 15, y, 115 - 30, String.Format( "{0} <DIV ALIGN=CENTER>/</DIV> <DIV ALIGN=RIGHT>{1}</DIV>", entry.Wins, entry.Losses ), 0xFFC000, 0 );
|
||||
// AddBorderedText( 292 + 15, y, 115 - 30, String.Format( "{0} <DIV ALIGN=CENTER>/</DIV> <DIV ALIGN=RIGHT>{1}</DIV>", entry.Wins, entry.Losses ), 0xFFC000, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
AddButton(240, 25, 0xFB1, 0xFB3, 3);
|
||||
|
||||
//AddButton( 223, 54, 0x265A, 0x265A, 4, );
|
||||
// AddButton( 223, 54, 0x265A, 0x265A, 4, );
|
||||
|
||||
AddHtml(35, 25, 230, 20, Center("Participant Setup"));
|
||||
|
||||
|
|
@ -58,11 +58,11 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
public Mobile From{ get; }
|
||||
public Mobile From { get; }
|
||||
|
||||
public DuelContext Context{ get; }
|
||||
public DuelContext Context { get; }
|
||||
|
||||
public Participant Participant{ get; }
|
||||
public Participant Participant { get; }
|
||||
|
||||
public string Center(string text) => $"<CENTER>{text}</CENTER>";
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
/*Container cont = m_Participant.Stakes;
|
||||
|
||||
if ( cont != null )
|
||||
if (cont != null)
|
||||
cont.Delete();*/
|
||||
|
||||
Context.Participants.Remove(Participant);
|
||||
|
|
@ -130,13 +130,13 @@ namespace Server.Engines.ConPVP
|
|||
From.SendGump(new ParticipantGump(From, Context, Participant));
|
||||
}
|
||||
}
|
||||
/*else if ( bid == 4 )
|
||||
/*else if (bid == 4)
|
||||
{
|
||||
m_From.SendGump( new ParticipantGump( m_From, m_Context, m_Participant ) );
|
||||
|
||||
Container cont = m_Participant.Stakes;
|
||||
|
||||
if ( cont != null && !cont.Deleted )
|
||||
if (cont != null && !cont.Deleted)
|
||||
{
|
||||
cont.DisplayTo( m_From );
|
||||
|
||||
|
|
@ -178,9 +178,9 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
private class ParticipantTarget : Target
|
||||
{
|
||||
private DuelContext m_Context;
|
||||
private int m_Index;
|
||||
private Participant m_Participant;
|
||||
private readonly DuelContext m_Context;
|
||||
private readonly int m_Index;
|
||||
private readonly Participant m_Participant;
|
||||
|
||||
public ParticipantTarget(DuelContext context, Participant p, int index) : base(12, false, TargetFlags.None)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
public class PickRulesetGump : Gump
|
||||
{
|
||||
private DuelContext m_Context;
|
||||
private Ruleset[] m_Defaults;
|
||||
private Ruleset[] m_Flavors;
|
||||
private Mobile m_From;
|
||||
private Ruleset m_Ruleset;
|
||||
private readonly DuelContext m_Context;
|
||||
private readonly Ruleset[] m_Defaults;
|
||||
private readonly Ruleset[] m_Flavors;
|
||||
private readonly Mobile m_From;
|
||||
private readonly Ruleset m_Ruleset;
|
||||
|
||||
public PickRulesetGump(Mobile from, DuelContext context, Ruleset ruleset) : base(50, 50)
|
||||
{
|
||||
|
|
@ -80,43 +80,43 @@ namespace Server.Engines.ConPVP
|
|||
switch (info.ButtonID)
|
||||
{
|
||||
case 0: // closed
|
||||
{
|
||||
if (m_Context != null)
|
||||
m_From.SendGump(new DuelContextGump(m_From, m_Context));
|
||||
|
||||
break;
|
||||
}
|
||||
case 1: // customize
|
||||
{
|
||||
m_From.SendGump(new RulesetGump(m_From, m_Ruleset, m_Ruleset.Layout, m_Context));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
int idx = info.ButtonID - 2;
|
||||
|
||||
if (idx >= 0 && idx < m_Defaults.Length)
|
||||
{
|
||||
m_Ruleset.ApplyDefault(m_Defaults[idx]);
|
||||
m_From.SendGump(new PickRulesetGump(m_From, m_Context, m_Ruleset));
|
||||
if (m_Context != null)
|
||||
m_From.SendGump(new DuelContextGump(m_From, m_Context));
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
case 1: // customize
|
||||
{
|
||||
idx -= m_Defaults.Length;
|
||||
m_From.SendGump(new RulesetGump(m_From, m_Ruleset, m_Ruleset.Layout, m_Context));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
int idx = info.ButtonID - 2;
|
||||
|
||||
if (idx >= 0 && idx < m_Flavors.Length)
|
||||
if (idx >= 0 && idx < m_Defaults.Length)
|
||||
{
|
||||
if (m_Ruleset.Flavors.Contains(m_Flavors[idx]))
|
||||
m_Ruleset.RemoveFlavor(m_Flavors[idx]);
|
||||
else
|
||||
m_Ruleset.AddFlavor(m_Flavors[idx]);
|
||||
|
||||
m_Ruleset.ApplyDefault(m_Defaults[idx]);
|
||||
m_From.SendGump(new PickRulesetGump(m_From, m_Context, m_Ruleset));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
idx -= m_Defaults.Length;
|
||||
|
||||
break;
|
||||
}
|
||||
if (idx >= 0 && idx < m_Flavors.Length)
|
||||
{
|
||||
if (m_Ruleset.Flavors.Contains(m_Flavors[idx]))
|
||||
m_Ruleset.RemoveFlavor(m_Flavors[idx]);
|
||||
else
|
||||
m_Ruleset.AddFlavor(m_Flavors[idx]);
|
||||
|
||||
m_From.SendGump(new PickRulesetGump(m_From, m_Context, m_Ruleset));
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
public class ReadyUpGump : Gump
|
||||
{
|
||||
private DuelContext m_Context;
|
||||
private Mobile m_From;
|
||||
private readonly DuelContext m_Context;
|
||||
private readonly Mobile m_From;
|
||||
|
||||
public ReadyUpGump(Mobile from, DuelContext context) : base(50, 50)
|
||||
{
|
||||
|
|
@ -33,8 +33,6 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
else
|
||||
{
|
||||
#region Participants
|
||||
|
||||
AddPage(1);
|
||||
|
||||
List<Participant> parts = context.Participants;
|
||||
|
|
@ -98,10 +96,6 @@ namespace Server.Engines.ConPVP
|
|||
AddButton(102, y, 247, 248, 0, GumpButtonType.Page, 2);
|
||||
AddButton(169, y, 242, 241, 2);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Rules
|
||||
|
||||
AddPage(2);
|
||||
|
||||
Ruleset ruleset = context.Ruleset;
|
||||
|
|
@ -184,8 +178,6 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
AddButton(102, y, 247, 248, 1);
|
||||
AddButton(169, y, 242, 241, 3);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -205,25 +197,25 @@ namespace Server.Engines.ConPVP
|
|||
switch (info.ButtonID)
|
||||
{
|
||||
case 1: // okay
|
||||
{
|
||||
if (!(m_From is PlayerMobile pm))
|
||||
{
|
||||
if (!(m_From is PlayerMobile pm))
|
||||
break;
|
||||
|
||||
pm.DuelPlayer.Ready = true;
|
||||
m_Context.SendReadyGump();
|
||||
|
||||
break;
|
||||
|
||||
pm.DuelPlayer.Ready = true;
|
||||
m_Context.SendReadyGump();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 2: // reject participants
|
||||
{
|
||||
m_Context.RejectReady(m_From, "participants");
|
||||
break;
|
||||
}
|
||||
{
|
||||
m_Context.RejectReady(m_From, "participants");
|
||||
break;
|
||||
}
|
||||
case 3: // reject rules
|
||||
{
|
||||
m_Context.RejectReady(m_From, "rules");
|
||||
break;
|
||||
}
|
||||
{
|
||||
m_Context.RejectReady(m_From, "rules");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
public class RulesetGump : Gump
|
||||
{
|
||||
private DuelContext m_DuelContext;
|
||||
private Mobile m_From;
|
||||
private RulesetLayout m_Page;
|
||||
private bool m_ReadOnly;
|
||||
private Ruleset m_Ruleset;
|
||||
private readonly DuelContext m_DuelContext;
|
||||
private readonly Mobile m_From;
|
||||
private readonly RulesetLayout m_Page;
|
||||
private readonly bool m_ReadOnly;
|
||||
private readonly Ruleset m_Ruleset;
|
||||
|
||||
public RulesetGump(Mobile from, Ruleset ruleset, RulesetLayout page, DuelContext duelContext, bool readOnly = false)
|
||||
: base(readOnly ? 310 : 50, 50)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue