本文整理汇总了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;
}
示例2: RemoveContactingTroop
public void RemoveContactingTroop(Troop troop)
{
if (this.ContactingTroops != null)
{
this.ContactingTroops.Remove(troop);
}
}
示例3: ApplyInfluenceKind
public override void ApplyInfluenceKind(Troop troop)
{
if (troop.GetCurrentStratagemSuccess(null, false, false, false))
{
troop.Scenario.SetPositionOnFire(troop.SelfCastPosition);
}
}
示例4: ApplyInfluenceKind
public override void ApplyInfluenceKind(Troop troop)
{
if (troop != null && troop.RateOfMovability < this.rate)
{
troop.RateOfMovability = this.rate;
}
}
示例5: PurifyInfluenceKind
public override void PurifyInfluenceKind(Troop troop)
{
if (troop != null)
{
troop.ImmunityOfCaptive = false;
}
}
示例6: ApplyInfluenceKind
public override void ApplyInfluenceKind(Troop troop)
{
if (troop != null)
{
troop.YesOrNoOfObliqueView = true;
}
}
示例7: ApplyInfluenceKind
public override void ApplyInfluenceKind(Troop troop)
{
if (troop.AreaStratagemRadius < this.radius)
{
troop.AreaStratagemRadius = this.radius;
}
}
示例8: PurifyInfluenceKind
public override void PurifyInfluenceKind(Troop troop)
{
if (troop != null)
{
troop.ChanceIncrementOfChaosAfterCriticalStrike -= this.increment;
}
}
示例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;
}
示例10: ApplyInfluenceKind
public override void ApplyInfluenceKind(Troop troop)
{
if (troop.CombativityDecrementOnPower < this.decrement)
{
troop.CombativityDecrementOnPower = this.decrement;
}
}
示例11: PurifyInfluenceKind
public override void PurifyInfluenceKind(Troop troop)
{
if (troop != null)
{
troop.BaseDefenceConsidered = 0;
}
}
示例12: ApplyEventDialogs
public void ApplyEventDialogs(Troop troop)
{
if (this.OnApplyTroopEvent != null)
{
this.OnApplyTroopEvent(this, troop);
}
}
示例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;
}
}
}
示例14: ApplyInfluenceKind
public override void ApplyInfluenceKind(Troop troop)
{
if (troop.MultipleOfDefenceOnArchitecture < this.multiple)
{
troop.MultipleOfDefenceOnArchitecture = this.multiple;
}
}
示例15: ApplyInfluenceKind
public override void ApplyInfluenceKind(Troop troop)
{
if (troop != null)
{
troop.ProhibitStratagem = true;
}
}