本文整理汇总了C#中Actor.GetDamageState方法的典型用法代码示例。如果您正苦于以下问题:C# Actor.GetDamageState方法的具体用法?C# Actor.GetDamageState怎么用?C# Actor.GetDamageState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actor
的用法示例。
在下文中一共展示了Actor.GetDamageState方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsValidAgainst
public override bool IsValidAgainst(Actor victim, Actor firedBy)
{
if (Damage < 0 && victim.GetDamageState() == DamageState.Undamaged)
return false;
return base.IsValidAgainst(victim, firedBy);
}
示例2: BuildingComplete
public void BuildingComplete(Actor self)
{
var animation = (self.GetDamageState() >= DamageState.Heavy) ? "damaged-idle" : "idle";
DefaultAnimation.PlayFetchIndex(animation,
() => playerResources.OreCapacity != 0
? ((10 * DefaultAnimation.CurrentSequence.Length - 1) * playerResources.Ore) / (10 * playerResources.OreCapacity)
: 0);
}
示例3: BuildingComplete
public void BuildingComplete(Actor self)
{
var animation = (self.GetDamageState() >= DamageState.Heavy) ? "damaged-idle" : "idle";
anim.PlayFetchIndex(animation,
() => playerResources.OreCapacity != 0
? (Info.FillSteps * playerResources.Ore) / (10 * playerResources.OreCapacity)
: 0);
}
示例4: BuildingComplete
public override void BuildingComplete(Actor self)
{
var animation = RenderSprites.NormalizeSequence(DefaultAnimation, self.GetDamageState(), info.Sequence);
DefaultAnimation.PlayFetchIndex(animation,
() => playerResources.ResourceCapacity != 0
? ((10 * DefaultAnimation.CurrentSequence.Length - 1) * playerResources.Resources) / (10 * playerResources.ResourceCapacity)
: 0);
}
示例5: Tick
public void Tick(Actor self)
{
if (--ticks <= 0)
{
var move = self.Trait<IMove>();
if (move.Altitude > 0 && self.GetDamageState() >= DamageState.Heavy)
{
var facing = self.Trait<IFacing>();
var altitude = new PVecInt(0, move.Altitude);
position = (self.CenterLocation - (PVecInt)Combat.GetTurretPosition(self, facing, smokeTurret).ToInt2());
if (self.World.RenderedShroud.IsVisible(position.ToCPos()))
self.World.AddFrameEndTask(
w => w.Add(new Smoke(w, position - altitude, "smokey")));
}
ticks = interval;
}
}
示例6: SelectionBoxRenderable
IEnumerable<IRenderable> IRenderAboveShroud.RenderAboveShroud(Actor self, WorldRenderer wr)
{
if (self.World.FogObscures(self))
yield break;
var selected = self.World.Selection.Contains(self);
var regularWorld = self.World.Type == WorldType.Regular;
var statusBars = Game.Settings.Game.StatusBars;
// Health bars are shown when:
// * actor is selected
// * status bar preference is set to "always show"
// * status bar preference is set to "when damaged" and actor is damaged
var displayHealth = selected || (regularWorld && statusBars == StatusBarsType.AlwaysShow)
|| (regularWorld && statusBars == StatusBarsType.DamageShow && self.GetDamageState() != DamageState.Undamaged);
// Extra bars are shown when:
// * actor is selected
// * status bar preference is set to "always show"
// * status bar preference is set to "when damaged"
var displayExtra = selected || (regularWorld && statusBars != StatusBarsType.Standard);
if (Info.RenderSelectionBox && selected)
yield return new SelectionBoxRenderable(self, Info.SelectionBoxColor);
if (Info.RenderSelectionBars && (displayHealth || displayExtra))
yield return new SelectionBarsRenderable(self, displayHealth, displayExtra);
// Target lines and pips are always only displayed for selected allied actors
if (!selected || !self.Owner.IsAlliedWith(wr.World.RenderPlayer))
yield break;
if (self.World.LocalPlayer != null && self.World.LocalPlayer.PlayerActor.Trait<DeveloperMode>().PathDebug)
yield return new TargetLineRenderable(ActivityTargetPath(self), Color.Green);
var b = self.VisualBounds;
var pos = wr.ScreenPxPosition(self.CenterPosition);
var bl = wr.Viewport.WorldToViewPx(pos + new int2(b.Left, b.Bottom));
var pal = wr.Palette(Info.Palette);
foreach (var r in DrawPips(self, wr, bl, pal))
yield return r;
}
示例7: NormalizeSequence
protected virtual string NormalizeSequence(Actor self, string baseSequence)
{
string damageState = self.GetDamageState() >= DamageState.Heavy ? "damaged-" : "";
if (anim.HasSequence(damageState + baseSequence))
return damageState + baseSequence;
else
return baseSequence;
}
示例8: BuildingComplete
public void BuildingComplete( Actor self )
{
roof.Play(NormalizeSequence(self,
self.GetDamageState() > DamageState.Heavy ? "damaged-idle-top" : "idle-top"));
buildComplete = true;
}
示例9: GetPrefix
protected string GetPrefix(Actor self)
{
return self.GetDamageState() == DamageState.Half ? "damaged-" : "";
}
示例10: ShouldLandAtBuilding
bool ShouldLandAtBuilding(Actor self, Actor dest)
{
if (alwaysLand)
return true;
if (planeInfo.RepairBuildings.Contains(dest.Info.Name) && self.GetDamageState() != DamageState.Undamaged)
return true;
return planeInfo.RearmBuildings.Contains(dest.Info.Name) && self.TraitsImplementing<AmmoPool>()
.Any(p => !p.Info.SelfReloads && !p.FullAmmo());
}
示例11: BuildingComplete
public void BuildingComplete( Actor self )
{
roof.Play(NormalizeSequence(self,
self.GetDamageState() > DamageState.Heavy ? "damaged-idle-top" : "idle-top"));
self.Trait<RenderSimple>().anims.Add( "roof", new RenderSimple.AnimationWithOffset( roof ) { ZOffset = 24 } );
}
示例12: GetPrefix
protected virtual string GetPrefix(Actor self)
{
return self.GetDamageState() >= DamageState.Heavy ? "damaged-" : "";
}
示例13: IssueOrder
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
{
if (mi.Button == MouseButton.Left) return null;
if (self == underCursor) return null;
var target = underCursor == null ? Target.FromCell(xy) : Target.FromActor(underCursor);
var isHeal = Weapons[0].Info.Warheads[0].Damage < 0;
var forceFire = mi.Modifiers.HasModifier(Modifiers.Ctrl);
if (isHeal)
{
// we can never "heal ground"; that makes no sense.
if (!target.IsActor) return null;
// unless forced, only heal allies.
if (self.Owner.Stances[underCursor.Owner] != Stance.Ally && !forceFire) return null;
// don't allow healing of fully-healed stuff!
if (underCursor.GetDamageState() == DamageState.Undamaged) return null;
}
else
{
if (!target.IsActor)
{
if (!forceFire) return null;
return new Order("Attack", self, xy);
}
if ((self.Owner.Stances[underCursor.Owner] != Stance.Enemy) && !forceFire)
return null;
}
if (!HasAnyValidWeapons(target)) return null;
return new Order(isHeal ? "Heal" : "Attack", self, underCursor);
}