当前位置: 首页>>代码示例>>C#>>正文


C# Actor.GetDamageState方法代码示例

本文整理汇总了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);
        }
开发者ID:CH4Code,项目名称:OpenRA,代码行数:7,代码来源:DamageWarhead.cs

示例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);
 }
开发者ID:RunCraze,项目名称:OpenRA,代码行数:8,代码来源:RenderBuildingSilo.cs

示例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);
 }
开发者ID:Tsher,项目名称:OpenRA,代码行数:8,代码来源:RenderBuildingSilo.cs

示例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);
        }
开发者ID:ushardul,项目名称:OpenRA,代码行数:9,代码来源:RenderBuildingSilo.cs

示例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;
            }
        }
开发者ID:nevelis,项目名称:OpenRA,代码行数:19,代码来源:SmokeTrailWhenDamaged.cs

示例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;
        }
开发者ID:OpenRA,项目名称:OpenRA,代码行数:43,代码来源:SelectionDecorations.cs

示例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;
 }
开发者ID:Tsher,项目名称:OpenRA,代码行数:8,代码来源:RenderSimple.cs

示例8: BuildingComplete

 public void BuildingComplete( Actor self )
 {
     roof.Play(NormalizeSequence(self,
         self.GetDamageState() > DamageState.Heavy ? "damaged-idle-top" : "idle-top"));
     buildComplete = true;
 }
开发者ID:RunCraze,项目名称:OpenRA,代码行数:6,代码来源:RenderBuildingWarFactory.cs

示例9: GetPrefix

 protected string GetPrefix(Actor self)
 {
     return self.GetDamageState() == DamageState.Half ? "damaged-" : "";
 }
开发者ID:comradpara,项目名称:OpenRA,代码行数:4,代码来源:RenderBuilding.cs

示例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());
        }
开发者ID:pchote,项目名称:OpenRA,代码行数:11,代码来源:ReturnToBase.cs

示例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 } );
 }
开发者ID:patthoyts,项目名称:OpenRA,代码行数:6,代码来源:RenderBuildingWarFactory.cs

示例12: GetPrefix

 protected virtual string GetPrefix(Actor self)
 {
     return self.GetDamageState() >= DamageState.Heavy ? "damaged-" : "";
 }
开发者ID:mgatland,项目名称:OpenRA,代码行数:4,代码来源:RenderSimple.cs

示例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);
        }
开发者ID:mgatland,项目名称:OpenRA,代码行数:37,代码来源:AttackBase.cs


注:本文中的Actor.GetDamageState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。