本文整理汇总了C#中SupportPowerManager类的典型用法代码示例。如果您正苦于以下问题:C# SupportPowerManager类的具体用法?C# SupportPowerManager怎么用?C# SupportPowerManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SupportPowerManager类属于命名空间,在下文中一共展示了SupportPowerManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Activate
public override void Activate(Actor self, Order order, SupportPowerManager manager)
{
base.Activate(self, order, manager);
var wsb = self.TraitOrDefault<WithSpriteBody>();
if (wsb != null && wsb.DefaultAnimation.HasSequence(info.GrantUpgradeSequence))
wsb.PlayCustomAnimation(self, info.GrantUpgradeSequence);
Game.Sound.Play(info.GrantUpgradeSound, self.World.Map.CenterOfCell(order.TargetLocation));
foreach (var a in UnitsInRange(order.TargetLocation))
{
var um = a.TraitOrDefault<UpgradeManager>();
if (um == null)
continue;
foreach (var u in info.Upgrades)
{
if (info.Duration > 0)
{
if (um.AcknowledgesUpgrade(a, u))
um.GrantTimedUpgrade(a, u, info.Duration);
}
else
{
if (um.AcceptsUpgrade(a, u))
um.GrantUpgrade(a, u, this);
}
}
}
}
示例2: Activate
public override void Activate(Actor self, Order order, SupportPowerManager manager)
{
base.Activate(self, order, manager);
var info = Info as SpawnActorPowerInfo;
if (info.Actor != null)
{
self.World.AddFrameEndTask(w =>
{
var location = self.World.Map.CenterOfCell(order.TargetLocation);
Game.Sound.Play(info.DeploySound, location);
if (!string.IsNullOrEmpty(info.EffectSequence) && !string.IsNullOrEmpty(info.EffectPalette))
w.Add(new SpriteEffect(location, w, info.EffectImage, info.EffectSequence, info.EffectPalette));
var actor = w.CreateActor(info.Actor, new TypeDictionary
{
new LocationInit(order.TargetLocation),
new OwnerInit(self.Owner),
});
if (info.LifeTime > -1)
{
actor.QueueActivity(new Wait(info.LifeTime));
actor.QueueActivity(new RemoveSelf());
}
});
}
}
示例3: Activate
public override void Activate(Actor self, Order order, SupportPowerManager manager)
{
base.Activate(self, order, manager);
var enterCell = self.World.ChooseRandomEdgeCell();
var altitude = self.World.Map.Rules.Actors["u2"].Traits.Get<PlaneInfo>().CruiseAltitude;
var plane = self.World.CreateActor("u2", new TypeDictionary
{
new CenterPositionInit(enterCell.CenterPosition + new WVec(WRange.Zero, WRange.Zero, altitude)),
new OwnerInit(self.Owner),
new FacingInit(Util.GetFacing(order.TargetLocation - enterCell, 0))
});
plane.CancelActivity();
plane.QueueActivity(new Fly(plane, Target.FromCell(order.TargetLocation)));
plane.QueueActivity(new CallFunc(() => plane.World.AddFrameEndTask( w =>
{
var camera = w.CreateActor("camera", new TypeDictionary
{
new LocationInit( order.TargetLocation ),
new OwnerInit( self.Owner ),
});
camera.QueueActivity(new Wait(25 * ((SpyPlanePowerInfo)Info).RevealTime));
camera.QueueActivity(new RemoveSelf());
})));
plane.QueueActivity(new FlyOffMap());
plane.QueueActivity(new RemoveSelf());
}
示例4: Activate
public override void Activate(Actor self, Order order, SupportPowerManager manager)
{
base.Activate(self, order, manager);
self.Trait<RenderBuilding>().PlayCustomAnim(self, "active");
Sound.Play(info.GrantUpgradeSound, self.World.Map.CenterOfCell(order.TargetLocation));
foreach (var a in UnitsInRange(order.TargetLocation))
{
var um = a.TraitOrDefault<UpgradeManager>();
if (um == null)
continue;
foreach (var u in info.Upgrades)
{
if (info.Duration > 0)
{
if (um.AcknowledgesUpgrade(a, u))
um.GrantTimedUpgrade(a, u, info.Duration);
}
else
{
if (um.AcceptsUpgrade(a, u))
um.GrantUpgrade(a, u, this);
}
}
}
}
示例5: SelectTarget
public SelectTarget(string order, SupportPowerManager manager, IronCurtainPower power)
{
this.manager = manager;
this.order = order;
this.power = power;
this.range = (power.Info as IronCurtainPowerInfo).Range;
tile = SequenceProvider.GetSequence("overlay", "target-select").GetSprite(0);
}
示例6: Activate
public override void Activate(Actor self, Order order, SupportPowerManager manager)
{
base.Activate(self, order, manager);
// TODO: Reveal submarines
// Should this play for all players?
Sound.Play("sonpulse.aud");
}
示例7: OrderGenerator
public override IOrderGenerator OrderGenerator(string order, SupportPowerManager manager)
{
// Clear selection if using Left-Click Orders
if (Game.Settings.Game.UseClassicMouseStyle)
manager.Self.World.Selection.Clear();
Sound.PlayToPlayer(manager.Self.Owner, Info.SelectTargetSound);
var info = Info as IonCannonPowerInfo;
return new SelectGenericPowerTarget(order, manager, info.Cursor, MouseButton.Left);
}
示例8: SupportPowersWidget
public SupportPowersWidget(World world, WorldRenderer worldRenderer)
{
this.worldRenderer = worldRenderer;
spm = world.LocalPlayer.PlayerActor.Trait<SupportPowerManager>();
tooltipContainer = Exts.Lazy(() =>
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
icon = new Animation(world, "icon");
clock = new Animation(world, ClockAnimation);
}
示例9: Activate
public virtual void Activate(Actor self, Order order, SupportPowerManager manager)
{
if (Info.DisplayRadarPing && manager.RadarPings != null)
{
ping = manager.RadarPings.Value.Add(
() => order.Player.IsAlliedWith(self.World.RenderPlayer),
order.TargetLocation.CenterPosition,
order.Player.Color.RGB,
Info.RadarPingDuration);
}
}
示例10: Activate
public override void Activate(Actor self, Order order, SupportPowerManager manager)
{
base.Activate(self, order, manager);
self.Trait<RenderBuilding>().PlayCustomAnim(self, "active");
Sound.Play(info.IronCurtainSound, self.World.Map.CenterOfCell(order.TargetLocation));
foreach (var target in UnitsInRange(order.TargetLocation)
.Where(a => a.Owner.Stances[self.Owner] == Stance.Ally))
target.Trait<IronCurtainable>().Activate(target, ((IronCurtainPowerInfo)Info).Duration * 25);
}
示例11: Activate
public override void Activate(Actor self, Order order, SupportPowerManager manager)
{
base.Activate(self, order, manager);
self.World.AddFrameEndTask(w =>
{
Game.Sound.PlayToPlayer(SoundType.World, self.Owner, Info.LaunchSound);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.LaunchSpeechNotification, self.Owner.Faction.InternalName);
w.Add(new SatelliteLaunch(self, info));
});
}
示例12: Activate
public override void Activate(Actor self, Order order, SupportPowerManager manager)
{
base.Activate(self, order, manager);
self.World.AddFrameEndTask(w =>
{
Sound.PlayToPlayer(self.Owner, Info.LaunchSound);
w.Add(new SatelliteLaunch(self));
owner.Launch(self, Info);
});
}
示例13: Activate
public override void Activate(Actor self, Order order, SupportPowerManager manager)
{
base.Activate(self, order, manager);
foreach (var target in UnitsInRange(order.ExtraLocation))
{
var cs = target.Trait<Chronoshiftable>();
var targetCell = target.Location + (order.TargetLocation - order.ExtraLocation);
var cpi = Info as ChronoshiftPowerInfo;
if (self.Owner.Shroud.IsExplored(targetCell) && cs.CanChronoshiftTo(target, targetCell))
cs.Teleport(target, targetCell, cpi.Duration * 25, cpi.KillCargo, self);
}
}
示例14: SupportPowersWidget
public SupportPowersWidget(World world, WorldRenderer worldRenderer)
{
this.worldRenderer = worldRenderer;
spm = world.LocalPlayer.PlayerActor.Trait<SupportPowerManager>();
tooltipContainer = Lazy.New(() =>
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));
iconSprites = Rules.Info.Values.SelectMany( u => u.Traits.WithInterface<SupportPowerInfo>() )
.Select(u => u.Image).Distinct()
.ToDictionary(
u => u,
u => Game.modData.SpriteLoader.LoadAllSprites(u)[0]);
clock = new Animation("clock");
}
示例15: Activate
public override void Activate(Actor self, Order order, SupportPowerManager manager)
{
base.Activate(self, order, manager);
var wsb = self.TraitOrDefault<WithSpriteBody>();
if (wsb != null && wsb.DefaultAnimation.HasSequence(info.Sequence))
wsb.PlayCustomAnimation(self, info.Sequence, () => wsb.CancelCustomAnimation(self));
Game.Sound.Play(SoundType.World, info.OnFireSound, self.World.Map.CenterOfCell(order.TargetLocation));
foreach (var a in UnitsInRange(order.TargetLocation))
{
var um = a.TraitOrDefault<UpgradeManager>();
// Condition token is ignored because we never revoke this condition.
if (um != null)
um.GrantCondition(a, info.Condition, true, info.Duration);
}
}