private void OnParticleAdded(Particle9 particle) { try { if (/*!particle.Released || */ particle.Name != "particles/generic_gameplay/rune_bounty_owner.vpcf") { return; } var position = particle.GetControlPoint(0); var runeSpawn = Array.Find(this.bountySpawns, x => x.Distance2D(position) < 500); if (runeSpawn.IsZero) { return; } if (this.pickedRunes.Contains(runeSpawn)) { return; } if (this.pickedRunes.Count == 0) { RendererManager.Draw += this.OnDraw; } this.pickedRunes.Add(runeSpawn); } catch (Exception e) { Logger.Error(e); } }
private void OnParticleAdded(Particle9 particle) { try { //if (!particle.Released) //{ // return; //} switch (particle.Name) { case "particles/units/heroes/hero_ancient_apparition/ancient_apparition_ice_blast_final.vpcf": case "particles/econ/items/ancient_apparition/aa_blast_ti_5/ancient_apparition_ice_blast_final_ti5.vpcf": { var startPosition = particle.GetControlPoint(0); var endPosition = particle.GetControlPoint(1); var time = GameManager.RawGameTime - (GameManager.Ping / 1000); var flyingTime = time - this.unitAddTime; var direction = startPosition + endPosition; var position = startPosition.Extend2D(direction, flyingTime * this.speed); var radius = Math.Min(this.maxRadius, Math.Max((flyingTime * this.growRadius) + this.minRadius, this.minRadius)); this.effect = ParticleManager.CreateParticle( "particles/units/heroes/hero_ancient_apparition/ancient_apparition_ice_blast_marker.vpcf", position.SetZ(384)); // todo correct z coord this.effect.SetControlPoint(1, new Vector3(radius, 1, 1)); break; } case "particles/econ/items/ancient_apparition/aa_blast_ti_5/ancient_apparition_ice_blast_explode_ti5.vpcf": case "particles/units/heroes/hero_ancient_apparition/ancient_apparition_ice_blast_explode.vpcf": Context9.ParticleManger.ParticleAdded -= this.OnParticleAdded; this.effect?.Dispose(); break; } } catch (Exception e) { Logger.Error(e); } }
private void ParticleMangerOnParticleAdded(Particle9 particle) { try { //if (particle.Released) //{ // return; //} switch (particle.Name) { case "particles/units/heroes/hero_snapfire/hero_snapfire_ultimate_linger.vpcf": { if (this.effects.Count == 0) { return; } var effect = this.effects.Dequeue(); if (effect.IsValid) { effect.Dispose(); } break; } case "particles/units/heroes/hero_snapfire/snapfire_lizard_blobs_arced.vpcf": { var effect = ParticleManager.CreateParticle( "particles/units/heroes/hero_snapfire/hero_snapfire_ultimate_calldown.vpcf", particle.GetControlPoint(1)); effect.SetControlPoint(1, this.radius); effect.SetControlPoint(2, new Vector3(0.8f, 0, 0)); this.effects.Enqueue(effect); break; } } } catch (Exception e) { Logger.Error(e); } }
private void OnParticleAdded(Particle9 particle) { try { if (/*!particle.Released || */ particle.Name != "particles/units/heroes/hero_gyrocopter/gyro_calldown_first.vpcf") { return; } var effect = ParticleManager.CreateParticle( "particles/units/heroes/hero_gyrocopter/gyro_calldown_marker.vpcf", particle.GetControlPoint(1)); effect.SetControlPoint(1, this.radius); effect.Release(); } catch (Exception e) { Logger.Error(e); } }
private void OnParticleAdded(Particle9 particle) { try { if (/*particle.Released || */ particle.Name != "particles/units/heroes/hero_invoker/invoker_emp.vpcf") { return; } var position = particle.GetControlPoint(0); var effect = ParticleManager.CreateParticle("particles/ui_mouseactions/range_finder_tower_aoe.vpcf", position); effect.SetControlPoint(2, position); effect.SetControlPoint(3, this.radius); effect.SetControlPoint(4, this.color); UpdateManager.BeginInvoke(this.duration, () => effect.Dispose()); } catch (Exception e) { Logger.Error(e); } }