public MemberTarget(LastManStandingGauntlet gauntlet, ArrayList list) : base ( 30, false, TargetFlags.None ) { m_list = list; m_gauntlet = gauntlet; }
public LastManStandingGump( LastManStandingGauntlet gauntlet, Mobile from, int page ) : base( 20, 30 ) { if(from == null || gauntlet == null || gauntlet.Deleted || gauntlet.Challenger == null) return; from.CloseGump(typeof(LastManStandingGump)); m_gauntlet = gauntlet; viewpage = page; int height = 500; AddBackground( 0, 0, 350, height, 0xDAC ); //AddAlphaRegion( 0, 0, 340, height ); AddLabel( 100, 10, 0, XmlPoints.GetText(from, 200500)); // "Last Man Standing Challenge" AddLabel( 20, 30, 0, String.Format(XmlPoints.GetText(from, 200501), gauntlet.Challenger.Name)); // "Organized by: {0}" AddLabel( 20, 50, 0, String.Format(XmlPoints.GetText(from, 200502), m_gauntlet.EntryFee)); // "Entry Fee: {0}" AddLabel( 20, 70, 0, String.Format(XmlPoints.GetText(from, 200503), m_gauntlet.ArenaSize)); // "Arena Size: {0}" AddImageTiled( 15, 110, 320, 20, 0xdb3 ); // display all of the current team members if(gauntlet.Participants != null) { // copy the master list to a temporary working list m_WorkingList = (ArrayList)gauntlet.Participants.Clone(); AddLabel( 150, 50, 0, String.Format(XmlPoints.GetText(from, 200504), m_WorkingList.Count*m_gauntlet.EntryFee)); // "Total Purse: {0}" AddLabel( 150, 70, 0, String.Format(XmlPoints.GetText(from, 200505), m_gauntlet.Location, m_gauntlet.Map)); // "Loc: {0} {1}" AddLabel( 20, 90, 0, String.Format(XmlPoints.GetText(from, 200506), gauntlet.Participants.Count)); // "Players: {0}" AddLabel( 150, 90, 0, String.Format(XmlPoints.GetText(from, 200507), gauntlet.ActivePlayers())); // "Active: {0}" int yoffset = 135; // page up and down buttons AddButton( 300, 110, 0x15E0, 0x15E4, 13, GumpButtonType.Reply, 0 ); AddButton( 320, 110, 0x15E2, 0x15E6, 12, GumpButtonType.Reply, 0 ); // find the players entry to determine the viewing page for(int i = 0;i<m_WorkingList.Count;i++) { LastManStandingGauntlet.ChallengeEntry entry = (LastManStandingGauntlet.ChallengeEntry)m_WorkingList[i]; if(entry == null) continue; if(entry.Participant == from) { viewpage = entry.PageBeingViewed; break; } } AddLabel( 220, 110, 0, String.Format(XmlPoints.GetText(from, 200508), viewpage+1, (int)(m_WorkingList.Count/PlayersPerPage)+1)); // "Page: {0}/{1}" for(int i = 0;i<m_WorkingList.Count;i++) { // determine which page is being viewed if((int)(i/PlayersPerPage) != viewpage) continue; LastManStandingGauntlet.ChallengeEntry entry = (LastManStandingGauntlet.ChallengeEntry)m_WorkingList[i]; if(entry == null) continue; // display the entry with a color indicating whether they have accepted or not Mobile m = entry.Participant; string statusmsg = XmlPoints.GetText(from, 200509); // "Waiting" int texthue = 0; // this section is available during game setup if(!m_gauntlet.GameLocked) { statusmsg = XmlPoints.GetText(from, 200509); // "Waiting" if(entry.Accepted) { texthue = 68; statusmsg = XmlPoints.GetText(from, 200510); // "Accepted" } // check to see if they have the Entry fee if(!HasEntryFee(m)) { texthue = 33; statusmsg = XmlPoints.GetText(from, 200511); // "Insufficient funds" } // if the game is still open then enable these buttons // if this is the participant then add the accept button to the entry if(m == from) { AddButton( 15, yoffset, entry.Accepted ? 0xd1 : 0xd0, entry.Accepted ? 0xd0 : 0xd1, 1000+i, GumpButtonType.Reply, 0 ); } // if this is the organizer then add the kick button to each entry if(from == m_gauntlet.Challenger || from == entry.Participant) { AddButton( 190, yoffset, 0xFB1, 0xFB3, 2000+i, GumpButtonType.Reply, 0 ); } } else { // this section is active after the game has started // enable the forfeit button if(m == from && entry.Status == ChallengeStatus.Active && !m_gauntlet.GameCompleted) { AddButton( 190, yoffset, 0xFB1, 0xFB3, 4000+i, GumpButtonType.Reply, 0 ); } if(entry.Status == ChallengeStatus.Forfeit) { texthue = 33; statusmsg = XmlPoints.GetText(from, 200520); // "Forfeit" } else if(entry.Caution == ChallengeStatus.Hidden && entry.Status == ChallengeStatus.Active) { texthue = 53; statusmsg = XmlPoints.GetText(from, 200521); // "Hidden" } else if(entry.Caution == ChallengeStatus.OutOfBounds && entry.Status == ChallengeStatus.Active) { texthue = 53; statusmsg = XmlPoints.GetText(from, 200522); // "Out of Bounds" } else if(entry.Caution == ChallengeStatus.Offline && entry.Status == ChallengeStatus.Active) { texthue = 53; statusmsg = XmlPoints.GetText(from, 200523); // "Offline" } else if(entry.Status == ChallengeStatus.Active) { texthue = 68; if(gauntlet.Winner == entry.Participant) statusmsg = XmlPoints.GetText(from, 200524); // "Winner" else statusmsg = XmlPoints.GetText(from, 200525); // "Active" } else if(entry.Status == ChallengeStatus.Dead) { texthue = 33; statusmsg = XmlPoints.GetText(from, 200526); // "Dead" } else if(entry.Status == ChallengeStatus.Disqualified) { texthue = 33; statusmsg = XmlPoints.GetText(from, 200527); // "Disqualified" } } if(m != null) { AddLabel( 40, yoffset, 0, m.Name); AddLabel( 225, yoffset, texthue, statusmsg); } yoffset += y_inc; } } // the challenger gets additional options if(from == gauntlet.Challenger && !m_gauntlet.GameLocked) { AddImageTiled( 15, height - 110, 320, 20, 0xdb3 ); AddButton( 130, height - 35, 0xFA8, 0xFAA, 100, GumpButtonType.Reply, 0 ); AddLabel( 170, height - 35, 0, XmlPoints.GetText(from, 200528) ); // "Add" AddButton( 240, height - 35, 0xFB7, 0xFB9, 300, GumpButtonType.Reply, 0 ); AddLabel( 280, height - 35, 0, XmlPoints.GetText(from, 200529) ); // "Start" // set entry fee AddButton( 20, height - 85, 0xFAE, 0xFAF, 10, GumpButtonType.Reply, 0 ); AddImageTiled(160, height - 85, 60, 19, textentrybackground ); AddTextEntry( 160, height - 85, 60, 25, 0, 10 ,m_gauntlet.EntryFee.ToString() ); AddLabel( 60, height - 85, 0, XmlPoints.GetText(from, 200530) ); // "Set Entry Fee: " // set arena size AddButton( 20, height - 60, 0xFAE, 0xFAF, 20, GumpButtonType.Reply, 0 ); AddImageTiled(160, height - 60, 30, 19, textentrybackground ); AddTextEntry( 160, height - 60, 30, 25, 0, 20 ,m_gauntlet.ArenaSize.ToString() ); AddLabel( 60, height - 60, 0, XmlPoints.GetText(from, 200531) ); // "Set Arena Size: " } else { AddImageTiled( 15, height - 60, 320, 20, 0xdb3 ); } AddButton( 20, height - 35, 0xFAB, 0xFAD, 1, GumpButtonType.Reply, 0 ); AddLabel( 60, height - 35, 0, XmlPoints.GetText(from, 200532) ); // "Refresh" if(gauntlet.GameInProgress) { AddLabel( 150, height - 35, 68, XmlPoints.GetText(from, 200533)); // "Game is in progress!" } else if(gauntlet.Winner != null) { AddLabel( 130, height - 35, 68, String.Format(XmlPoints.GetText(from, 200534), gauntlet.Winner.Name) ); // "{0} is the winner!" } //AddButton( 30, height - 35, 0xFB7, 0xFB9, 0, GumpButtonType.Reply, 0 ); //AddLabel( 70, height - 35, 0, "Close" ); }
public static void RefreshAllGumps( LastManStandingGauntlet gauntlet, bool force) { if(gauntlet.Participants != null) { foreach(LastManStandingGauntlet.ChallengeEntry entry in gauntlet.Participants) { if(entry.Participant != null) { if(force || entry.Participant.HasGump( typeof( LastManStandingGump ))) { entry.Participant.SendGump( new LastManStandingGump( gauntlet, entry.Participant)); } } } } // update for the organizer if(gauntlet.Challenger != null) { if(force || gauntlet.Challenger.HasGump( typeof( LastManStandingGump ))) { gauntlet.Challenger.SendGump( new LastManStandingGump( gauntlet, gauntlet.Challenger)); } } }
public LastManStandingGump( LastManStandingGauntlet gauntlet, Mobile from ) : this( gauntlet, from, 0 ) { }