当前位置: 首页>>代码示例>>C#>>正文


C# Military.IncreaseMorale方法代码示例

本文整理汇总了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;
                }
                */



            }
        }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:51,代码来源:Architecture_1.cs


注:本文中的GameObjects.Military.IncreaseMorale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。