public void UpdateDummyFlags(MyDummyPoint dummyPoint)
        {
            Debug.Assert(dummyPoint.EntityId.HasValue);

            var msg = new MyEventDummyFlags();
            msg.Flags = dummyPoint.DummyFlags;
            msg.EntityId = dummyPoint.EntityId.Value.NumericValue;
        }
Exemplo n.º 2
0
 public MyExplosionInfo(float playerDamage, float damage, float empDamage, BoundingSphere explosionSphere, MyExplosionTypeEnum type, bool playSound, MyDummyPoint customEffect = null, bool checkIntersection = true)
 {
     PlayerDamage = playerDamage;
     Damage = damage;
     EmpDamage = empDamage;
     ExplosionSphere = explosionSphere;
     ExplosionForceDirection = MyExplosionForceDirection.EXPLOSION;
     StrengthImpulse = StrengthAngularImpulse = 0.0f;
     ExcludedEntity = OwnerEntity = HitEntity = null;
     CascadeLevel = 0;
     ExplosionFlags = MyExplosionFlags.AFFECT_VOXELS | MyExplosionFlags.APPLY_FORCE_AND_DAMAGE | MyExplosionFlags.CREATE_DEBRIS | MyExplosionFlags.CREATE_DECALS | MyExplosionFlags.CREATE_PARTICLE_EFFECT;
     ExplosionType = type;
     LifespanMiliseconds = MyExplosionsConstants.EXPLOSION_LIFESPAN;
     GroupMask = MyGroupMask.Empty;
     ParticleScale = 1.0f;
     VoxelCutoutScale = 1.0f;
     Direction = null;
     VoxelExplosionCenter = explosionSphere.Center;
     PlaySound = playSound;
     CustomEffect = customEffect;
     CheckIntersections = checkIntersection;
 }
Exemplo n.º 3
0
        private static void UpdatePlayerStartDummy(MyMwcObjectBuilder_Checkpoint checkpoint)
        {
            var dummyBuilder = checkpoint.SectorObjectBuilder.SectorObjects.OfType<MyMwcObjectBuilder_DummyPoint>().FirstOrDefault(s => (s.DummyFlags & MyDummyPointFlags.PLAYER_START) > 0);
            if (dummyBuilder == null)
            {
                dummyBuilder = MyMwcObjectBuilder_Base.CreateNewObject(MyMwcObjectBuilderTypeEnum.DummyPoint, null) as MyMwcObjectBuilder_DummyPoint;
                dummyBuilder.DummyFlags = MyDummyPointFlags.PLAYER_START;
                checkpoint.SectorObjectBuilder.SectorObjects.Add(dummyBuilder);

                var dummyEntity = new MyDummyPoint();
                dummyEntity.Init(String.Empty, dummyBuilder, MySession.PlayerShip.WorldMatrix);
                MyEntities.Add(dummyEntity);
            }

            MyGuiScreenGamePlay.Static.ClampPlayerToBorderSafeArea();

            dummyBuilder.PositionAndOrientation.Position = MySession.PlayerShip.WorldMatrix.Translation;
            dummyBuilder.PositionAndOrientation.Forward = MySession.PlayerShip.WorldMatrix.Forward;
            dummyBuilder.PositionAndOrientation.Up = MySession.PlayerShip.WorldMatrix.Up;
        }
 private static void SetDummyVisibleStatus(MyDummyPoint platform, bool visible) 
 {
     if (visible)
     {
         MyScriptWrapper.UnhideEntity(platform);
     }
     else
     {
         MyScriptWrapper.HideEntity(platform);
     }
 }
 protected static void ShowDummy(MyDummyPoint platform) 
 {
     SetDummyVisibleStatus(platform, true);
 }
 protected static void HideDummy(MyDummyPoint platform) 
 {
     SetDummyVisibleStatus(platform, false);
 }
        private void OnAttachClick(MyGuiControlBase button)
        {
            if (MyEditorVoxelHand.DetachedVoxelHand == null)
            {
                foreach (MyEntity e in MyEntities.GetEntities())
                {
                    if (e is MyDummyPoint && ((int)(((MyDummyPoint)e).DummyFlags & CommonLIB.AppCode.ObjectBuilders.SubObjects.MyDummyPointFlags.VOXEL_HAND)) > 0)
                    {
                        e.WorldMatrix = MyEditorVoxelHand.UpdateShapePosition();
                        MyEditorVoxelHand.DetachedVoxelHand = (MyDummyPoint)e;                        
                    }
                }

                if (MyEditorVoxelHand.DetachedVoxelHand == null)
                {
                    var ob = MinerWars.CommonLIB.AppCode.ObjectBuilders.MyMwcObjectBuilder_Base.CreateNewObject(MinerWars.CommonLIB.AppCode.ObjectBuilders.MyMwcObjectBuilderTypeEnum.DummyPoint, null) as MinerWars.CommonLIB.AppCode.ObjectBuilders.SubObjects.MyMwcObjectBuilder_DummyPoint;
                    MyDummyPoint voxelHand = new MyDummyPoint();
                    voxelHand.Init(null, ob, Matrix.Identity);
                    voxelHand.DummyFlags |= CommonLIB.AppCode.ObjectBuilders.SubObjects.MyDummyPointFlags.VOXEL_HAND;
                    voxelHand.Size = new Vector3(20, 20, 20);
                    voxelHand.Save = false;
                    voxelHand.WorldMatrix = MyEditorVoxelHand.UpdateShapePosition();
                    MyEntities.Add(voxelHand);
                    MyEditorVoxelHand.DetachedVoxelHand = voxelHand;
                }

                
                MyEditorVoxelHand.DetachedVoxelHand.Enabled = true;
                MyEditorGizmo.SelectedEntities.Clear();
                MyEditorGizmo.SelectedEntities.Add(MyEditorVoxelHand.DetachedVoxelHand);

                m_detachLabel.Text = MyTextsWrapperEnum.AttachVoxelHand;
            }
            else
            {
                if (MyEditorVoxelHand.DetachedVoxelHand != null)
                    MyEditorVoxelHand.DetachedVoxelHand.MarkForClose();
                MyEditorVoxelHand.DetachedVoxelHand = null;
                MyEditorGizmo.SelectedEntities.Clear();
                m_detachLabel.Text = MyTextsWrapperEnum.DetachVoxelHand;
            }
        }
 public MyGuiScreenEditorDummyPoint(MyDummyPoint dummyPoint)
     : base(dummyPoint, new Vector2(0.5f, 0.5f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, null, MyTextsWrapperEnum.DummyPoint)
 {
     Init();
 }