public ChallengeGump(DuelObject duel) : base(50,50) { this.duel = duel; this.Closable = true; this.Disposable = true; this.Dragable = true; this.Resizable = false; this.AddPage(0); this.AddBackground(63, 103, 350, 475, 9270); this.AddLabel(209, 112, 1259, @"Challenge"); this.AddLabel(101, 141, 1259, @"You are about to challenge " + duel.Player2.Name + " to a duel."); this.AddLabel(104, 170, 1259, @"Opponent:"); this.AddLabel(244, 170, 1259, @"You:"); this.AddLabel(104, 195, 1259, @"Honor:"); this.AddLabel(104, 214, 1259, @"Rank:"); this.AddLabel(244, 195, 1259, @"Honor:"); this.AddLabel(244, 215, 1259, @"Rank:"); this.AddLabel(164, 195, 1149, @"" + ((PlayerMobile)duel.Player2).Honor); this.AddLabel(164, 215, 1149, @"" + (Ladder.Players.IndexOf(duel.Player2) + 1)); this.AddLabel(304, 195, 1149, @"" + ((PlayerMobile)duel.Player1).Honor); this.AddLabel(304, 215, 1149, @"" + (Ladder.Players.IndexOf(duel.Player1) + 1)); this.AddLabel(104, 245, 1259, @"Rules:"); this.AddLabel(104, 270, 1259, @"Duel Type:"); this.AddLabel(104, 295, 1259, @"Potions allowed:"); this.AddLabel(104, 320, 1259, @"Summoning allowed:"); this.AddLabel(104, 345, 1259, @"Looting allowed:"); this.AddLabel(104, 370, 1259, @"Poisoned Weapons allowed:"); this.AddLabel(104, 395, 1259, @"Magic Weapons allowed:"); this.AddLabel(104, 420, 1259, @"Magery allowed:"); this.AddLabel(104, 445, 1259, @"Maximum Dexterity:"); this.AddLabel(104, 470, 1259, @"Wager gold:"); this.AddLabel(304, 270, 1149, @"" + (duel.DuelType == 1 ? "5x Mage" : duel.DuelType == 2 ? "7x Mage" : "Dex Monkey")); this.AddLabel(304, 295, 1149, @"" + (duel.Potions ? "Yes" : "No")); this.AddLabel(304, 320, 1149, @"" + (duel.Summoning ? "Yes" : "No")); this.AddLabel(304, 345, 1149, @"" + (duel.Looting ? "Yes" : "No")); this.AddLabel(304, 370, 1149, @"" + (duel.PoisonedWeapons ? "Yes" : "No")); this.AddLabel(304, 395, 1149, @"" + (duel.MagicWeapons ? "Yes" : "No")); this.AddLabel(304, 420, 1149, @"" + (duel.Magery ? "Yes" : "No")); this.AddLabel(304, 445, 1149, @"" + duel.MaxDex); this.AddLabel(304, 470, 1149, @"" + duel.Wager); this.AddLabel(123, 500, 1259, @"Are you sure you want to challenge?"); this.AddButton(151, 525, 247, 248, (int)Buttons.Button1, GumpButtonType.Reply, 0); this.AddButton(246, 525, 241, 242, (int)Buttons.Button2, GumpButtonType.Reply, 0); }
public EndDuelGump(DuelObject duel) : base( 50, 50 ) { this.duel = duel; this.Closable = true; this.Disposable = true; this.Dragable = true; this.Resizable = false; this.AddPage(0); this.AddBackground(116, 106, 249, 143, 9270); this.AddLabel(209, 112, 1259, @"End duel?"); this.AddButton(150, 216, 247, 248, (int)Buttons.Button1, GumpButtonType.Reply, 0); this.AddButton(250, 216, 241, 242, (int)Buttons.Button2, GumpButtonType.Reply, 0); this.AddLabel(130, 160, 1149, @"If you end the duel now you will lose."); }
public WaitGump(DuelObject duel) : base( 50, 50 ) { this.duel = duel; this.Closable = true; this.Disposable = true; this.Dragable = true; this.Resizable = false; this.AddPage(0); this.AddBackground(116, 106, 249, 143, 9270); this.AddLabel(209, 112, 1259, @"Challenge"); this.AddLabel(153, 139, 1149, @"The challenge has been made,"); this.AddButton(209, 216, 241, 242, (int)Buttons.Button1, GumpButtonType.Reply, 0); this.AddLabel(139, 193, 1149, @"You can still cancel the challenge."); this.AddLabel(130, 160, 1149, @"Waiting for response from opponent."); }
public DuelTimer(DuelObject duel, int ticks) : base(TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.0 )) { this.TimeOut = ticks; this.duel = duel; }
public CountTimer(DuelObject duel, int ticks) : base(TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 )) { this.count = ticks; this.duel = duel; duel.Wall(count); }
public static void LoadDuels() { if (File.Exists(duelIdxPath) && File.Exists(duelBinPath)) { // Declare and initialize reader objects. FileStream idx = new FileStream(duelIdxPath, FileMode.Open, FileAccess.Read, FileShare.Read); FileStream bin = new FileStream(duelBinPath, FileMode.Open, FileAccess.Read, FileShare.Read); BinaryReader idxReader = new BinaryReader(idx); BinaryFileReader binReader = new BinaryFileReader(new BinaryReader(bin)); // Start by reading the number of duels from an index file int duelCount = idxReader.ReadInt32(); for (int i = 0; i < duelCount; ++i) { DuelObject d = new DuelObject(); // Read start-position and length of current fight from index file long startPos = idxReader.ReadInt64(); int length = idxReader.ReadInt32(); // Point the reading stream to the proper position binReader.Seek(startPos, SeekOrigin.Begin); try { d.Deserialize(binReader); if (binReader.Position != (startPos + length)) throw new Exception(String.Format("***** Bad serialize on DuelObject[{0}] *****", i)); } catch (Exception e) { //handle } duels.Add(d); } // Remember to close the streams idxReader.Close(); binReader.Close(); } }