本文整理汇总了C#中Monster.SetBareHandsAttackName方法的典型用法代码示例。如果您正苦于以下问题:C# Monster.SetBareHandsAttackName方法的具体用法?C# Monster.SetBareHandsAttackName怎么用?C# Monster.SetBareHandsAttackName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Monster
的用法示例。
在下文中一共展示了Monster.SetBareHandsAttackName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateArchetypedMonster
private Monster CreateArchetypedMonster(int monsterMinLevel, int monsterMaxLevel)
{
var newMonster = new Monster();
var targetMonsterLevel = _dice.Random(monsterMinLevel, monsterMaxLevel);
var modifierMinimum = 0;
var modifierMaximum = 0;
bool targetMonsterHasModifier = _dice.Random(1, 3) == 1; // 1/3 chance of having a modifier
if (targetMonsterHasModifier)
{
modifierMinimum = monsterModifiers.Select(x => x.LevelModifier.GetMinimumValue()).OrderBy(x => x).First();
modifierMaximum = monsterModifiers.Select(x => x.LevelModifier.GetMaximumValue()).OrderByDescending(x => x).First();
}
int targetMonsterMaxLevel = Math.Max(1, targetMonsterLevel - modifierMinimum);
int targetMonsterMinLevel = Math.Max(1, targetMonsterLevel - modifierMaximum);
var archetype = ChooseArchetypeInLevelRange(targetMonsterMinLevel, targetMonsterMaxLevel);
// We now have the archetype. Figure out what level it's going to be
int monsterLevel = _dice.Random(archetype.Level.MinValue, archetype.Level.MaxValue);
if (targetMonsterHasModifier)
{
// If we're going to have a modifier, start applying random modifiers until we get a monster in our level range.
var modifier = ChooseModifierInLevelRange(monsterMinLevel - monsterLevel, monsterMaxLevel - monsterLevel);
monsterLevel += _dice.Roll(modifier.LevelModifier);
newMonster.Name = modifier.Prefix + " " + archetype.Name;
}
else
{
// Otherwise, force the monster to be within our level range if the randomly generated level is out of range.
newMonster.Name = archetype.Name;
}
newMonster.Level = Math.Max(Math.Min(monsterLevel, monsterMaxLevel), monsterMinLevel);
newMonster.SetBareHandsAttackName(archetype.AttackName);
return newMonster;
}