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


C# GameObjects.Troop类代码示例

本文整理汇总了C#中GameObjects.Troop的典型用法代码示例。如果您正苦于以下问题:C# Troop类的具体用法?C# Troop怎么用?C# Troop使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Troop类属于GameObjects命名空间,在下文中一共展示了Troop类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCredit

 public override int GetCredit(Troop source, Troop destination)
 {
     if (!this.IsVaild(destination))
     {
         return 0;
     }
     int num = 0;
     int fightingForce = source.FightingForce;
     foreach (Troop troop in source.GetAreaStratagemTroops(destination, true))
     {
         int num3 = troop.Army.MoraleCeiling - troop.Army.Morale;
         if ((num3 >= 5) || !GameObject.Chance(0x5f))
         {
             int num4 = source.GetStratagemSuccessChanceCredit(troop, false, false, false);
             if (num4 > 0)
             {
                 int num5 = source.GenerateBoostIncrement(this.baseIncrement);
                 if (num3 < num5)
                 {
                     num4 = ((((num4 + ((100 - troop.Morale) / 2)) * troop.FightingForce) * num3) / num5) / fightingForce;
                 }
                 else
                 {
                     num4 = ((num4 + ((100 - troop.Morale) / 2)) * troop.FightingForce) / fightingForce;
                 }
                 num += num4;
             }
         }
     }
     return num;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:31,代码来源:InfluenceKind397.cs

示例2: RemoveContactingTroop

 public void RemoveContactingTroop(Troop troop)
 {
     if (this.ContactingTroops != null)
     {
         this.ContactingTroops.Remove(troop);
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:TileData.cs

示例3: ApplyInfluenceKind

 public override void ApplyInfluenceKind(Troop troop)
 {
     if (troop.GetCurrentStratagemSuccess(null, false, false, false))
     {
         troop.Scenario.SetPositionOnFire(troop.SelfCastPosition);
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:InfluenceKind398.cs

示例4: ApplyInfluenceKind

 public override void ApplyInfluenceKind(Troop troop)
 {
     if (troop != null && troop.RateOfMovability < this.rate)
     {
         troop.RateOfMovability = this.rate;
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:InfluenceKind250.cs

示例5: PurifyInfluenceKind

 public override void PurifyInfluenceKind(Troop troop)
 {
     if (troop != null)
     {
         troop.ImmunityOfCaptive = false;
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:InfluenceKind261.cs

示例6: ApplyInfluenceKind

 public override void ApplyInfluenceKind(Troop troop)
 {
     if (troop != null)
     {
         troop.YesOrNoOfObliqueView = true;
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:InfluenceKind270.cs

示例7: ApplyInfluenceKind

 public override void ApplyInfluenceKind(Troop troop)
 {
     if (troop.AreaStratagemRadius < this.radius)
     {
         troop.AreaStratagemRadius = this.radius;
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:InfluenceKind572.cs

示例8: PurifyInfluenceKind

 public override void PurifyInfluenceKind(Troop troop)
 {
     if (troop != null)
     {
         troop.ChanceIncrementOfChaosAfterCriticalStrike -= this.increment;
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:InfluenceKind550.cs

示例9: GetCreditWithPosition

        public override int GetCreditWithPosition(Troop source, out Point? position)
        {
            //position = 0;
            position = new Point(0, 0);

            if (source == null || source.BelongedLegion == null || source.BelongedLegion.Troops == null
                || source.BelongedLegion.WillArchitecture == null || source.BaseViewArea == null) return 0;
            
            if (((source.BelongedLegion != null) && (GameObject.Random(source.BelongedLegion.Troops.Count) == 0)) && ((source.BelongedLegion.WillArchitecture.BelongedFaction != null) && !source.BelongedFaction.IsArchitectureKnown(source.BelongedLegion.WillArchitecture)))
            {
                bool flag = false;
                foreach (Point point in source.BaseViewArea.Area)
                {
                    Architecture architectureByPosition = source.Scenario.GetArchitectureByPosition(point);
                    if (source.BelongedLegion.WillArchitecture == architectureByPosition)
                    {
                        flag = true;
                        break;
                    }
                }
                if (!(!flag || source.BelongedLegion.InformationDestination.HasValue))
                {
                    position = new Point?(source.Position);
                    return 150;
                }
            }
            return 0;
        }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:28,代码来源:InfluenceKind392.cs

示例10: ApplyInfluenceKind

 public override void ApplyInfluenceKind(Troop troop)
 {
     if (troop.CombativityDecrementOnPower < this.decrement)
     {
         troop.CombativityDecrementOnPower = this.decrement;
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:InfluenceKind603.cs

示例11: PurifyInfluenceKind

 public override void PurifyInfluenceKind(Troop troop)
 {
     if (troop != null)
     {
         troop.BaseDefenceConsidered = 0;
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:InfluenceKind381.cs

示例12: ApplyEventDialogs

 public void ApplyEventDialogs(Troop troop)
 {
     if (this.OnApplyTroopEvent != null)
     {
         this.OnApplyTroopEvent(this, troop);
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:TroopEvent.cs

示例13: ApplyInfluenceKind

 public override void ApplyInfluenceKind(Troop troop)
 {
     int recoverQuantity;
     if (troop.GetCurrentStratagemSuccess(troop.OrientationTroop, false, false, false))
     {
         troop.OrientationTroop.PreAction = TroopPreAction.恢复;
         recoverQuantity = (int)(this.rate * troop.OrientationTroop.Army.Kind.MinScale);
         if (recoverQuantity > troop.OrientationTroop.InjuryQuantity)
         {
             recoverQuantity = troop.OrientationTroop.InjuryQuantity;
         }
         troop.OrientationTroop.IncreaseQuantity(recoverQuantity);
         troop.OrientationTroop.InjuryQuantity -= recoverQuantity;
     }
     foreach (Troop troop2 in troop.AreaStratagemTroops)
     {
         if (troop.GetCurrentStratagemSuccess(troop2, false, false, false))
         {
             troop2.PreAction = TroopPreAction.恢复;
             recoverQuantity = (int)(this.rate * troop2.Army.Kind.MinScale);
             if (recoverQuantity > troop2.InjuryQuantity)
             {
                 recoverQuantity = troop2.InjuryQuantity;
             }
             troop2.IncreaseQuantity(recoverQuantity);
             troop2.OrientationTroop.InjuryQuantity -= recoverQuantity;
         }
     }
 }
开发者ID:k45399735,项目名称:ZhongHuaSanGuoZhi,代码行数:29,代码来源:InfluenceKind399.cs

示例14: ApplyInfluenceKind

 public override void ApplyInfluenceKind(Troop troop)
 {
     if (troop.MultipleOfDefenceOnArchitecture < this.multiple)
     {
         troop.MultipleOfDefenceOnArchitecture = this.multiple;
     }
 }
开发者ID:simon217,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:InfluenceKind607.cs

示例15: ApplyInfluenceKind

 public override void ApplyInfluenceKind(Troop troop)
 {
     if (troop != null)
     {
         troop.ProhibitStratagem = true;
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:InfluenceKind851.cs


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