本文整理汇总了C#中GameObjects.Military.IncreaseMorale方法的典型用法代码示例。如果您正苦于以下问题:C# Military.IncreaseMorale方法的具体用法?C# Military.IncreaseMorale怎么用?C# Military.IncreaseMorale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObjects.Military
的用法示例。
在下文中一共展示了Military.IncreaseMorale方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TrainMilitary
private void TrainMilitary(Military military) //训练编队
{
if ((military.TrainingPerson != null) && (military.TrainingPerson.BelongedFaction != null))
{
if (military.Morale < military.MoraleCeiling)
{
int randomValue = StaticMethods.GetRandomValue((int) ((military.TrainingPerson.TrainingAbility * this.MultipleOfTraining) * Parameters.TrainingRate), 200 + (10 * military.Scales));
if (randomValue > 0)
{
if (!base.Scenario.IsPlayer(this.BelongedFaction))
{
randomValue = (int) (randomValue * Parameters.AITrainingSpeedRate);
}
military.TrainingPerson.AddTrainingExperience(randomValue * 2);
military.TrainingPerson.AddCommandExperience(randomValue * 2);
military.TrainingPerson.IncreaseReputation(randomValue * 3);
military.TrainingPerson.BelongedFaction.IncreaseReputation(randomValue * 2);
military.TrainingPerson.BelongedFaction.IncreaseTechniquePoint(randomValue * 50);
military.IncreaseMorale(randomValue);
}
}
if (military.Combativity < military.CombativityCeiling)
{
int increment = StaticMethods.GetRandomValue((int) ((military.TrainingPerson.TrainingAbility * this.MultipleOfTraining) * Parameters.TrainingRate), 50 + (5 * military.Scales));
if (increment > 0)
{
if (!base.Scenario.IsPlayer(this.BelongedFaction))
{
increment = (int) (increment * Parameters.AITrainingSpeedRate);
}
military.TrainingPerson.AddTrainingExperience(increment);
military.TrainingPerson.AddStrengthExperience(increment);
military.TrainingPerson.IncreaseReputation(increment);
military.TrainingPerson.BelongedFaction.IncreaseReputation(0);
military.TrainingPerson.BelongedFaction.IncreaseTechniquePoint(increment * 20);
military.IncreaseCombativity(increment);
}
}
/*
if ((military.Morale >= military.MoraleCeiling) && (military.Combativity >= military.CombativityCeiling))
{
this.RemovePersonFromWorkingList(military.TrainingPerson);
//military.TrainingPerson=null;
}
*/
}
}