void Init() { Effect = new ParticleEffect(); Effect.OnEnding += new ParticleEffect.ParticleEffectEventHandler(Effect_OnEnding); Effect.Texture = Create.Texture("blurredbar"); Effect.Position = Position; Effect.ParticleCount = 150; Effect.GenerationPeriod = .1D; Effect.GenerationCount = 20; Effect.Gravity = 0F; Effect.Mass = new Vector2f(10, 10); Effect.MinPosition = new Vector2f(-15F, -4F); Effect.MaxPosition = new Vector2f(15F, 4F); Effect.MinColor = Color.Green; Effect.MaxColor = Color.Green; Effect.Acceleration = new Vector2f(0f, 5f); Effect.AlphaLimit = new Vector2f(0.55f, .8f); Effect.Angle = new Vector2f(270f, 270f); Effect.DurationTime = new Vector2f(.5f, 1.2f); Effect.Rotation = new Vector2f(0, 0); Effect.MinScale = new Vector2f(.003f, .003f); Effect.MaxScale = new Vector2f(.02f, .02f); const float SV = .1F; Effect.MinScaleVariation = new Vector2f(SV, SV); Effect.MaxScaleVariation = new Vector2f(SV, SV); Effect.Velocity = new Vector2f(10F, 70F); Effect.Init(); }
public Tombstone(Unit unit) { this.unit = unit; PositionCorrection = new Vector2(25); var level = (uint)char.GetNumericValue(unit.Name.Last()); Radius = Ability.GetAbilityDataByName(AbilityName) .AbilitySpecialData.First(x => x.Name == "radius") .GetValue(level - 1); Duration = Ability.GetAbilityDataByName(AbilityName) .AbilitySpecialData.First(x => x.Name == "duration") .GetValue(level - 1); Position = unit.Position; Texture = Drawing.GetTexture("materials/ensage_ui/other/tombstone"); Handle = unit.Handle; TextureSize = new Vector2(40); EndTime = Game.RawGameTime + Duration; ShowTimer = Menu.TimerEnabled(AbilityName); if (Menu.RangeEnabled(AbilityName)) { ParticleEffect = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", Position); ParticleEffect.SetControlPoint(1, new Vector3(128, 128, 128)); ParticleEffect.SetControlPoint(2, new Vector3(Radius, 255, 0)); } }
public ParticleMapEffect(ParticleMapEffect copy) : base(copy) { DrawOrder = DrawOrder.Normal; Effect = new ParticleEffect(copy.Effect); }
/// <summary> /// Serializes the specified ParticleEffect instance. /// </summary> /// <param name="effect">The ParticleEffect to be serialized.</param> /// <param name="filename">The desired output file name,</param> public void Serialize(ParticleEffect effect, string filename) { // Create a new xml document... XDocument xmlDocument = new XDocument(); // Use the XNA serializer to populate the xml document... using (XmlWriter writer = xmlDocument.CreateWriter()) { IntermediateSerializer.Serialize<ParticleEffect>(writer, effect, ".\\"); } //// hack: Workaround for intermediate serializer not putting nodes in the right order... //foreach (XElement emitterElement in xmlDocument.Descendants("Asset").Elements("Item")) //{ // XElement releaseQuantityElement = emitterElement.Element("ReleaseQuantity"); // if ((releaseQuantityElement.PreviousNode as XElement).Name == "Name") // { // XElement termElement = emitterElement.Element("Term"); // termElement.AddAfterSelf(releaseQuantityElement); // releaseQuantityElement.Remove(); // } //} // Save the xml document... xmlDocument.Save(filename); }
public ParticleSystem(ParticleSettings settings, Effect effect) { if (settings == null) throw new ArgumentNullException("settings"); if (effect == null) throw new ArgumentNullException("effect"); if (settings.Texture == null) throw new ArgumentException("Texture is null."); Enabled = true; this.settings = settings; //---------------------------------------------------------------- // システム名 Name = settings.Name; //---------------------------------------------------------------- // エフェクト particleEffect = new ParticleEffect(effect); particleEffect.Initialize(settings, settings.Texture); graphicsDevice = particleEffect.GraphicsDevice; //---------------------------------------------------------------- // パーティクル particles = new ParticleVertex[settings.MaxParticles * 4]; for (int i = 0; i < settings.MaxParticles; i++) { particles[i * 4 + 0].Corner = new Short2(-1, -1); particles[i * 4 + 1].Corner = new Short2(1, -1); particles[i * 4 + 2].Corner = new Short2(1, 1); particles[i * 4 + 3].Corner = new Short2(-1, 1); } //---------------------------------------------------------------- // 頂点バッファ vertexBuffer = new DynamicVertexBuffer( graphicsDevice, ParticleVertex.VertexDeclaration, settings.MaxParticles * 4, BufferUsage.WriteOnly); //---------------------------------------------------------------- // インデックス バッファ var indices = new ushort[settings.MaxParticles * 6]; for (int i = 0; i < settings.MaxParticles; i++) { indices[i * 6 + 0] = (ushort) (i * 4 + 0); indices[i * 6 + 1] = (ushort) (i * 4 + 1); indices[i * 6 + 2] = (ushort) (i * 4 + 2); indices[i * 6 + 3] = (ushort) (i * 4 + 0); indices[i * 6 + 4] = (ushort) (i * 4 + 2); indices[i * 6 + 5] = (ushort) (i * 4 + 3); } indexBuffer = new IndexBuffer(graphicsDevice, typeof(ushort), indices.Length, BufferUsage.WriteOnly); indexBuffer.SetData(indices); }
/// <summary> /// The create range display. /// </summary> public void CreateRangeDisplay() { this.RangeDisplay = this.Entity.AddParticleEffect(@"particles\ui_mouseactions\drag_selected_ring.vpcf"); this.RangeDisplay.SetControlPoint(1, new Vector3(255, 80, 80)); this.RangeDisplay.SetControlPoint(3, new Vector3(9, 0, 0)); this.RangeDisplay.SetControlPoint(2, new Vector3(this.Radius + 30, 255, 0)); }
public static void OnValueChanged(object sender, OnValueChangeEventArgs args) { var oldOne = args.GetOldValue<KeyBind>().Active; var newOne = args.GetNewValue<KeyBind>().Active; if (oldOne == newOne) return; if (newOne) { _effect?.Dispose(); _effect = Members.MyHero.AddParticleEffect("materials/ensage_ui/particles/line.vpcf"); var frontPoint = Members.MyHero.InFront(1200); _effect.SetControlPoint(1, Members.MyHero.Position); _effect.SetControlPoint(2, frontPoint); _effect.SetControlPoint(3, new Vector3(255, 50, 0)); _effect.SetControlPoint(4, new Vector3(255, 255, 255)); } else try { _tks.Cancel(); _effect?.Dispose(); } catch (Exception) { // ignored } }
private Gfx() { var images = new ImageCollection(); // walls images.AddImage("walls", "Resources/gfx/blocks/green-wall.png"); images.AddImage("trees", "Resources/gfx/blocks/tree-wall.png"); // players images.AddImage("player-movement", "Resources/gfx/tanks/tank.png"); images.AddImage("enemy-movement", "Resources/gfx/tanks/enemy.png"); images.AddImage("player-bullet-flight", "Resources/gfx/bullets/bullet.png"); // menu images.AddImage("game-menu-background", "Resources/gfx/menu/title.png"); images.AddImage("game-ground", "Resources/gfx/menu/title.png"); // bonus images.AddImage("bonus-boom", "Resources/gfx/bonus/boom.png"); images.AddImage("bonus-health", "Resources/gfx/bonus/health.png"); images.AddImage("bonus-life", "Resources/gfx/bonus/life.png"); m_worldTexture = new Texture(images, PixelFormat.DefaultAlpha); UnitExplosion = new ParticleEffect("Resources/gfx/particles/rocket-explosion-smoke.peff"); RocketExplosionParticleEffect = new ParticleEffect("Resources/gfx/particles/rocket-explosion.peff"); }
public static void Main(string[] args) { Game.OnUpdate += Game_OnUpdate; Orbwalking.Load(); if (rangeDisplay == null) { return; } rangeDisplay = null; Urn = null; Abyssal = null; Blademail = null; Mjollnir = null; Orchid = null; Halberd = null; Satanic = null; Hex = null; SolarCrest = null; Medallion = null; Blink = null; Armlet = null; loaded = false; spellQ = null; spellR = null; //Aghs = null; }
public static void Init() { gameLoad = false; isInCombo = false; isAABest = false; lastHitting = false; rangesAA = null; rangesW = null; Orbwalking.Load(); /*pippyFont = new Font(Drawing.Direct3DDevice9, 20, 0, FontWeight.Bold, 0, false, FontCharacterSet.Default, FontPrecision.Default, FontQuality.Antialiased, FontPitchAndFamily.Default, "Tahoma"); */ //Events Game.OnUpdate += DRangerUpdate; Game.OnWndProc += DRangerWnd; Drawing.OnDraw += DRangerDraw; }
/// <summary> /// Renders the specified ParticleEffect. /// </summary> public virtual void RenderEffect(ParticleEffect effect) { Guard.ArgumentNull("effect", effect); Matrix ident = Matrix.Identity; this.RenderEffect(effect, ref ident); }
private static void DrawLine(Vector3 position, float size, int directionf, int directionu) { var effect = new ParticleEffect(@"particles\ui_mouseactions\drag_selected_ring.vpcf", position); ParticleEffects.Add(effect); effect.SetControlPoint(1, new Vector3(0, 125, 0)); effect.SetControlPoint(2, new Vector3(size, 255, 0)); effect.SetControlPointOrientation(4, new Vector3(directionf, 0, 0), new Vector3(directionu, 0, 0), new Vector3(0, 0, 0)); }
/// <summary> /// The create. /// </summary> public void Create() { this.rangeDisplay = this.me.AddParticleEffect(@"particles\ui_mouseactions\drag_selected_ring.vpcf"); this.rangeDisplay.SetControlPoint(1, new Vector3(255, 80, 50)); this.rangeDisplay.SetControlPoint(3, new Vector3(20, 0, 0)); this.lastRange = this.GetAttackRange(); this.rangeDisplay.SetControlPoint(2, new Vector3(this.lastRange, 255, 0)); }
public RangeObj(Ability ability) { _ability = ability; IsDisplayed = false; _effect = null; _lastUsedRange = 0; UpdateRange(); }
/// <summary> /// Renders the specified ParticleEffect. /// </summary> public void RenderEffect(ParticleEffect effect, SpriteBatch spriteBatch) { Guard.ArgumentNull("effect", effect); Guard.ArgumentNull("spriteBatch", spriteBatch); for (int i = 0; i < effect.Count; i++) this.RenderEmitter(effect[i], spriteBatch); }
public Tracker(Entity v,ParticleEffect ef) { V = v; Ef = ef; /*Game.OnUpdate += args => { Printer.Print($"{ef.Name}/{ef.IsDestroyed}/{ef.IsManaged}/{ef.IsValid}/{ef.RefCount}"); };*/ }
public void OnClose() { menuManager.OnClose(); allSpells.Clear(); targetParticle?.Dispose(); targetParticle = null; target = null; targetLocked = false; }
protected Ward(Vector3 position, string abilityName) { Position = position; RequiresUpdate = true; TextureSize = new Vector2(50, 35); if (Menu.RangeEnabled(abilityName)) { ParticleEffect = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", Position); } }
public static void Init() { Game.OnUpdate += Game_OnUpdate; Orbwalking.Load(); if (rangeDisplay == null) { return; } rangeDisplay = null; }
/// <summary> /// The dispose. /// </summary> public void Dispose() { if (this.IsDisposed()) { return; } this.rangeDisplay.Dispose(); this.rangeDisplay = null; }
private void DrawRange() { if (ParticleEffect == null) { return; } ParticleEffect = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", Position); ParticleEffect.SetControlPoint(1, new Vector3(255, 255, 0)); ParticleEffect.SetControlPoint(2, new Vector3(Radius, 255, 0)); }
/// <summary> /// Serializes the specified particle effect to the specified file path. /// </summary> /// <param name="particleEffect">The particle effect to be serialized.</param> /// <param name="filePath">The path to the desired output file.</param> public void Serialize(ParticleEffect particleEffect, string filePath) { XDocument xmlDocument = new XDocument(); using (XmlWriter writer = xmlDocument.CreateWriter()) { IntermediateSerializer.Serialize<ParticleEffect>(writer, particleEffect, ".\\"); } xmlDocument.Save(filePath); }
public RemoteMine(Vector3 position) : base(position) { if (Menu.RangeEnabled(AbilityName)) { ParticleEffect = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", position); } RequiresUpdate = true; Duration = Ability.GetAbilityDataByName(AbilityName).AbilitySpecialData.First(x => x.Name == "duration").Value; Initialize(); }
/// <summary> /// Renders the specified particle effect. /// </summary> /// <param name="effect">The particle effect to render.</param> /// <param name="worldMatrix">The world transformation matrix.</param> /// <param name="viewMatrix">The view matrix.</param> /// <param name="projectionMatrix">The projection matrix.</param> /// <param name="cameraPosition">The camera matrix.</param> public void RenderEffect(ParticleEffect effect, ref Matrix worldMatrix, ref Matrix viewMatrix, ref Matrix projectionMatrix, ref Vector3 cameraPosition) { #if UNSAFE unsafe #endif { this.PreRender(ref worldMatrix, ref viewMatrix, ref projectionMatrix); //Pre-multiply any proxies world matrices with the passed in world matrix if (effect.Proxies != null && worldMatrix != Matrix.Identity) { effect.SetFinalWorld(ref worldMatrix); } for (Int32 i = 0; i < effect.Emitters.Count; i++) { AbstractEmitter emitter = effect.Emitters[i]; // Skip if the emitter does not have a texture... if (emitter.ParticleTexture == null) continue; // Skip if the emitter blend mode is set to 'None'... if (emitter.BlendMode == EmitterBlendMode.None) continue; // Skip if the emitter has no active particles... if (emitter.ActiveParticlesCount == 0) continue; BlendState blendState = BlendStateFactory.GetBlendState(emitter.BlendMode); RenderContext context = new RenderContext(emitter.BillboardStyle, emitter.BillboardRotationalAxis, blendState, emitter.ParticleTexture, ref worldMatrix, ref viewMatrix, ref projectionMatrix, ref cameraPosition, emitter.ActiveParticlesCount, emitter.UseVelocityAsBillboardAxis); Counters.ParticlesDrawn += emitter.ActiveParticlesCount; #if UNSAFE fixed (Particle* buffer = emitter.Particles) #else Particle[] buffer = emitter.Particles; #endif { ParticleIterator iterator = new ParticleIterator(buffer, emitter.Budget, emitter.ActiveIndex, emitter.ActiveParticlesCount); this.Render(ref context, ref iterator); } } } }
protected Mine(Unit unit, string abilityName) { Unit = unit; Position = unit.Position; Texture = Drawing.GetTexture("materials/ensage_ui/other/" + unit.Name); Handle = unit.Handle; TextureSize = new Vector2(40); if (Menu.RangeEnabled(abilityName)) { ParticleEffect = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", Position); } }
public RemoteMine(Unit unit) : base(unit, AbilityName) { Duration = unit.FindModifier("modifier_techies_remote_mine")?.RemainingTime ?? Ability.GetAbilityDataByName(AbilityName) .AbilitySpecialData.First(x => x.Name == "duration") .Value; if (Menu.RangeEnabled(AbilityName)) { ParticleEffect = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", unit.Position); } Initialize(); }
protected Ward(Unit unit, string abilityName) { Unit = unit; Position = unit.Position; Duration = unit.FindModifier("modifier_item_buff_ward").RemainingTime; EndTime = Game.RawGameTime + Duration; RequiresUpdate = false; Handle = unit.Handle; TextureSize = new Vector2(50, 35); if (Menu.RangeEnabled(abilityName)) { ParticleEffect = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", Position); } }
public void RenderEffect(GraphicsContext graphicsContext, ParticleEffect particleEffect) { for (int i = 0; i < particleEffect.Emitters.Count; i++) { ParticleEmitter emitter = particleEffect.Emitters[i]; if (emitter.Buffer.Count == 0) { continue; } ParticleBuffer.Iterator iterator = emitter.Buffer.CreateIterator(this.IteratorMode); TextureDefinition textureDefinition = (emitter.Texture != TextureDefinition.Empty) ? emitter.Texture : new TextureDefinition(graphicsContext.BlankTexture); this.Render(graphicsContext, ref iterator, textureDefinition, emitter.BlendMode); } }
private static void DrawTarget() { if (particleEffect == null) { particleEffect = new ParticleEffect(@"particles\ui_mouseactions\range_finder_tower_aoe.vpcf", e); particleEffect.SetControlPoint(2, new Vector3(me.Position.X, me.Position.Y, me.Position.Z)); particleEffect.SetControlPoint(6, new Vector3(1, 0, 0)); particleEffect.SetControlPoint(7, new Vector3(e.Position.X, e.Position.Y, e.Position.Z)); } else { particleEffect.SetControlPoint(2, new Vector3(me.Position.X, me.Position.Y, me.Position.Z)); particleEffect.SetControlPoint(6, new Vector3(1, 0, 0)); particleEffect.SetControlPoint(7, new Vector3(e.Position.X, e.Position.Y, e.Position.Z)); } }
/// <summary> /// Creates a new proxy effect /// </summary> public ParticleEffectProxy(ParticleEffect effect) { this.Effect = effect; this.Index = Proxies.Count; // Add ourselves to the static list... Proxies.Add(this); if (effect.Proxies == null) { effect.Proxies = new List<ParticleEffectProxy>(); } effect.Proxies.Add(this); }
private void PingWard(IWard ward) { if (!ward.RequiresUpdate || lastPingTime + 10 > Game.RawGameTime) { return; } lastPingTime = Game.RawGameTime; Network.MapPing(ward.Position.ToVector2(), (PingType)5); // client ping mapPingParticleEffect = new ParticleEffect("particles/ui_mouseactions/ping_enemyward.vpcf", ward.Position); mapPingParticleEffect.SetControlPoint(1, new Vector3(1)); mapPingParticleEffect.SetControlPoint(5, new Vector3(10, 0, 0)); hero.PlaySound("General.Ping"); }
private void OnAddEntity(EntityEventArgs args) { try { if (this.sleeper) { return; } var unit = args.Entity as Unit; if (unit == null || unit.Team == this.ownerTeam || unit.DayVision != 0 || unit.Name != "npc_dota_thinker") { return; } if (unit.IsVisible && unit.Modifiers.All(x => x.Name != "modifier_radar_thinker")) { return; } this.scanPosition = unit.Position; if (this.showOnMap) { this.scanRadius = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", this.scanPosition); this.scanRadius.SetControlPoint(1, new Vector3(255, 0, 0)); this.scanRadius.SetControlPoint(2, new Vector3(-GameData.ScanRadius, 255, 0)); } this.sleeper.Sleep(this.ownerTeam == Team.Radiant ? Game.ScanCooldownDire : Game.ScanCooldownRadiant); this.context.Renderer.Draw += this.OnDrawPosition; UpdateManager.BeginInvoke( () => { this.context.Renderer.Draw -= this.OnDrawPosition; this.scanRadius?.Dispose(); }, GameData.ScanActiveTime * 1000); } catch (Exception e) { Logger.Error(e); } }
// Token: 0x06000183 RID: 387 RVA: 0x0000D894 File Offset: 0x0000BA94 private void ShowOnValueChange(object sender, SwitcherEventArgs e) { if (e.NewValue) { EntityManager9.AbilityAdded += this.OnAbilityAdded; return; } EntityManager9.AbilityAdded -= this.OnAbilityAdded; Unit.OnModifierAdded -= this.OnModifierAdded; ParticleEffect particleEffect = this.effect; if (particleEffect == null) { return; } particleEffect.Dispose(); }
public TreantEye(Unit unit, Settings settings) : base(unit) { AbilityName = "treant_eyes_in_the_forest"; Radius = Ability.GetAbilityDataByName(AbilityName).AbilitySpecialData.First(x => x.Name == "vision_aoe").Value; Texture = Drawing.GetTexture("materials/ensage_ui/other/eyes_in_the_forest"); ShowTimer = false; if (!settings.RangeEnabled(AbilityName)) { return; } ParticleEffect = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", Position); ParticleEffect.SetControlPoint(1, new Vector3(50, 205, 50)); ParticleEffect.SetControlPoint(2, new Vector3(Radius, 255, 0)); }
public static void Init() { Menu.AddItem(new MenuItem("chaseKey", "Chase Key").SetValue(new KeyBind(32, KeyBindType.Press))); Menu.AddItem(new MenuItem("kiteKey", "Kite Key").SetValue(new KeyBind('V', KeyBindType.Press))); Menu.AddItem(new MenuItem("farmKey", "Farm Key").SetValue(new KeyBind('B', KeyBindType.Press))); Menu.AddItem( new MenuItem("bonusWindup", "Bonus WindUp time on kitting").SetValue(new Slider(500, 100, 2000)) .SetTooltip("Time between attacks in kitting mode")); Menu.AddToMainMenu(); Game.OnUpdate += Game_OnUpdate; Orbwalking.Load(); if (rangeDisplay == null) { return; } rangeDisplay = null; }
public static void SmartBlink(EventArgs args) { if (!Game.IsInGame || Game.IsWatchingGame) { return; } me = ObjectMgr.LocalHero; if (me == null) { return; } if (me.ClassID != ClassID.CDOTA_Unit_Hero_Tinker) { return; } if (((Game.IsKeyDown(Menu.Item("Smart Blink").GetValue <KeyBind>().Key)) && !Game.IsChatOpen) && Utils.SleepCheck("SmartblinkTime")) { smartblink_option = !smartblink_option; Blink = me.FindItem("item_blink"); Utils.Sleep(300, "SmartblinkTime"); mousepos = Game.MousePosition; if (SmartBlinkEffect != null) { SmartBlinkEffect.Dispose(); } SmartBlinkEffect = new ParticleEffect(@"particles\ui_mouseactions\drag_selected_ring.vpcf", mousepos); } if (smartblink_option) { SmartBlinkEffect.SetControlPoint(2, new Vector3(50, 255, 400)); SmartBlinkEffect.SetControlPoint(1, new Vector3(200, 34, 76)); if (Blink != null && Blink.CanBeCasted() && !me.IsChanneling() && !me.Spellbook.Spells.Any(x => x.IsInAbilityPhase) && Utils.SleepCheck("blink")) { Blink.UseAbility(me.Distance2D(mousepos) < 1200 ? mousepos : new Vector3(me.NetworkPosition.X + 1150 * (float)Math.Cos(me.NetworkPosition.ToVector2().FindAngleBetween(mousepos.ToVector2(), true)), me.NetworkPosition.Y + 1150 * (float)Math.Sin(me.NetworkPosition.ToVector2().FindAngleBetween(mousepos.ToVector2(), true)), 100), false); Utils.Sleep(50, "blink"); } if (Blink.Cooldown >= 11.5) { smartblink_option = false; } } else if (SmartBlinkEffect != null) { SmartBlinkEffect.Dispose(); } }
/// <summary> /// Plays the given particle effect at the given position. Note that particle effects are denoted by enum constants /// instead of GameObjects /// </summary> public void Play(ParticleEffect particleEffect, Vector3 position) { // Retrieves the pool which stores instances of the desired particle effect ParticleEffectPool pool = particleEffectPools[particleEffect]; // Obtain a particle effect from the pool. This is the particle effect that will be played ParticleSystem particleSystem = pool.Obtain(); // Set the position of the particle system particleSystem.transform.position = position; // Play the particle effects particleSystem.Play(); // Wait for the particles to die and place them back in the pool once they do StartCoroutine(WaitForParticleDeath(particleSystem, pool)); }
private void DrawEffects(GameTime gameTime) { SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive); //SpriteBatch.Begin(SpriteBlendMode.Additive, SpriteSortMode.Deferred, SaveStateMode.None); for (int y = 0; y < Effects.Count; y++) { ParticleEffect effect = Effects[y]; for (int i = 0; i < effect.ParticleList.Count; i++) { Particle particle = effect.ParticleList[i]; Rectangle sourceRectangle = particleEffectSheet.GetSourceRectangle(effect.Sprite); //.SourceRectangle(effect.Sprite); Vector2 origin = new Vector2(sourceRectangle.Width / 2, sourceRectangle.Height / 2); SpriteBatch.Draw(particleEffectSheet.Texture, particle.Position, sourceRectangle, particle.ModColor, i, origin, particle.Scaling, SpriteEffects.None, 1); } } SpriteBatch.End(); }
public void DrawRange() { if (!this.IsShowingRange) { return; } if (this.RangeParticle != null) { this.RangeParticle.SetControlPoint(0, this.Position); return; } this.RangeParticle = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", this.Position); this.RangeParticle.SetControlPoint(1, this.RangeColor); this.RangeParticle.SetControlPoint(2, new Vector3(-this.Range, 255, 0)); }
// Token: 0x060001B2 RID: 434 RVA: 0x0000E44C File Offset: 0x0000C64C private void CheckAllyShrine(Vector3 position) { Ability9 ability = EntityManager9.Abilities.FirstOrDefault((Ability9 x) => x.Id == AbilityId.filler_ability && x.Owner.Distance(position) < 500f); if (ability == null) { return; } ParticleEffect shrineRadius = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", ability.Owner.Position); shrineRadius.SetControlPoint(1u, (this.ownerTeam == Team.Radiant) ? new Vector3(0f, 191f, 255f) : new Vector3(240f, 128f, 128f)); shrineRadius.SetControlPoint(2u, new Vector3(-ability.Radius * 1.1f, 255f, 0f)); UpdateManager.BeginInvoke(delegate { shrineRadius.Dispose(); }, (int)ability.Duration * 1000); }
public PsionicTrap(Unit unit, Settings settings) : base(unit) { AbilityName = "templar_assassin_trap"; Radius = Ability.GetAbilityDataByName(AbilityName).AbilitySpecialData.First(x => x.Name == "trap_radius").Value + 25; Texture = Drawing.GetTexture("materials/ensage_ui/other/trap"); ShowTimer = false; if (!settings.RangeEnabled(AbilityName)) { return; } ParticleEffect = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", Position); ParticleEffect.SetControlPoint(1, new Vector3(255, 105, 180)); ParticleEffect.SetControlPoint(2, new Vector3(Radius, 255, 0)); }
public MainGame() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = gameWidth; graphics.PreferredBackBufferHeight = gameHeight; this.graphics.IsFullScreen = isFullScreen; Content.RootDirectory = "Content"; particleEffect = new ParticleEffect(); particleRenderer = new SpriteBatchRenderer { GraphicsDeviceService = graphics }; }
public static void Postfix(ref Block __instance) { if (__instance.Properties.Values.ContainsKey("ParticleName")) { String strParticleName = __instance.Properties.Values["ParticleName"]; if (!ParticleEffect.IsAvailable(strParticleName)) { ParticleEffect.RegisterBundleParticleEffect(strParticleName); } } if (__instance is BlockDoorSecure) { return; } }
public void Add(ParticleEffect effect, Vector3 position, Vector3 color) { var id = (uint)ColorList.FindIndex(x => x == color); var player = ObjectManager.GetPlayerByID(id); if (player == null || !player.IsValid) { Printer.Print("error #" + id); return; } if ((player.Team == Members.MyPlayer.Team && ForAlly) || (player.Team != Members.MyPlayer.Team && ForEnemy)) { _effectList.Add(new TeleportEffect(effect, position, color)); //Printer.Print($"Player: {player.Name} ({id}) | Hero: {player.Hero.GetRealName()} | Color: {color}"); //Console.WriteLine($"Color: {color.PrintVector()}"); } }
public static void illusionstart() { me = ObjectMgr.LocalHero; if (me == null && !Game.IsInGame) { return; } try { List <Hero> heroes = ObjectMgr.GetEntities <Hero>().Where(x => x.IsIllusion && x.Team != me.Team && x.IsAlive && x.IsValid && x.IsVisible).ToList(); if (heroes != null) { foreach (Hero x in heroes) { try { if (x != null) { if (particleEffect == null || oldhandle != x.Handle) { particleEffect = x.AddParticleEffect(@"particles/items2_fx/phase_boots.vpcf"); oldhandle = x.Handle; } ParticleDictionary.Add(x.Handle.ToString(), particleEffect); } else { if (particleEffect == null) { continue; } //if (ParticleDictionary.TryGetValue(x.Handle.ToString(), out particleEffect)) particleEffect.Dispose(); ParticleDictionary.Remove(x.Handle.ToString()); } } catch (SystemException) { } } } } catch (EntityNotFoundException) { } }
private static void DrawForMirana(Hero mirana, List <Unit> Base) { if (_arrowUnit == null) { _arrowUnit = Base.Find(x => x.DayVision == 650 && x.Team == Members.MyHero.GetEnemyTeam()); } if (_arrowUnit != null) { if (!_arrowUnit.IsValid) { foreach (var effect in ArrowParticalEffects.Where(effect => effect != null)) { effect.Dispose(); } _letsDraw = true; _arrowUnit = Manager.BaseManager.GetBaseList() .Find(x => x.DayVision == 650 && x.Team == Members.MyHero.GetEnemyTeam()); return; } if (!InSys.Contains(_arrowUnit)) { _arrowS = _arrowUnit.Position; InSys.Add(_arrowUnit); Utils.Sleep(100, "kek"); Helper.GenerateSideMessage(mirana.StoredName().Replace("npc_dota_hero_", ""), "mirana_arrow"); } else if (_letsDraw && Utils.SleepCheck("kek") && _arrowUnit.IsVisible) { _letsDraw = false; var ret = Helper.FindRet(_arrowS, _arrowUnit.Position); for (var z = 1; z <= 147; z++) { var p = Helper.FindVector(_arrowS, ret, 20 * z + 60); ArrowParticalEffects[z] = new ParticleEffect( @"particles\ui_mouseactions\draw_commentator.vpcf", p); ArrowParticalEffects[z].SetControlPoint(1, new Vector3(Members.Menu.Item("mirana.Red").GetValue <Slider>().Value, Members.Menu.Item("mirana.Green").GetValue <Slider>().Value, Members.Menu.Item("mirana.Blue").GetValue <Slider>().Value)); ArrowParticalEffects[z].SetControlPoint(0, p); } } } }
public StasisTrap(Unit unit, Settings settings) : base(unit) { AbilityName = "techies_stasis_trap"; Radius = Ability.GetAbilityDataByName(AbilityName).AbilitySpecialData.First(x => x.Name == "activation_radius").Value; Texture = Drawing.GetTexture("materials/ensage_ui/other/npc_dota_techies_stasis_trap"); ShowTimer = false; if (!settings.RangeEnabled(AbilityName)) { return; } ParticleEffect = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", Position); ParticleEffect.SetControlPoint(1, new Vector3(65, 105, 225)); ParticleEffect.SetControlPoint(2, new Vector3(Radius, 255, 0)); }
private void DestroyAttackEffect() { if (_attackRangeEffect != null) { try { _attackRangeEffect.Dispose(); } catch (ParticleEffectNotFoundException) { } finally { _attackRangeEffect = null; } } }
private void OverParticleReturnToPool(string key, ParticleEffect effect) { List <ParticleEffect> deActivePool = null; List <ParticleEffect> activePool = null; if (!deactiveParticlePoolDic.TryGetValue(key, out deActivePool)) { Debug.Log($"EffectManager : {key} 에 해당하는 Deactive Particle Pool 이 없습니다."); } if (!activeParticlePoolDic.TryGetValue(key, out activePool)) { Debug.Log($"EffectManager : {key} 에 해당하는 Active Particle Pool 이 없습니다."); } deActivePool.Add(effect); activePool.Remove(effect); }
public BombManager(Unit bomb, bool isRemoteMine) { Bomb = bomb; IsRemoteMine = isRemoteMine; Damage = isRemoteMine ? Core.RemoteMine.GetAbilityData("damage", Core.RemoteMine.Level) + (Core.Me.AghanimState() ? 150 : 0) : Core.LandMine.GetAbilityData("damage", Core.LandMine.Level); Radius = isRemoteMine ? Core.RemoteMine.GetAbilityData("radius") : Core.LandMine.GetAbilityData("radius"); RangEffect = new ParticleEffect("materials/ensage_ui/particles/range_display_mod.vpcf", Bomb.Position); RangEffect.SetControlPoint(1, new Vector3(Radius, 255, 0)); RangEffect.SetControlPoint(2, bomb.NetworkActivity != NetworkActivity.Spawn ? new Vector3(255, 255, 255) : new Vector3(100, 100, 100)); BombPosition = bomb.Position; Active = bomb.NetworkActivity != NetworkActivity.Spawn; HeroManager = new Dictionary <uint, float>(); effectLocked = false; //Printer.Print($"Damage: {Damage} || Raduis: {Radius} || Activity: {bomb.NetworkActivity}"); if (IsRemoteMine) { Stacker = new Stacker(); var closest = Core.Bombs.Where( x => !x.Equals(this) && x.IsRemoteMine && x.Stacker.IsActive && x.BombPosition.Distance2D(BombPosition) <= StackerRange) .OrderBy(y => y.BombPosition.Distance2D(BombPosition)) .FirstOrDefault(); if (closest != null) { closest.Stacker.Counter++; //Printer.Print($"add [{closest.Stacker.Counter}]"); } else { Stacker.Counter++; //Printer.Print($"new [{Stacker.Counter}]"); } } UpdateManager.Subscribe(Updater, 1000); }
private void SetupParticleSystem() { particleSystem = new ParticleSystem(); shipEffect = new ParticleEffect(); Texture2D texture1 = Content.Load <Texture2D>("Images/smoke2"); Texture2D texture2 = Content.Load <Texture2D>("Images/smoke3"); ParticleEmitter shipEmitter = new ConeEmitter(Vector2.Zero, MathHelper.ToRadians(90)); shipEmitter.AddTexture(texture1); shipEmitter.AddTexture(texture2); shipEmitter.Quantity = 10; shipEmitter.AddPropertyGenerator(new RandomSpeedGenerator(2.01f, 4.0f, 1.0f)); shipEmitter.AddPropertyGenerator(new ConstantColorGenerator(Color.Green * 0.7f)); shipEmitter.AddPropertyGenerator(new RandomTTLGenerator(2.0f, 5.0f, 1.0f)); shipEmitter.AddParticleModifier(new ScaleModifier2(0.1f, 2.0f)); shipEmitter.AddParticleModifier(new DepthModifier2(0.0f, 1.0f)); shipEmitter.AddParticleModifier(new OpacityModifier2(0.6f, 0f)); shipEmitter.AddParticleModifier(new DampingLinearVelocityModifier(0.99f)); shipEmitter.AddParticleModifier(new RotationModifier2(-1.0f, 1.0f)); shipEffect.AddEmitter(shipEmitter); particleSystem.AddEffect(shipEffect); shipEffect2 = new ParticleEffect(); ParticleEmitter shipEmitter2 = new ConeEmitter(Vector2.Zero, MathHelper.ToRadians(90)); shipEmitter2.AddTexture(texture1); shipEmitter2.AddTexture(texture2); shipEmitter2.Quantity = 10; shipEmitter2.AddPropertyGenerator(new RandomSpeedGenerator(2.01f, 4.0f, 1.0f)); shipEmitter2.AddPropertyGenerator(new ConstantColorGenerator(Color.Yellow * 0.7f)); shipEmitter2.AddPropertyGenerator(new RandomTTLGenerator(2.0f, 5.0f, 1.0f)); shipEmitter2.AddParticleModifier( new ScaleModifier2(0.1f, 2.0f)); shipEmitter2.AddParticleModifier( new DepthModifier2(0.0f, 1.0f)); shipEmitter2.AddParticleModifier( new OpacityModifier2(0.6f, 0f)); shipEmitter2.AddParticleModifier(new DampingLinearVelocityModifier(0.99f)); shipEmitter2.AddParticleModifier(new RotationModifier2(-1.0f, 1.0f)); shipEffect2.AddEmitter(shipEmitter2); particleSystem.AddEffect(shipEffect2); }
private void ParticleMangerOnParticleAdded(Particle 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 = new ParticleEffect( "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); } }
public void AddEffect(Unit target, ParticleEffect eff) { var handle = target.Handle; ParticleEffect effect; if (!_effectDictionary.TryGetValue(handle, out effect)) { _effectDictionary.Add(handle, eff); Printer.Print($"[{_name}][NewEffect]: {target.Name}"); } else { effect.Dispose(); _effectDictionary.Remove(handle); AddEffect(target, eff); Printer.Print($"[{_name}][Remove&NewEffect]: {target.Name}"); } }
/// <summary> /// 技能行为发生时的动作 /// </summary> public override void SkillAction() { ParticleEffect pe = new ParticleEffect(GameWorld, GameWorld.Content.Load <ParticleEffectType>(@"ParticleEffectTypes\BlueWave"), null, MargedUnit.SkillPosition(SkillPointNum), 1); Vector3 v = Target.Position - MargedUnit.SkillPosition(SkillPointNum); damaged.Clear(); if (v != Vector3.Zero) { direction = Vector3.Normalize(v); } else { direction = Vector3.Forward; } //pe.ReBirth(); pes.Add(pe); GameWorld.AddParticleEffect(pe); }
public PsionicTrap(Unit unit) { this.unit = unit; PositionCorrection = new Vector2(25); Radius = Ability.GetAbilityDataByName(AbilityName).AbilitySpecialData.First(x => x.Name == "trap_radius").Value; Position = unit.Position; Texture = Drawing.GetTexture("materials/ensage_ui/other/trap"); Handle = unit.Handle; TextureSize = new Vector2(40); if (Menu.RangeEnabled(AbilityName)) { ParticleEffect = new ParticleEffect("particles/ui_mouseactions/drag_selected_ring.vpcf", Position); ParticleEffect.SetControlPoint(1, new Vector3(255, 105, 180)); ParticleEffect.SetControlPoint(2, new Vector3(Radius, 255, 0)); } }
/// <summary> /// </summary> /// <param name="delay"></param> public static void DrawPredictions(float delay = 1000) { var heroes = ObjectMgr.GetEntities <Hero>().Where(x => !x.IsIllusion); foreach (var unit in heroes) { ParticleEffect effect; if (!PredictionDrawings.TryGetValue(unit.Handle, out effect)) { effect = new ParticleEffect( @"particles\ui_mouseactions\range_display.vpcf", PredictedXYZ(unit, delay)); effect.SetControlPoint(1, new Vector3(unit.HullRadius + 20, 0, 0)); PredictionDrawings.Add(unit.Handle, effect); } effect.SetControlPoint(0, PredictedXYZ(unit, delay)); } }
private void Updater() { if (Bomb == null || !Bomb.IsValid) { UpdateManager.Unsubscribe(Updater); return; } BombPosition = Bomb.Position; if (Active && !effectLocked) { RangEffect?.Dispose(); RangEffect = new ParticleEffect("materials/ensage_ui/particles/range_display_mod.vpcf", Bomb); RangEffect.SetControlPoint(1, new Vector3(Radius, 255, 0)); RangEffect.SetControlPoint(2, new Vector3(255, 255, 255)); effectLocked = true; } }
public static void DrawGreenCircle(Vector3 position, bool force = false) { if (!Menu.DrawMap && !force) { return; } if (greenCirclePartcile == null) { greenCirclePartcile = new ParticleEffect( @"materials\ensage_ui\particles\drag_selected_ring_mod.vpcf", position); greenCirclePartcile.SetControlPoint(1, new Vector3(0, 255, 0)); greenCirclePartcile.SetControlPoint(2, new Vector3(50, 255, 0)); } greenCirclePartcile.SetControlPoint(0, position); }
protected override void OnShow(Node node, Asset asset) { node.SetScale(1f); ParticleEffect particleEffect = ResourceCache.GetParticleEffect(asset.RelativePathToAsset); if (particleEffect == null) { return; } ParticleEmitter particleEmitter = node.CreateComponent <ParticleEmitter>(); particleEmitter.Effect = particleEffect; App.Viewport.SetClearColor(Color.Black); //TODO: remove it and let user to control position by mouse node.RunActions(new RepeatForever(new RotateAroundBy(0.5f, new Vector3(1, 0, 0), 0, 0, 90, TransformSpace.Parent))); }
public static void ShowHeroEffectTest() { if (EffectsTest.ContainsKey(Var.Me)) { return; } List <ParticleEffect> effects = new List <ParticleEffect>(); ParticleEffect rr; //for (int j = 75; j < 100; j++) //{ rr = new ParticleEffect(Particles.Partlist[81], Var.Me.Position + new Vector3(0, 0, 0)); rr.SetControlPoint(1, Var.Me.Position); rr.SetControlPoint(2, Var.Me.Position + new Vector3(300, 0, 0)); effects.Add(rr); //} EffectsTest.Add(Var.Me, effects); }