本文整理汇总了C#中Actor.IsDisabled方法的典型用法代码示例。如果您正苦于以下问题:C# Actor.IsDisabled方法的具体用法?C# Actor.IsDisabled怎么用?C# Actor.IsDisabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actor
的用法示例。
在下文中一共展示了Actor.IsDisabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatesShroud
public CreatesShroud(Actor self, CreatesShroudInfo info)
: base(self, info)
{
addCellsToPlayerShroud = (p, uv) => p.Shroud.AddProjectedShroudGeneration(self, uv);
removeCellsFromPlayerShroud = p => p.Shroud.RemoveShroudGeneration(self);
isDisabled = () => self.IsDisabled();
}
示例2:
void ITick.Tick(Actor self)
{
var disabled = self.IsDisabled();
if (cachedDisabled != disabled)
{
Game.Sound.Play(disabled ? Info.DisableSound : Info.EnableSound, self.CenterPosition);
desiredRange = disabled ? WDist.Zero : Info.Range;
desiredVRange = disabled ? WDist.Zero : Info.MaximumVerticalOffset;
cachedDisabled = disabled;
}
if (self.CenterPosition != cachedPosition || desiredRange != cachedRange || desiredVRange != cachedVRange)
{
cachedPosition = self.CenterPosition;
cachedRange = desiredRange;
cachedVRange = desiredVRange;
self.World.ActorMap.UpdateProximityTrigger(proximityTrigger, cachedPosition, cachedRange, cachedVRange);
}
if (--ticks < 0)
{
GrantBounty();
ticks = Info.Delay;
}
}
示例3: Tick
public override Activity Tick(Actor self)
{
if (IsCanceled || !target.IsValidFor(self))
return NextActivity;
if (self.IsDisabled())
return this;
var weapon = attack.ChooseArmamentForTarget(target);
if (weapon != null)
{
var targetIsMobile = (target.Type == TargetType.Actor && target.Actor.HasTrait<IMove>())
|| (target.Type == TargetType.FrozenActor && target.FrozenActor.Info.Traits.Contains<IMove>());
// Try and sit at least one cell closer than the max range to give some leeway if the target starts moving.
var maxRange = targetIsMobile ? new WRange(Math.Max(weapon.Weapon.MinRange.Range, weapon.Weapon.Range.Range - 1024))
: weapon.Weapon.Range;
attack.Target = target;
if (move != null)
return Util.SequenceActivities(move.MoveFollow(self, target, weapon.Weapon.MinRange, maxRange), this);
}
return NextActivity;
}
示例4: Tick
public override Activity Tick(Actor self)
{
if (IsCanceled || !target.IsValidFor(self))
return NextActivity;
if (self.IsDisabled())
return this;
var weapon = attack.ChooseArmamentsForTarget(target, forceAttack).FirstOrDefault();
if (weapon != null)
{
var targetIsMobile = (target.Type == TargetType.Actor && target.Actor.Info.HasTraitInfo<IMoveInfo>())
|| (target.Type == TargetType.FrozenActor && target.FrozenActor.Info.HasTraitInfo<IMoveInfo>());
// Try and sit at least one cell closer than the max range to give some leeway if the target starts moving.
var modifiedRange = weapon.MaxRange();
var maxRange = targetIsMobile ? new WDist(Math.Max(weapon.Weapon.MinRange.Length, modifiedRange.Length - 1024))
: modifiedRange;
attack.Target = target;
if (move != null)
return Util.SequenceActivities(move.MoveFollow(self, target, weapon.Weapon.MinRange, maxRange), this);
}
return NextActivity;
}
示例5: ModifyRender
public IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r)
{
var disabled = self.IsDisabled();
foreach (var a in r)
{
var ret = a.WithPos(a.Pos - Info.Origin);
yield return ret;
if (disabled)
yield return ret.WithPalette("disabled").WithZOffset(1);
}
}
示例6: Tick
public void Tick(Actor self)
{
if (lobbyShroudFogDisabled)
return;
var disabled = self.IsDisabled();
if (cachedLocation != self.Location || cachedDisabled != disabled)
{
cachedLocation = self.Location;
cachedDisabled = disabled;
Shroud.UpdateShroudGeneration(self.World.Players.Select(p => p.Shroud), self);
}
}
示例7: Tick
public void Tick(Actor self)
{
var disabled = self.IsDisabled();
if (cachedDisabled != disabled)
{
Sound.Play(disabled ? info.DisableSound : info.EnableSound, self.CenterPosition);
desiredRange = disabled ? WDist.Zero : info.Range;
cachedDisabled = disabled;
}
if (self.CenterPosition != cachedPosition || desiredRange != cachedRange)
{
cachedPosition = self.CenterPosition;
cachedRange = desiredRange;
self.World.ActorMap.UpdateProximityTrigger(proximityTrigger, cachedPosition, cachedRange);
}
}
示例8: CanAttack
protected virtual bool CanAttack(Actor self, Target target)
{
if (!self.IsInWorld)
return false;
// Building is under construction or is being sold
if (building.Value != null && !building.Value.BuildComplete)
return false;
if (!target.IsValidFor(self))
return false;
if (Armaments.All(a => a.IsReloading))
return false;
if (self.IsDisabled())
return false;
return true;
}
示例9: UnitProducedByOther
public void UnitProducedByOther(Actor self, Actor producer, Actor produced)
{
// If the produced Actor doesn't occupy space, it can't be in range
if (produced.OccupiesSpace == null)
return;
// We don't grant upgrades when disabled
if (self.IsDisabled())
return;
// Work around for actors produced within the region not triggering until the second tick
if ((produced.CenterPosition - self.CenterPosition).HorizontalLengthSquared <= info.Range.LengthSquared)
{
var stance = self.Owner.Stances[produced.Owner];
if (!info.ValidStances.HasStance(stance))
return;
var um = produced.TraitOrDefault<UpgradeManager>();
if (um != null)
foreach (var u in info.Upgrades)
if (um.AcknowledgesUpgrade(produced, u))
um.GrantTimedUpgrade(produced, u, 1);
}
}
示例10: CanAttack
protected virtual bool CanAttack(Actor self, Target target)
{
if (!self.IsInWorld)
return false;
if (!target.IsValidFor(self))
return false;
if (Armaments.All(a => a.IsReloading))
return false;
if (self.IsDisabled())
return false;
return true;
}
示例11: Tick
public override Activity Tick(Actor self)
{
if (IsCanceled || !target.IsValidFor(self))
return NextActivity;
if (self.IsDisabled())
return this;
const int RangeTolerance = 1; /* how far inside our maximum range we should try to sit */
var weapon = attack.ChooseArmamentForTarget(target);
if (weapon != null)
{
var range = WRange.FromCells(Math.Max(0, weapon.Weapon.Range.Range / 1024 - RangeTolerance));
attack.Target = target;
if (move != null)
return Util.SequenceActivities(move.MoveFollow(self, target, range), this);
}
return NextActivity;
}
示例12: CanAttack
protected virtual bool CanAttack(Actor self, Target target)
{
if (!self.IsInWorld) return false;
if (!target.IsValid) return false;
if (Weapons.All(w => w.IsReloading)) return false;
if (self.IsDisabled()) return false;
if (target.IsActor && target.Actor.HasTrait<ITargetable>() &&
!target.Actor.Trait<ITargetable>().TargetableBy(target.Actor,self))
return false;
return true;
}
示例13: IsDisabled
protected override bool IsDisabled(Actor self) { return self.IsDisabled(); }
示例14: Tick
public void Tick(Actor self)
{
if (remainingTime > 0 && canCloak)
if (--remainingTime <= 0)
Sound.Play(info.CloakSound, self.CenterLocation);
if (self.IsDisabled())
Uncloak();
if (info.UncloakOnMove && (lastPos == null || lastPos.Value != self.Location))
{
Uncloak();
lastPos = self.Location;
}
}
示例15: Tick
public void Tick(Actor self)
{
if (disabled)
return;
if (remainingTime > 0 && !disabled && !damageDisabled && --remainingTime <= 0)
Sound.Play(Info.CloakSound, self.CenterPosition);
if (self.IsDisabled())
Uncloak();
if (Info.UncloakOnMove && (lastPos == null || lastPos.Value != self.Location))
{
Uncloak();
lastPos = self.Location;
}
}