rendered paste body<%@ Page Language="C#" Debug="True"%>
<%@ Import namespace="System.Xml"%>
<%@ Import namespace="System.Xml.XPath"%>
<script runat="server">
public Int32 PlacedLocations;
public Button Button11;
public Button Button12;
public Button Button13;
public Button Button14;
public Button Button21;
public Button Button22;
public Button Button23;
public Button Button24;
public Button Button31;
public Button Button32;
public Button Button33;
public Button Button34;
public Button Button41;
public Button Button42;
public Button Button43;
public Button Button44;
public Table Field;
public TableRow Row1;
public TableRow Row2;
public TableRow Row3;
public TableRow Row4;
public TableCell Cell11;
public TableCell Cell12;
public TableCell Cell13;
public TableCell Cell14;
public TableCell Cell21;
public TableCell Cell22;
public TableCell Cell23;
public TableCell Cell24;
public TableCell Cell31;
public TableCell Cell32;
public TableCell Cell33;
public TableCell Cell34;
public TableCell Cell41;
public TableCell Cell42;
public TableCell Cell43;
public TableCell Cell44;
public DropDownList Locations;
public void BuildField(Object Sender, EventArgs E)
{
play.Controls.Remove(SealedDeck);
Locations = new DropDownList();
Locations.ID = "Locations";
ListItem Item1 = new ListItem();
ListItem Item2 = new ListItem();
ListItem Item3 = new ListItem();
ListItem Item4 = new ListItem();
ListItem Item5 = new ListItem();
ListItem Item6 = new ListItem();
ListItem Item7 = new ListItem();
ArrayList Deck = GetDeck();
ArrayList Locs = (ArrayList) Deck[4];
Item1.Text = GetCardName(Locs[0].ToString());
Item2.Text = GetCardName(Locs[1].ToString());
Item3.Text = GetCardName(Locs[2].ToString());
Item4.Text = GetCardName(Locs[3].ToString());
Item5.Text = GetCardName(Locs[4].ToString());
Item6.Text = GetCardName(Locs[5].ToString());
Item7.Text = GetCardName(Locs[6].ToString());
Item1.Value = Locs[0].ToString();
Item2.Value = Locs[1].ToString();
Item3.Value = Locs[2].ToString();
Item4.Value = Locs[3].ToString();
Item5.Value = Locs[4].ToString();
Item6.Value = Locs[5].ToString();
Item7.Value = Locs[6].ToString();
Locations.Items.Add(Item1);
Locations.Items.Add(Item2);
Locations.Items.Add(Item3);
Locations.Items.Add(Item4);
Locations.Items.Add(Item5);
Locations.Items.Add(Item6);
Locations.Items.Add(Item7);
play.Controls.Add(Locations);
Field = new Table();
Row1 = new TableRow();
Row2 = new TableRow();
Row3 = new TableRow();
Row4 = new TableRow();
Cell11 = new TableCell();
Cell12 = new TableCell();
Cell13 = new TableCell();
Cell14 = new TableCell();
Cell21 = new TableCell();
Cell22 = new TableCell();
Cell23 = new TableCell();
Cell24 = new TableCell();
Cell31 = new TableCell();
Cell32 = new TableCell();
Cell33 = new TableCell();
Cell34 = new TableCell();
Cell41 = new TableCell();
Cell42 = new TableCell();
Cell43 = new TableCell();
Cell44 = new TableCell();
Button11 = new Button();
Button12 = new Button();
Button13 = new Button();
Button14 = new Button();
Button21 = new Button();
Button22 = new Button();
Button23 = new Button();
Button24 = new Button();
Button31 = new Button();
Button32 = new Button();
Button33 = new Button();
Button34 = new Button();
Button41 = new Button();
Button42 = new Button();
Button43 = new Button();
Button44 = new Button();
Button11.ID = "X1Y1";
Button12.ID = "X2Y1";
Button13.ID = "X3Y1";
Button13.ID = "X4Y1";
Button21.ID = "X1Y2";
Button22.ID = "X2Y2";
Button23.ID = "X3Y2";
Button23.ID = "X4Y2";
Button31.ID = "X1Y3";
Button32.ID = "X2Y3";
Button33.ID = "X3Y3";
Button33.ID = "X4Y3";
Button41.ID = "X1Y4";
Button42.ID = "X2Y4";
Button43.ID = "X3Y4";
Button44.ID = "X4Y4";
Button11.Click += new System.EventHandler(BuildField);
Button12.Click += new System.EventHandler(PlaceLocation);
Button13.Click += new System.EventHandler(PlaceLocation);
Button14.Click += new System.EventHandler(PlaceLocation);
Button21.Click += new System.EventHandler(PlaceLocation);
Button22.Click += new System.EventHandler(PlaceLocation);
Button23.Click += new System.EventHandler(PlaceLocation);
Button24.Click += new System.EventHandler(PlaceLocation);
Button31.Click += new System.EventHandler(PlaceLocation);
Button32.Click += new System.EventHandler(PlaceLocation);
Button33.Click += new System.EventHandler(PlaceLocation);
Button34.Click += new System.EventHandler(PlaceLocation);
Button41.Click += new System.EventHandler(PlaceLocation);
Button42.Click += new System.EventHandler(PlaceLocation);
Button43.Click += new System.EventHandler(PlaceLocation);
Button44.Click += new System.EventHandler(PlaceLocation);
Button11.Text = "Here";
Button12.Text = "Here";
Button13.Text = "Here";
Button14.Text = "Here";
Button21.Text = "Here";
Button22.Text = "Here";
Button23.Text = "Here";
Button24.Text = "Here";
Button31.Text = "Here";
Button32.Text = "Here";
Button33.Text = "Here";
Button34.Text = "Here";
Button41.Text = "Here";
Button42.Text = "Here";
Button43.Text = "Here";
Button44.Text = "Here";
Cell11.Controls.Add(Button11);
Cell12.Controls.Add(Button12);
Cell13.Controls.Add(Button13);
Cell14.Controls.Add(Button14);
Cell21.Controls.Add(Button21);
Cell22.Controls.Add(Button22);
Cell23.Controls.Add(Button23);
Cell24.Controls.Add(Button24);
Cell31.Controls.Add(Button31);
Cell32.Controls.Add(Button32);
Cell33.Controls.Add(Button33);
Cell34.Controls.Add(Button34);
Cell41.Controls.Add(Button41);
Cell42.Controls.Add(Button42);
Cell43.Controls.Add(Button43);
Cell44.Controls.Add(Button44);
Row1.Cells.Add(Cell11);
Row1.Cells.Add(Cell12);
Row1.Cells.Add(Cell13);
Row1.Cells.Add(Cell14);
Row2.Cells.Add(Cell21);
Row2.Cells.Add(Cell22);
Row2.Cells.Add(Cell23);
Row2.Cells.Add(Cell24);
Row3.Cells.Add(Cell31);
Row3.Cells.Add(Cell32);
Row3.Cells.Add(Cell33);
Row3.Cells.Add(Cell34);
Row4.Cells.Add(Cell41);
Row4.Cells.Add(Cell42);
Row4.Cells.Add(Cell43);
Row4.Cells.Add(Cell44);
Field.Rows.Add(Row1);
Field.Rows.Add(Row2);
Field.Rows.Add(Row3);
Field.Rows.Add(Row4);
play.Controls.Add(Field);
}
public void PlaceLocation(Object Sender, EventArgs E)
{
if (PlacedLocations == 2)
{
ArrayList Deck = GetDeck();
ArrayList Hav = (ArrayList) Deck[2];
ListItem Item8 = new ListItem();
Item8.Value = Hav[0].ToString();
Item8.Text = GetCardName(Hav[0].ToString());
Locations.Items.Add(Item8);
}
Button SelectedLocation = (Button) Sender;
SelectedLocation.Text = Locations.SelectedItem.Value;
SelectedLocation.Click -= new System.EventHandler(PlaceLocation);
Locations.Items.Remove(Locations.SelectedItem);
}
public ArrayList GetDeck()
{
ArrayList StartingCharacters = new ArrayList();
StartingCharacters.Add("card001");
StartingCharacters.Add("card005");
StartingCharacters.Add("card081");
StartingCharacters.Add("card062");
ArrayList Powers = new ArrayList();
Powers.Add("card102");
Powers.Add("card103");
Powers.Add("card104");
Powers.Add("card105");
Powers.Add("card106");
Powers.Add("card158");
Powers.Add("card159");
Powers.Add("card160");
Powers.Add("card161");
Powers.Add("card162");
Powers.Add("card219");
Powers.Add("card220");
Powers.Add("card221");
Powers.Add("card222");
Powers.Add("card223");
Powers.Add("card320");
Powers.Add("card321");
Powers.Add("card322");
Powers.Add("card323");
Powers.Add("card324");
ArrayList Haven = new ArrayList();
Haven.Add("card376");
ArrayList Items = new ArrayList();
Items.Add("card396");
Items.Add("card397");
Items.Add("card398");
Items.Add("card399");
Items.Add("card400");
Items.Add("card401");
Items.Add("card402");
ArrayList Locations = new ArrayList();
Locations.Add("card469");
Locations.Add("card470");
Locations.Add("card471");
Locations.Add("card472");
Locations.Add("card473");
Locations.Add("card474");
Locations.Add("card475");
ArrayList Disasters = new ArrayList();
Disasters.Add("card553");
Disasters.Add("card554");
Disasters.Add("card555");
Disasters.Add("card556");
Disasters.Add("card557");
Disasters.Add("card558");
Disasters.Add("card559");
Disasters.Add("card560");
Disasters.Add("card561");
Disasters.Add("card562");
Disasters.Add("card608");
Disasters.Add("card609");
Disasters.Add("card610");
Disasters.Add("card611");
Disasters.Add("card612");
Disasters.Add("card613");
Disasters.Add("card614");
Disasters.Add("card615");
Disasters.Add("card616");
Disasters.Add("card617");
ArrayList CombatCards = new ArrayList();
CombatCards.Add("card720");
CombatCards.Add("card721");
CombatCards.Add("card722");
CombatCards.Add("card723");
CombatCards.Add("card724");
CombatCards.Add("card725");
CombatCards.Add("card726");
CombatCards.Add("card727");
CombatCards.Add("card728");
CombatCards.Add("card729");
CombatCards.Add("card730");
CombatCards.Add("card731");
CombatCards.Add("card732");
CombatCards.Add("card733");
CombatCards.Add("card734");
CombatCards.Add("card735");
CombatCards.Add("card736");
CombatCards.Add("card737");
CombatCards.Add("card738");
CombatCards.Add("card739");
CombatCards.Add("card740");
ArrayList Deck = new ArrayList();
Deck.Add(StartingCharacters);
Deck.Add(Powers);
Deck.Add(Haven);
Deck.Add(Items);
Deck.Add(Locations);
Deck.Add(Disasters);
Deck.Add(CombatCards);
return Deck;
}
public string GetCardName(String XmlId)
{
XmlDocument XmlDocument = new XmlDocument();
XmlDocument.Load("htdocs/animayhem.xml");
XmlNamespaceManager XmlNamespaceManager = new XmlNamespaceManager(XmlDocument.NameTable);
XmlNamespaceManager.AddNamespace("xml", "http://www.w3.org/XML/1998/namespace");
XmlNamespaceManager.AddNamespace("am","http://www.ani-mayhem.com/");
XmlNamespaceManager.AddNamespace("db","http://www.ani-mayhem.com/database/");
XmlNamespaceManager.AddNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
return XmlDocument.SelectSingleNode("//am:card[@xml:id='" + XmlId + "']", XmlNamespaceManager).ChildNodes[0].InnerText;
}
</script><html>
<head>
<title>
play.ani-mayhem.com
</title>
</head>
<body>
<form Runat="server" ID="play" method="post">
<asp:Button Runat="server" ID="SealedDeck" Text="Sealed Deck (Random)" OnClick="BuildField"/>
</form>
</body>
</html>