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


C# CharacterStatue.InvalidatePose方法代码示例

本文整理汇总了C#中Server.Mobiles.CharacterStatue.InvalidatePose方法的典型用法代码示例。如果您正苦于以下问题:C# CharacterStatue.InvalidatePose方法的具体用法?C# CharacterStatue.InvalidatePose怎么用?C# CharacterStatue.InvalidatePose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Mobiles.CharacterStatue的用法示例。


在下文中一共展示了CharacterStatue.InvalidatePose方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnTarget

		protected override void OnTarget( Mobile from, object targeted )
		{
			IPoint3D p = targeted as IPoint3D;
			Map map = from.Map;

			if ( p == null || map == null || m_Maker == null || m_Maker.Deleted )
				return;
				
			if ( m_Maker.IsChildOf( from.Backpack ) )
			{
				SpellHelper.GetSurfaceTop( ref p );			
				BaseHouse house = null;
				Point3D loc = new Point3D( p );
				
				AddonFitResult result = CouldFit( loc, map, from, ref house );
								
				if ( result == AddonFitResult.Valid )
				{				
					CharacterStatue statue = new CharacterStatue( from, m_Type );
					CharacterStatuePlinth plinth = new CharacterStatuePlinth( statue );
										
					house.Addons.Add( plinth );
					
					statue.Plinth = plinth;
					plinth.MoveToWorld( loc, map );
					statue.InvalidatePose();
					
					from.SendGump( new CharacterStatueGump( m_Maker, statue ) );
				}
				else if ( result == AddonFitResult.Blocked )
					from.SendLocalizedMessage( 500269 ); // You cannot build that there.
				else if ( result == AddonFitResult.NotInHouse )
					from.SendLocalizedMessage( 1076192 ); // Statues can only be placed in houses where you are the owner or co-owner.
				else if ( result == AddonFitResult.DoorsNotClosed )
					from.SendMessage( "You must close all house doors before placing this." );
				else if ( result == AddonFitResult.DoorTooClose )
					from.SendLocalizedMessage( 500271 ); // You cannot build near the door.				
			}
			else
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
		}
开发者ID:brodock,项目名称:genova-project,代码行数:41,代码来源:CharacterStatueTarget.cs

示例2: OnTarget

        protected override void OnTarget( Mobile from, object targeted )
        {
            IPoint3D p = targeted as IPoint3D;
            Map map = from.Map;

            if ( p == null || map == null || m_Maker == null || m_Maker.Deleted )
                return;

            if ( m_Maker.IsChildOf( from.Backpack ) )
            {
                SpellHelper.GetSurfaceTop( ref p );
                BaseHouse house = null;
                Point3D loc = new Point3D( p );

                if ( targeted is Item && !((Item) targeted).IsLockedDown && !((Item) targeted).IsSecure && !(targeted is AddonComponent) )
                {
                    from.SendLocalizedMessage( 1076191 ); // Statues can only be placed in houses.
                    return;
                }
                else if ( from.IsBodyMod )
                {
                    from.SendLocalizedMessage( 1073648 ); // You may only proceed while in your original state...
                    return;
                }

                AddonFitResult result = CouldFit( loc, map, from, ref house );

                if ( result == AddonFitResult.Valid )
                {
                    CharacterStatue statue = new CharacterStatue( from, m_Type );
                    CharacterStatuePlinth plinth = new CharacterStatuePlinth( statue );

                    house.Addons.Add( plinth );

                    if ( m_Maker is IRewardItem )
                        statue.IsRewardItem = ( (IRewardItem) m_Maker).IsRewardItem;

                    statue.Plinth = plinth;
                    plinth.MoveToWorld( loc, map );
                    statue.InvalidatePose();

                    from.CloseGump( typeof( CharacterStatueGump ) );
                    from.SendGump( new CharacterStatueGump( m_Maker, statue, from ) );
                }
                else if ( result == AddonFitResult.Blocked )
                    from.SendLocalizedMessage( 500269 ); // You cannot build that there.
                else if ( result == AddonFitResult.NotInHouse )
                    from.SendLocalizedMessage( 1076192 ); // Statues can only be placed in houses where you are the owner or co-owner.
                else if ( result == AddonFitResult.DoorTooClose )
                    from.SendLocalizedMessage( 500271 ); // You cannot build near the door.
            }
            else
                from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
        }
开发者ID:brodock,项目名称:runuo,代码行数:54,代码来源:CharacterStatue.cs

示例3: OnTarget

        protected override void OnTarget(Mobile from, object targeted)
        {
            var p = targeted as IPoint3D;
            Map map = from.Map;

            if (p == null || map == null || m_Maker == null || m_Maker.Deleted)
            {
                return;
            }

            if (m_Maker.IsChildOf(from.Backpack))
            {
                SpellHelper.GetSurfaceTop(ref p);
                BaseHouse house = null;
                var loc = new Point3D(p);

                if (m_Maker is CharacterStatueDeed && !((CharacterStatueDeed) m_Maker).NoHouse ||
                    m_Maker is CharacterStatueMaker && !((CharacterStatueMaker) m_Maker).NoHouse)
                {
                    if (targeted is Item && !((Item) targeted).IsLockedDown && !((Item) targeted).IsSecure &&
                        !(targeted is AddonComponent))
                    {
                        from.SendLocalizedMessage(1076191); // Statues can only be placed in houses.
                        return;
                    }
                }
                if (@from.IsBodyMod)
                {
                    @from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
                    return;
                }

                AddonFitResult result = CouldFit(loc, map, from, ref house);

                if (result == AddonFitResult.Valid || m_Maker is CharacterStatueDeed && ((CharacterStatueDeed) m_Maker).NoHouse ||
                    m_Maker is CharacterStatueMaker && ((CharacterStatueMaker) m_Maker).NoHouse)
                {
                    var statue = new CharacterStatue(from, m_Type);
                    var plinth = new CharacterStatuePlinth(statue);

                    if (m_Maker is CharacterStatueDeed && !((CharacterStatueDeed) m_Maker).NoHouse ||
                        m_Maker is CharacterStatueMaker && !((CharacterStatueMaker) m_Maker).NoHouse)
                    {
                        house.Addons.Add(plinth);
                    }

                    if (m_Maker is IRewardItem)
                    {
                        statue.IsRewardItem = ((IRewardItem) m_Maker).IsRewardItem;
                    }

                    statue.Plinth = plinth;
                    plinth.MoveToWorld(loc, map);
                    statue.InvalidatePose();

                    /*
                     * TODO: Previously the maker wasn't deleted until after statue
                     * customization, leading to redeeding issues. Exact OSI behavior
                     * needs looking into.
                     */
                    m_Maker.Delete();
                    statue.Sculpt(from);

                    from.CloseGump(typeof(CharacterStatueGump));
                    from.SendGump(new CharacterStatueGump(m_Maker, statue, from));
                }
                else if (result == AddonFitResult.Blocked)
                {
                    from.SendLocalizedMessage(500269); // You cannot build that there.
                }
                else if (result == AddonFitResult.NotInHouse)
                {
                    from.SendLocalizedMessage(1076192);
                    // Statues can only be placed in houses where you are the owner or co-owner.
                }
                else if (result == AddonFitResult.DoorTooClose)
                {
                    from.SendLocalizedMessage(500271); // You cannot build near the door.
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:85,代码来源:CharacterStatue.cs


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