NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

//substitute with seer
var apps = rolesToAssign.IndexOf(IRole.ApprenticeSeer);
rolesToAssign[apps] = IRole.Seer;
}

//rabid without alpha is useless
if (rolesToAssign.Contains(IRole.RabidWolf) && !rolesToAssign.Contains(IRole.AlphaWolf))
{
var wolves = rolesToAssign.Where(x => WolfRoles.Contains(x) && x != IRole.RabidWolf);
if (wolves.Any())
{
//just pick another wolf, and turn them to alpha
var wolf = rolesToAssign.FindIndex(x => WolfRoles.Contains(x) && x != IRole.RabidWolf);
rolesToAssign[wolf] = IRole.AlphaWolf;
}
else
{
//turn that rabid wolf into the alpha
var rabid = rolesToAssign.IndexOf(IRole.RabidWolf);
rolesToAssign[rabid] = IRole.AlphaWolf;
}
}

//make sure that we have at least one new role (for testing)
{
var neutralKiller = rolesToAssign.FirstOrDefault(x => gameConditions.Contains(x));
//make sure that we have at least two teams
if (
rolesToAssign.Any(x => !nonVgRoles.Contains(x)) //make sure we have VGs
&& rolesToAssign.Any(x => gameConditions.Contains(x) || WolfRoles.Contains(x)) //make sure we have at least one enemy
)
balanced = true;
else if (rolesToAssign.Any(x => gameConditions.Contains(x)) && rolesToAssign.Any(x => WolfRoles.Contains(x)))
balanced = true; // wolves vs sk/pyro/cult works too
else if (rolesToAssign.Any(x => gameConditions.Contains(x) && (x != neutralKiller || x == IRole.SerialKiller)))
balanced = true; // sk/pyro/cult fighting each other works too. sk vs sk too
//else, redo role assignment. better to rely on randomness, than trying to fix it
}

if (gameMode == 2 && !rolesToAssign.Contains(IRole.ClumsyGuy))
{
balanced = false;
}

//never have lone guard
if (rolesToAssign.Count(x => x == IRole.Guard) == 1)
balanced = false;

if (rolesToAssign.Count(x = x == IRole.Baker) == 1)
balanced = false;

if (gameMode != 3)
{
// make sure we have a minimum amount of wolves
if (rolesToAssign.Count(x => WolfRoles.Contains(x) || SupportWolves.Contains(x)) < forcedWolves)
balanced = false;

// make sure we have a minimum amount of safes
if (rolesToAssign.Count(x => SafeRoles.Contains(x)) < forcedSafes)
balanced = false;

// make sure we have a minimum amount of vgs
int maxBaddies = ((count - 1) / 2) - 1;
if (StrongMode && gameMode != 5)
maxBaddies++;
if (count == 4)
maxBaddies = 1;
if (rolesToAssign.Count(x => nonVgRoles.Contains(x) || AllyRoles.Contains(x) || x == IRole.Cupid) > maxBaddies)
balanced = false;
}

var masons = rolesToAssign.Count(x => x == IRole.Mason); // masons are only allowed in strong mode if there are 3!
if (StrongMode && gameMode != 5 && (masons == 1 || masons == 2))
balanced = false;

//the roles to assign are good, now if it's not a chaos game we need to check if they're balanced
if (gameMode != 1 && gameMode != 3)
{
var villageStrength =
rolesToAssign.Where(x => !nonVgRoles.Contains(x)).Sum(x => x.GetStrength(rolesToAssign));
var enemyStrength =
rolesToAssign.Where(x => nonVgRoles.Contains(x)).Sum(x => x.GetStrength(rolesToAssign));

//big games usually have few evils
if (count > 10)
{
villageStrength += ((count / 3) - 3);
}

//check balance
var varianceAllowed = (count / 6) + 1;
balanced = balanced && (Math.Abs(villageStrength - enemyStrength) <= varianceAllowed);
}
} while (!balanced);
}
else
{
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.