1- @using LobbyClient
1+ @using LobbyClient
22@using PlasmaShared
33@using ZeroKWeb
44@using ZkData
55@model LobbyClient .PwMatchCommand
66@{
77 PwMatchCommand pw = Model ;
8- string text = " " ;
8+ string text ;
99 var db = new ZkDataContext ();
1010 if (pw .Mode == PwMatchCommand .ModeType .Attack )
1111 {
12- text = string . Format ( " {0} picks a planet to attack" , pw . AttackerFaction ) ;
12+ text = " Pick a planet to attack" ;
1313 }
1414 else
1515 {
16- var planetNames = string .Join (" , " , pw .Options .Select (o => o .PlanetName ));
17- text = string .Format (" {0} attacks {2}, {1} defends " , pw . AttackerFaction , string . Join ( " , " , pw . DefenderFactions ) , planetNames );
16+ var planetNames = string .Join (" , " , pw .Options .Select (o => o .PlanetName + " ( " + ( o . AttackerFaction ?? " ? " ) + " ) " ));
17+ text = string .Format (" Defend options: {0} " , planetNames );
1818 }
19-
20- bool canClick = (pw .Mode == PwMatchCommand .ModeType .Attack && pw .AttackerFaction == Global .Account .Faction .Shortcut ) || (pw .Mode == PwMatchCommand .ModeType .Defend && pw .DefenderFactions .Contains (Global .Account .Faction .Shortcut ));
2119}
2220
2321<div id =" matchMaker" >
3028 foreach (PwMatchCommand .VoteOption opt in pw .Options )
3129 {
3230 <span style =" border : 1px solid cyan ;" >
33- @if (canClick )
31+ @if (opt . CanSelectForBattle )
3432 {
35- @Ajax.ActionLink( " Join" , " MatchMakerJoin" , new { planetID = opt .PlanetID } , new AjaxOptions { UpdateTargetId = " matchMaker" , InsertionMode = InsertionMode .Replace } )
33+ @Ajax.ActionLink( " Join" , " MatchMakerJoin" , new { planetID = opt .PlanetID , attackerFaction = opt . AttackerFaction } , new AjaxOptions { UpdateTargetId = " matchMaker" , InsertionMode = InsertionMode .Replace } )
3634 }
3735 @Html.PrintPlanet(db.Planets.First(x => x .PlanetID == opt .PlanetID ))
36+ <span >[@opt .AttackerFaction ]</span >
3837 <span >[@opt .Count /@opt .Needed ]</span >
38+ @if (opt .WinChance != null )
39+ {
40+ <span >(WHR A :@opt .AttackerAvgWhr D :@opt .DefenderAvgWhr , @opt .WinChance % attacker )</span >
41+ }
42+ else if (opt .AttackerAvgWhr > 0 )
43+ {
44+ <span >(WHR @opt .AttackerAvgWhr )</span >
45+ }
3946 </span >
4047 <text >  ;   ;  ; </text >
4148 }
4249 }
43- </div >
50+ </div >
0 commit comments