-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
21 changed files
with
337 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0"?> | ||
<Settings> | ||
<IsMafiaEnabled>False</IsMafiaEnabled> | ||
<IsYakuzaEnabled>True</IsYakuzaEnabled> | ||
</Settings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?xml version="1.0"?> | ||
<Roles> | ||
<Role Id="Commissioner"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>false</IsRandom> | ||
<MinPlayers>0</MinPlayers> | ||
</Role> | ||
<Role Id="Doctor"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>3</MinPlayers> | ||
</Role> | ||
<Role Id="Wench"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>3</MinPlayers> | ||
</Role> | ||
<Role Id="Judge"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>3</MinPlayers> | ||
</Role> | ||
<Role Id="Elder"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>3</MinPlayers> | ||
</Role> | ||
<Role Id="Highlander"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>3</MinPlayers> | ||
</Role> | ||
<Role Id="Homeless"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>3</MinPlayers> | ||
</Role> | ||
<Role Id="Sheriff"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>3</MinPlayers> | ||
</Role> | ||
<Role Id="Prosecutor"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>3</MinPlayers> | ||
</Role> | ||
<Role Id="Mirror"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>10</MinPlayers> | ||
</Role> | ||
<Role Id="Sergeant"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>false</IsRandom> | ||
<MinPlayers>13</MinPlayers> | ||
</Role> | ||
<Role Id="Spy"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>false</IsRandom> | ||
<MinPlayers>15</MinPlayers> | ||
</Role> | ||
<Role Id="Hoodlum"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>10</MinPlayers> | ||
</Role> | ||
<Role Id="Ninja"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>10</MinPlayers> | ||
</Role> | ||
<Role Id="Maniac"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>8</MinPlayers> | ||
</Role> | ||
<Role Id="RobinHood"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>8</MinPlayers> | ||
</Role> | ||
<Role Id="Warlock"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>8</MinPlayers> | ||
</Role> | ||
<Role Id="Hacker"> | ||
<IsEnabled>true</IsEnabled> | ||
<IsRandom>true</IsRandom> | ||
<MinPlayers>12</MinPlayers> | ||
</Role> | ||
</Roles> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System.Linq; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.EntityFrameworkCore; | ||
using cloudscribe.Web.Navigation; | ||
using DiscordMafia.Services; | ||
using MafiaWeb.ViewModels.Role; | ||
using DiscordMafia.Config; | ||
using System.IO; | ||
using MafiaWeb.ViewModels.Gamemode; | ||
using System.Text.RegularExpressions; | ||
using System.Collections.Generic; | ||
|
||
namespace MafiaWeb.Controllers | ||
{ | ||
public class HelpController : Controller | ||
{ | ||
protected MainSettings settings; | ||
|
||
public HelpController(MainSettings settings) | ||
{ | ||
this.settings = settings; | ||
} | ||
|
||
public IActionResult Gamemodes() | ||
{ | ||
ViewData["Title"] = "Режимы игры"; | ||
|
||
IEnumerable<string> directories = Directory.GetDirectories(Path.Combine(settings.ConfigPath, "Gametypes")); | ||
directories = directories.Prepend(null); | ||
return View(from d in directories select new Gamemode { Name = Path.GetFileName(d) }); | ||
} | ||
|
||
public IActionResult Roles(string modeId = null) | ||
{ | ||
ViewData["Title"] = "Роли"; | ||
var modeRegex = new Regex(@"^[a-zA-Z0-9\-]+$"); | ||
if (modeId != null && !modeRegex.IsMatch(modeId)) | ||
{ | ||
return NotFound(); | ||
} | ||
|
||
ViewBag.ModeSettings = new GameSettings(settings, modeId); | ||
if (modeId != null) | ||
{ | ||
var currentCrumbAdjuster = new NavigationNodeAdjuster(Request.HttpContext) | ||
{ | ||
KeyToAdjust = "HelpGamemodeView", | ||
AdjustedText = modeId | ||
}; | ||
currentCrumbAdjuster.AddToContext(); | ||
ViewData["Title"] = $"Роли режима {modeId}"; | ||
} | ||
return View(from r in RoleInfo.AvailableRoles group r by r.Role.Team into g orderby g.Key select g); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.