public Particle(TrixelParticleSystem system, int instanceIndex) { this.CornerCollision = new PointCollision[1]; this.Enabled = true; this.InstanceIndex = instanceIndex; this.System = system; }
private void StartCrumbling() { SoundEffectExtensions.EmitAt(this.Host.sCrumble, this.OriginalCenter, RandomHelper.Centered(0.00999999977648258)); Vector3 vector3_1 = FezMath.SideMask(this.CameraManager.Viewpoint); Vector3 vector3_2 = FezMath.ForwardVector(this.CameraManager.Viewpoint); bool flag1 = (double)vector3_1.X != 0.0; bool flag2 = flag1; int num = flag2 ? (int)vector3_2.Z : (int)vector3_2.X; Point key = new Point(flag1 ? this.Instance.Emplacement.X : this.Instance.Emplacement.Z, this.Instance.Emplacement.Y); this.LevelManager.WaitForScreenInvalidation(); Limit limit; if (this.LevelManager.ScreenSpaceLimits.TryGetValue(key, out limit)) { limit.End += num; TrileEmplacement id = new TrileEmplacement(flag1 ? key.X : limit.Start, key.Y, flag2 ? limit.Start : key.X); while ((flag2 ? id.Z : id.X) != limit.End) { TrileInstance toRemove = this.LevelManager.TrileInstanceAt(ref id); if (toRemove != null && !toRemove.Hidden && toRemove.Trile.ActorSettings.Type == ActorType.Crumbler) { toRemove.Hidden = true; this.LevelMaterializer.CullInstanceOut(toRemove); this.InstancesToClear.Add(toRemove); ITrixelParticleSystems particleSystems = this.ParticleSystems; CrumblersHost.CrumblerState crumblerState = this; Game game = ServiceHelper.Game; TrixelParticleSystem.Settings settings = new TrixelParticleSystem.Settings() { BaseVelocity = Vector3.Zero, Energy = 0.1f, ParticleCount = (int)(20.0 / (double)this.InstancesToClear.Count), GravityModifier = 0.6f, Crumble = true, ExplodingInstance = toRemove }; TrixelParticleSystem trixelParticleSystem1; TrixelParticleSystem trixelParticleSystem2 = trixelParticleSystem1 = new TrixelParticleSystem(game, settings); crumblerState.System = trixelParticleSystem1; TrixelParticleSystem system = trixelParticleSystem2; particleSystems.Add(system); } if (flag2) { id.Z += num; } else { id.X += num; } } } Waiters.Wait(1.0, new Action(this.ClearTriles)).AutoPause = true; }
public TrixelParticleSystem(Game game, TrixelParticleSystem.Settings settings) : base(game) { this.settings = settings; this.DrawOrder = 10; this.PhysicsManager = ServiceHelper.Get<IPhysicsManager>(); this.CameraManager = ServiceHelper.Get<IGameCameraManager>(); this.GameState = ServiceHelper.Get<IGameStateManager>(); this.LightingPostProcess = ServiceHelper.Get<ILightingPostProcess>(); this.CollisionManager = ServiceHelper.Get<ICollisionManager>(); }
private void TryInitialize() { if (this.LevelManager.Name == null || !this.LevelManager.Name.StartsWith("HOLE")) { return; } this.GameState.SkipFadeOut = true; this.PlayerManager.CanControl = false; this.CameraManager.Constrained = true; this.CameraManager.PixelsPerTrixel = 3f; this.CameraManager.Center = new Vector3(13f, 20f, 27.875f); this.PlayerManager.Position = new Vector3(13.5f, 15.47f, 28.5f); this.PlayerManager.Ground = new MultipleHits <TrileInstance>(); this.PlayerManager.Velocity = 0.007875f * -Vector3.UnitY; this.PhysicsManager.Update((IComplexPhysicsEntity)this.PlayerManager); this.PlayerManager.Velocity = 0.007875f * -Vector3.UnitY; this.PlayerManager.RecordRespawnInformation(true); this.PlayerManager.Position = new Vector3(13.5f, 50f, 28.5f); this.PlayerManager.Ground = new MultipleHits <TrileInstance>(); this.PlayerManager.Action = ActionType.FreeFalling; for (int index = 0; index < 4; ++index) { TrileInstance trileInstance = new TrileInstance(new Vector3(13.5f, (float)(30 + index * 5), (float)(27 - index)), 354); TrixelParticleSystem system = new TrixelParticleSystem(this.Game, new TrixelParticleSystem.Settings() { ExplodingInstance = trileInstance, EnergySource = new Vector3?(trileInstance.Center), ParticleCount = 25, MinimumSize = 1, MaximumSize = 6, GravityModifier = 1.5f, Darken = true, Energy = (float)(index + 2) / 4f }); this.ParticleSystems.Add(system); system.Initialize(); } this.Enabled = true; }
private void TryInitialize() { if (this.LevelManager.Name == null || !this.LevelManager.Name.StartsWith("HOLE")) return; this.GameState.SkipFadeOut = true; this.PlayerManager.CanControl = false; this.CameraManager.Constrained = true; this.CameraManager.PixelsPerTrixel = 3f; this.CameraManager.Center = new Vector3(13f, 20f, 27.875f); this.PlayerManager.Position = new Vector3(13.5f, 15.47f, 28.5f); this.PlayerManager.Ground = new MultipleHits<TrileInstance>(); this.PlayerManager.Velocity = 0.007875f * -Vector3.UnitY; this.PhysicsManager.Update((IComplexPhysicsEntity) this.PlayerManager); this.PlayerManager.Velocity = 0.007875f * -Vector3.UnitY; this.PlayerManager.RecordRespawnInformation(true); this.PlayerManager.Position = new Vector3(13.5f, 50f, 28.5f); this.PlayerManager.Ground = new MultipleHits<TrileInstance>(); this.PlayerManager.Action = ActionType.FreeFalling; for (int index = 0; index < 4; ++index) { TrileInstance trileInstance = new TrileInstance(new Vector3(13.5f, (float) (30 + index * 5), (float) (27 - index)), 354); TrixelParticleSystem system = new TrixelParticleSystem(this.Game, new TrixelParticleSystem.Settings() { ExplodingInstance = trileInstance, EnergySource = new Vector3?(trileInstance.Center), ParticleCount = 25, MinimumSize = 1, MaximumSize = 6, GravityModifier = 1.5f, Darken = true, Energy = (float) (index + 2) / 4f }); this.ParticleSystems.Add(system); system.Initialize(); } this.Enabled = true; }
public void Add(TrixelParticleSystem system) { ServiceHelper.AddComponent((IGameComponent)system); this.ActiveParticleSystems.Add(system); }
public void Add(TrixelParticleSystem system) { ServiceHelper.AddComponent((IGameComponent) system); this.ActiveParticleSystems.Add(system); }
private void StartCrumbling() { SoundEffectExtensions.EmitAt(this.Host.sCrumble, this.OriginalCenter, RandomHelper.Centered(0.00999999977648258)); Vector3 vector3_1 = FezMath.SideMask(this.CameraManager.Viewpoint); Vector3 vector3_2 = FezMath.ForwardVector(this.CameraManager.Viewpoint); bool flag1 = (double) vector3_1.X != 0.0; bool flag2 = flag1; int num = flag2 ? (int) vector3_2.Z : (int) vector3_2.X; Point key = new Point(flag1 ? this.Instance.Emplacement.X : this.Instance.Emplacement.Z, this.Instance.Emplacement.Y); this.LevelManager.WaitForScreenInvalidation(); Limit limit; if (this.LevelManager.ScreenSpaceLimits.TryGetValue(key, out limit)) { limit.End += num; TrileEmplacement id = new TrileEmplacement(flag1 ? key.X : limit.Start, key.Y, flag2 ? limit.Start : key.X); while ((flag2 ? id.Z : id.X) != limit.End) { TrileInstance toRemove = this.LevelManager.TrileInstanceAt(ref id); if (toRemove != null && !toRemove.Hidden && toRemove.Trile.ActorSettings.Type == ActorType.Crumbler) { toRemove.Hidden = true; this.LevelMaterializer.CullInstanceOut(toRemove); this.InstancesToClear.Add(toRemove); ITrixelParticleSystems particleSystems = this.ParticleSystems; CrumblersHost.CrumblerState crumblerState = this; Game game = ServiceHelper.Game; TrixelParticleSystem.Settings settings = new TrixelParticleSystem.Settings() { BaseVelocity = Vector3.Zero, Energy = 0.1f, ParticleCount = (int) (20.0 / (double) this.InstancesToClear.Count), GravityModifier = 0.6f, Crumble = true, ExplodingInstance = toRemove }; TrixelParticleSystem trixelParticleSystem1; TrixelParticleSystem trixelParticleSystem2 = trixelParticleSystem1 = new TrixelParticleSystem(game, settings); crumblerState.System = trixelParticleSystem1; TrixelParticleSystem system = trixelParticleSystem2; particleSystems.Add(system); } if (flag2) id.Z += num; else id.X += num; } } Waiters.Wait(1.0, new Action(this.ClearTriles)).AutoPause = true; }