本文整理汇总了C#中TargetModifiers类的典型用法代码示例。如果您正苦于以下问题:C# TargetModifiers类的具体用法?C# TargetModifiers怎么用?C# TargetModifiers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TargetModifiers类属于命名空间,在下文中一共展示了TargetModifiers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例11: CanTargetActor
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
{
return target.HasTrait<AcceptsSupplies>();
}
示例12: CanTargetFrozenActor
public override bool CanTargetFrozenActor(Actor self, FrozenActor target, TargetModifiers modifiers, ref string cursor)
{
return target.Info.Traits.Contains<AcceptsSuppliesInfo>();
}
示例13: TargetOverridesSelection
public bool TargetOverridesSelection(TargetModifiers modifiers)
{
return modifiers.HasModifier(TargetModifiers.ForceMove);
}
示例14: CanTargetFrozenActor
public override bool CanTargetFrozenActor(Actor self, FrozenActor target, TargetModifiers modifiers, ref string cursor)
{
return target.TargetTypes.Overlaps(targetTypes);
}
示例15: CanTargetActor
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
{
return targetTypes.Overlaps(target.GetEnabledTargetTypes());
}