本文整理汇总了C#中Dice类的典型用法代码示例。如果您正苦于以下问题:C# Dice类的具体用法?C# Dice怎么用?C# Dice使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Dice类属于命名空间,在下文中一共展示了Dice类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssignmentSkills
internal override void AssignmentSkills(Character character, Dice dice)
{
switch (dice.D(6))
{
case 1:
character.Skills.Increase("Mechanic");
return;
case 2:
character.Skills.Increase(dice.Choose(SpecialtiesFor("Drive")));
return;
case 3:
character.Skills.Increase(dice.Choose(SpecialtiesFor("Flyer")));
return;
case 4:
character.Skills.Increase("Recon");
return;
case 5:
character.Skills.Increase("Heavy Weapons", "Vehicle");
return;
case 6:
character.Skills.Increase("Electronics", "Sensors");
return;
}
}
示例2: Category
public Category(string title, IRule rule, Turn turn, Dice dice)
{
Title = title;
_rule = rule;
_turn = turn;
_dice = dice;
}
示例3: TitleTable
internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
{
switch (careerHistory.Rank)
{
case 1:
return;
case 2:
careerHistory.Title = "Settler";
character.Skills.Add("Survival", 1);
return;
case 3:
return;
case 4:
careerHistory.Title = "Explorer";
character.Skills.Add("Navigation", 1);
return;
case 5:
return;
case 6:
{
var skillList = new SkillTemplateCollection(SpecialtiesFor("Gun Combat"));
skillList.RemoveOverlap(character.Skills, 1);
if (skillList.Count > 0)
character.Skills.Add(dice.Choose(skillList), 1);
}
return;
}
}
示例4: TitleTable
internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
{
switch (careerHistory.Rank)
{
case 1:
return;
case 2:
careerHistory.Title = "Technician";
{
var skillList = new SkillTemplateCollection(SpecialtiesFor("Profession"));
skillList.RemoveOverlap(character.Skills, 1);
if (skillList.Count > 0)
character.Skills.Add(dice.Choose(skillList), 1);
}
return;
case 3:
return;
case 4:
careerHistory.Title = "Craftsman";
character.Skills.Add("Mechanic", 1);
return;
case 5:
return;
case 6:
careerHistory.Title = "Master Technician";
{
var skillList = new SkillTemplateCollection(SpecialtiesFor("Engineer"));
skillList.RemoveOverlap(character.Skills, 1);
if (skillList.Count > 0)
character.Skills.Add(dice.Choose(skillList), 1);
}
return;
}
}
示例5: Awake
private void Awake()
{
List<Teleporter> teleporters = new List<Teleporter>() { new Teleporter(2, 12), new Teleporter(8, 3) };
int finalPosition = 100;
Dice dice = new Dice();
board = new Board(dice, teleporters, finalPosition);
}
示例6: TitleTable
internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
{
switch (careerHistory.Rank)
{
case 0:
careerHistory.Title = "Assistant";
return;
case 1:
careerHistory.Title = "Clerk";
character.Skills.Add("Admin", 1);
return;
case 2:
careerHistory.Title = "Supervisor";
return;
case 3:
careerHistory.Title = "Manager";
character.Skills.Add("Advocate", 1);
return;
case 4:
careerHistory.Title = "Chief";
return;
case 5:
careerHistory.Title = "Director";
character.Skills.Add("Leadership", 1);
return;
case 6:
careerHistory.Title = "Minister";
return;
}
}
示例7: TitleTable
internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
{
switch (careerHistory.Rank)
{
case 0:
careerHistory.Title = "Wastrel";
return;
case 1:
return;
case 2:
careerHistory.Title = "Ingrate";
character.Skills.Add("Carouse", 1);
return;
case 3:
return;
case 4:
careerHistory.Title = "Black Sheep";
character.Skills.Add("Persuade", 1);
return;
case 5:
return;
case 6:
careerHistory.Title = "Scoundrel";
character.Skills.Add("Jack-of-all-Trades", 1);
return;
}
}
示例8: SetUp
public void SetUp()
{
_turn = Substitute.For<Turn>();
_dice = Substitute.For<Dice>();
_onesRule = Substitute.For<IRule>();
_category = new Category("Ones", _onesRule, _turn, _dice);
}
示例9: Game
public Game(GameBoard gameBoard, Dice dice)
{
this.gameBoard = gameBoard;
this.dice = dice;
this.players = new List<Player>();
this.shuffler = new Shuffler<Player>();
}
示例10: TitleTable
/// <summary>
/// Titles the table.
/// </summary>
/// <param name="character">The character.</param>
/// <param name="careerHistory">The career history.</param>
/// <param name="dice">The dice.</param>
internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
{
switch (careerHistory.Rank)
{
case 0:
return;
case 1:
careerHistory.Title = "Freelancer";
character.Skills.Add("Electronics", "Comms", 1);
return;
case 2:
careerHistory.Title = "Staff Writer";
character.Skills.Add("Investigate", 1);
return;
case 3:
return;
case 4:
careerHistory.Title = "Correspondent";
character.Skills.Add("Persuade", 1);
return;
case 5:
return;
case 6:
careerHistory.Title = "Senior Correspondent";
character.SocialStanding += 1;
return;
}
}
示例11: TitleTable
internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
{
switch (careerHistory.Rank)
{
case 0:
return;
case 1:
character.Skills.Add("Persuade", 1);
return;
case 2:
return;
case 3:
var skillList = new SkillTemplateCollection();
skillList.AddRange(SpecialtiesFor("Gun Combat"));
skillList.AddRange(SpecialtiesFor("Melee"));
skillList.RemoveOverlap(character.Skills, 1);
if (skillList.Count > 0)
character.Skills.Add(dice.Choose(skillList), 1);
return;
case 4:
return;
case 5:
character.Skills.Add("Streetwise", 1);
return;
case 6:
return;
}
}
示例12: AssignmentSkills
internal override void AssignmentSkills(Character character, Dice dice)
{
switch (dice.D(6))
{
case 1:
{
var skillList = new SkillTemplateCollection();
skillList.Add("Art", "Holography");
skillList.Add("Art", "Write");
character.Skills.Increase(dice.Choose(skillList));
}
return;
case 2:
character.Skills.Increase(dice.Choose(SpecialtiesFor("Electronics")));
return;
case 3:
character.Skills.Increase(dice.Choose(SpecialtiesFor("Drive")));
return;
case 4:
character.Skills.Increase("Investigate");
return;
case 5:
character.Skills.Increase("Recon");
return;
case 6:
character.Skills.Increase("Streetwise");
return;
}
}
示例13: BasicTrainingSkills
internal override void BasicTrainingSkills(Character character, Dice dice, bool all)
{
var roll = dice.D(6);
if (all || roll == 1)
{
if (all)
{
character.Skills.AddRange(SpecialtiesFor("Drive"));
character.Skills.Add("Vacc Suit");
}
else
{
var skillList = new SkillTemplateCollection();
skillList.AddRange(SpecialtiesFor("Drive"));
skillList.Add("Vacc Suit");
skillList.RemoveOverlap(character.Skills, 0);
if (skillList.Count > 0)
character.Skills.Add(dice.Choose(skillList));
}
}
if (all || roll == 2)
character.Skills.AddRange(SpecialtiesFor("Athletics"));
if (all || roll == 3)
character.Skills.AddRange(SpecialtiesFor("Gun Combat"));
if (all || roll == 4)
character.Skills.Add("Recon");
if (all || roll == 5)
character.Skills.AddRange(SpecialtiesFor("Melee"));
if (all || roll == 6)
character.Skills.AddRange(SpecialtiesFor("Heavy Weapons"));
}
示例14: calcEccentricity
public static void calcEccentricity(Dice ourDice, Star s)
{
int modifiers = 0; //reset the thing.
if (OptionCont.lessStellarEccent)
{
//now we generate eccentricities
if (s.orbitalSep == Star.ORBSEP_VERYCLOSE) modifiers = modifiers - 10; //Very Close
if (s.orbitalSep == Star.ORBSEP_CLOSE) modifiers = modifiers - 6; //Close
if (s.orbitalSep == Star.ORBSEP_MODERATE) modifiers = modifiers - 2; //Moderate
}
else
{
if (s.orbitalSep == Star.ORBSEP_VERYCLOSE) modifiers = modifiers - 6; //Very Close
if (s.orbitalSep == Star.ORBSEP_CLOSE) modifiers = modifiers - 4; //Close
if (s.orbitalSep == Star.ORBSEP_MODERATE) modifiers = modifiers - 2; //Moderate
}
int roll = ourDice.gurpsRoll(modifiers);
Star.generateEccentricity(roll, s);
if (OptionCont.forceVeryLowStellarEccent)
{
if (s.orbitalEccent > .2) s.orbitalEccent = .1;
if (s.orbitalEccent > .1 && s.orbitalEccent < .2) s.orbitalEccent = .05;
}
}
示例15: TitleTable
internal override void TitleTable(Character character, CareerHistory careerHistory, Dice dice)
{
switch (careerHistory.Rank)
{
case 0:
return;
case 1:
careerHistory.Title = "Agent";
character.Skills.Add("Deception", 1);
return;
case 2:
careerHistory.Title = "Field Agent";
character.Skills.Add("Investigate", 1);
return;
case 3:
return;
case 4:
careerHistory.Title = "Special Agent";
var skillList = new SkillTemplateCollection(SpecialtiesFor("Gun Combat"));
skillList.RemoveOverlap(character.Skills, 1);
if (skillList.Count > 0)
character.Skills.Add(dice.Choose(skillList), 1);
return;
case 5:
careerHistory.Title = "Assistant Director";
return;
case 6:
careerHistory.Title = "Director";
return;
}
}