本文整理汇总了C#中TargetModifiers类的典型用法代码示例。如果您正苦于以下问题:C# TargetModifiers类的具体用法?C# TargetModifiers怎么用?C# TargetModifiers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TargetModifiers类属于命名空间,在下文中一共展示了TargetModifiers类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CanTarget
public bool CanTarget(Actor self, Target target, List<Actor> othersAtTarget, ref TargetModifiers modifiers, ref string cursor)
{
var type = target.Type;
if (type != TargetType.Actor && type != TargetType.FrozenActor)
return false;
cursor = this.cursor;
IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);
if (ForceAttack != null && modifiers.HasModifier(TargetModifiers.ForceAttack) != ForceAttack)
return false;
var owner = type == TargetType.FrozenActor ? target.FrozenActor.Owner : target.Actor.Owner;
var playerRelationship = self.Owner.Stances[owner];
if (!modifiers.HasModifier(TargetModifiers.ForceAttack) && playerRelationship == Stance.Ally && !targetAllyUnits)
return false;
if (!modifiers.HasModifier(TargetModifiers.ForceAttack) && playerRelationship == Stance.Enemy && !targetEnemyUnits)
return false;
return type == TargetType.FrozenActor ?
CanTargetFrozenActor(self, target.FrozenActor, modifiers, ref cursor) :
CanTargetActor(self, target.Actor, modifiers, ref cursor);
}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:25,代码来源:UnitOrderTargeter.cs
示例2: CanTargetFrozenActor
public override bool CanTargetFrozenActor(Actor self, FrozenActor target, TargetModifiers modifiers, ref string cursor)
{
var c = target.Info.Traits.GetOrDefault<CapturableInfo>();
var canTargetActor = c != null && c.CanBeTargetedBy(self, target.Owner);
cursor = canTargetActor ? "ability" : "move-blocked";
return canTargetActor;
}
开发者ID:TiriliPiitPiit,项目名称:OpenRA,代码行数:8,代码来源:Captures.cs
示例3: CanTargetActor
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
{
// Obey force moving onto bridges
if (modifiers.HasModifier(TargetModifiers.ForceMove))
return false;
return target.TraitsImplementing<IDemolishable>().Any(i => i.IsValidTarget(target, self));
}
开发者ID:Berzeger,项目名称:OpenRA,代码行数:8,代码来源:C4Demolition.cs
示例4: CanTargetActor
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
{
var c = target.TraitOrDefault<ExternalCapturable>();
var canTargetActor = c != null && !c.CaptureInProgress && c.Info.CanBeTargetedBy(self, target.Owner);
cursor = canTargetActor ? "ability" : "move-blocked";
return canTargetActor;
}
开发者ID:CH4Code,项目名称:OpenRA,代码行数:8,代码来源:ExternalCaptures.cs
示例5: CanTargetFrozenActor
public override bool CanTargetFrozenActor(Actor self, FrozenActor target, TargetModifiers modifiers, ref string cursor)
{
var c = target.Info.TraitInfoOrDefault<ExternalCapturableInfo>();
var canTargetActor = c != null && c.CanBeTargetedBy(self, target.Owner);
var capturesInfo = self.Trait<ExternalCaptures>().Info;
cursor = canTargetActor ? capturesInfo.CaptureCursor : capturesInfo.CaptureBlockedCursor;
return canTargetActor;
}
开发者ID:pchote,项目名称:OpenRA,代码行数:9,代码来源:ExternalCaptures.cs
示例6: CanTarget
public bool CanTarget(Actor self, Target target, List<Actor> othersAtTarget, ref TargetModifiers modifiers, ref string cursor)
{
if (target.Type != TargetType.Actor)
return false;
IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);
cursor = this.cursor();
return self == target.Actor;
}
开发者ID:CH4Code,项目名称:OpenRA,代码行数:10,代码来源:DeployOrderTargeter.cs
示例7: CanTarget
public bool CanTarget(Actor self, Target target, List<Actor> othersAtTarget, TargetModifiers modifiers, ref string cursor)
{
if (target.Type != TargetType.Actor)
return false;
IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);
cursor = useDeployCursor() ? "deploy" : "deploy-blocked";
return self == target.Actor;
}
开发者ID:Berzeger,项目名称:OpenRA,代码行数:10,代码来源:DeployOrderTargeter.cs
示例8: CanTarget
public bool CanTarget(Actor self, Target target, List<Actor> othersAtTarget, TargetModifiers modifiers, ref string cursor)
{
if (target.Type != TargetType.Terrain)
return false;
var location = self.World.Map.CellContaining(target.CenterPosition);
if (self.World.Map.Contains(location))
{
cursor = "ability";
return true;
}
return false;
}
开发者ID:JackKucan,项目名称:OpenRA,代码行数:14,代码来源:RallyPoint.cs
示例9: CanTarget
public bool CanTarget(Actor self, Target target, List<Actor> othersAtTarget, ref TargetModifiers modifiers, ref string cursor)
{
if (target.Type != TargetType.Terrain)
return false;
var location = self.World.Map.CellContaining(target.CenterPosition);
var explored = self.Owner.Shroud.IsExplored(location);
cursor = self.World.Map.Contains(location) ?
(self.World.Map.GetTerrainInfo(location).CustomCursor ?? "move") :
"move-blocked";
IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);
if (!explored && !info.MoveIntoShroud)
cursor = "move-blocked";
return true;
}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:18,代码来源:AircraftMoveOrderTargeter.cs
示例10: CanTargetActor
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
{
var hut = target.TraitOrDefault<BridgeHut>();
if (hut == null)
return false;
// Require force attack to heal partially damaged bridges to avoid unnecessary cursor noise
var damage = hut.BridgeDamageState;
if (!modifiers.HasModifier(TargetModifiers.ForceAttack) && damage != DamageState.Dead)
return false;
// Obey force moving onto bridges
if (modifiers.HasModifier(TargetModifiers.ForceMove))
return false;
// Can't repair a bridge that is undamaged, already under repair, or dangling
if (damage == DamageState.Undamaged || hut.Repairing || hut.Bridge.IsDangling)
cursor = "goldwrench-blocked";
return true;
}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:21,代码来源:RepairsBridges.cs
示例11: CanTargetActor
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
{
return target.HasTrait<AcceptsSupplies>();
}
开发者ID:RobotCaleb,项目名称:OpenRA,代码行数:4,代码来源:SupplyTruck.cs
示例12: CanTargetFrozenActor
public override bool CanTargetFrozenActor(Actor self, FrozenActor target, TargetModifiers modifiers, ref string cursor)
{
return target.Info.Traits.Contains<AcceptsSuppliesInfo>();
}
开发者ID:RobotCaleb,项目名称:OpenRA,代码行数:4,代码来源:SupplyTruck.cs
示例13: TargetOverridesSelection
public bool TargetOverridesSelection(TargetModifiers modifiers)
{
return modifiers.HasModifier(TargetModifiers.ForceMove);
}
开发者ID:pchote,项目名称:OpenRA,代码行数:4,代码来源:AircraftMoveOrderTargeter.cs
示例14: CanTargetFrozenActor
public override bool CanTargetFrozenActor(Actor self, FrozenActor target, TargetModifiers modifiers, ref string cursor)
{
return target.TargetTypes.Overlaps(targetTypes);
}
开发者ID:CH4Code,项目名称:OpenRA,代码行数:4,代码来源:UnitOrderTargeter.cs
示例15: CanTargetActor
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
{
return targetTypes.Overlaps(target.GetEnabledTargetTypes());
}
开发者ID:CH4Code,项目名称:OpenRA,代码行数:4,代码来源:UnitOrderTargeter.cs
示例16: CanTarget
public bool CanTarget(Actor self, Target target, List<Actor> othersAtTarget, ref TargetModifiers modifiers, ref string cursor)
{
// TODO: When target modifiers are configurable this needs to be revisited
if (modifiers.HasModifier(TargetModifiers.ForceMove) || modifiers.HasModifier(TargetModifiers.ForceQueue))
{
var xy = self.World.Map.CellContaining(target.CenterPosition);
IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);
if (self.IsInWorld && self.Owner.Shroud.IsExplored(xy))
{
cursor = targetCursor;
return true;
}
return false;
}
return false;
}
开发者ID:pchote,项目名称:OpenRA,代码行数:20,代码来源:PortableChrono.cs
示例17: CanTargetLocation
bool CanTargetLocation(Actor self, CPos location, List<Actor> actorsAtLocation, TargetModifiers modifiers, ref string cursor)
{
if (!self.World.Map.Contains(location))
return false;
IsQueued = modifiers.HasModifier(TargetModifiers.ForceQueue);
cursor = ab.info.Cursor;
if (negativeDamage)
return false;
if (!ab.HasAnyValidWeapons(Target.FromCell(self.World, location)))
return false;
if (modifiers.HasModifier(TargetModifiers.ForceAttack))
{
var maxRange = ab.GetMaximumRange().Range;
var targetRange = (self.World.Map.CenterOfCell(location) - self.CenterPosition).HorizontalLengthSquared;
if (targetRange > maxRange * maxRange)
cursor = ab.info.OutsideRangeCursor;
return true;
}
return false;
}
开发者ID:Berzeger,项目名称:OpenRA,代码行数:27,代码来源:AttackBase.cs
示例18: TargetOverridesSelection
public bool TargetOverridesSelection(TargetModifiers modifiers)
{
return true;
}
开发者ID:CH4Code,项目名称:OpenRA,代码行数:4,代码来源:Minelayer.cs
示例19: CanTargetActor
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
{
var c = target.Info.Traits.GetOrDefault<CapturableInfo>();
if (c == null || !c.CanBeTargetedBy(self, target.Owner))
{
cursor = "enter-blocked";
return false;
}
var health = target.Trait<Health>();
var lowEnoughHealth = health.HP <= c.CaptureThreshold * health.MaxHP;
cursor = !sabotage || lowEnoughHealth || target.Owner.NonCombatant
? "enter" : "capture";
return true;
}
开发者ID:JackKucan,项目名称:OpenRA,代码行数:16,代码来源:Captures.cs
示例20: CanTargetFrozenActor
public override bool CanTargetFrozenActor(Actor self, FrozenActor target, TargetModifiers modifiers, ref string cursor)
{
return target.Info.Traits.WithInterface<ITargetableInfo>().Any(t => t.GetTargetTypes().Contains(targetType));
}
开发者ID:TiriliPiitPiit,项目名称:OpenRA,代码行数:4,代码来源:UnitOrderTargeter.cs
注:本文中的TargetModifiers类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论