示例#1
0
        public static void RemoveBomb(Unit _Bomb, BombType _Type)
        {
            switch (_Type)
            {
            case BombType.Stasis:
                StasisBomb stasisBomb = Config._StasisBombs.FirstOrDefault <StasisBomb>((Func <StasisBomb, bool>)(x => (Entity)x._Unit == (Entity)_Bomb));
                if (stasisBomb == null)
                {
                    break;
                }
                if (Config._ParticleManager.HasParticle(stasisBomb._Unit.Handle.ToString()))
                {
                    Config._ParticleManager.Remove(stasisBomb._Unit.Handle.ToString());
                }
                IParticleManager particleManager1 = Config._ParticleManager;
                string           str1             = "st";
                uint             handle           = stasisBomb._Unit.Handle;
                string           str2             = handle.ToString();
                string           name1            = str1 + str2;
                if (particleManager1.HasParticle(name1))
                {
                    IParticleManager particleManager2 = Config._ParticleManager;
                    string           str3             = "st";
                    handle = stasisBomb._Unit.Handle;
                    string str4  = handle.ToString();
                    string name2 = str3 + str4;
                    particleManager2.Remove(name2);
                }
                Config._StasisBombs.Remove(stasisBomb);
                break;

            case BombType.Land:
                LandBomb landBomb = Config._LandBombs.FirstOrDefault <LandBomb>((Func <LandBomb, bool>)(x => (Entity)x._Unit == (Entity)_Bomb));
                if (landBomb == null)
                {
                    break;
                }
                if (Config._ParticleManager.HasParticle(landBomb._Unit.Handle.ToString()))
                {
                    Config._ParticleManager.Remove(landBomb._Unit.Handle.ToString());
                }
                Config._LandBombs.Remove(landBomb);
                BombManager.ReBindLandStacker(_Bomb);
                break;

            case BombType.Remote:
                RemoteBomb remoteBomb = Config._RemoteBombs.FirstOrDefault <RemoteBomb>((Func <RemoteBomb, bool>)(x => (Entity)x._Unit == (Entity)_Bomb));
                if (remoteBomb == null)
                {
                    break;
                }
                if (Config._ParticleManager.HasParticle(remoteBomb._Unit.Handle.ToString()))
                {
                    Config._ParticleManager.Remove(remoteBomb._Unit.Handle.ToString());
                }
                Config._RemoteBombs.Remove(remoteBomb);
                BombManager.ReBindStacker(_Bomb);
                break;
            }
        }
示例#2
0
 public static void OnUpdate()
 {
     if (ParticleRemover.ChangedDrawingsVals["LandBombRange"] != Core.Config._Menu.DrawingsMenu.BombsDrawings.LandBombRange)
     {
         ParticleRemover.ChangedDrawingsVals["LandBombRange"] = Core.Config._Menu.DrawingsMenu.BombsDrawings.LandBombRange;
         ParticleRemover.ChangedDrawings["LandBombRange"]     = true;
     }
     if (ParticleRemover.ChangedDrawingsVals["RemoteBombRange"] != Core.Config._Menu.DrawingsMenu.BombsDrawings.RemoteBombRange)
     {
         ParticleRemover.ChangedDrawingsVals["RemoteBombRange"] = Core.Config._Menu.DrawingsMenu.BombsDrawings.RemoteBombRange;
         ParticleRemover.ChangedDrawings["RemoteBombRange"]     = true;
     }
     if (ParticleRemover.ChangedDrawingsVals["StasisBombRange"] != Core.Config._Menu.DrawingsMenu.BombsDrawings.StasisBombRange)
     {
         ParticleRemover.ChangedDrawingsVals["StasisBombRange"] = Core.Config._Menu.DrawingsMenu.BombsDrawings.StasisBombRange;
         ParticleRemover.ChangedDrawings["StasisBombRange"]     = true;
     }
     if (ParticleRemover.ChangedDrawingsVals["StasisBombSubRange"] != Core.Config._Menu.DrawingsMenu.BombsDrawings.StasisBombSubRange)
     {
         ParticleRemover.ChangedDrawingsVals["StasisBombSubRange"] = Core.Config._Menu.DrawingsMenu.BombsDrawings.StasisBombSubRange;
         ParticleRemover.ChangedDrawings["StasisBombSubRange"]     = true;
     }
     if (ParticleRemover.ChangedDrawingsVals["FrocePath"] != Core.Config._Menu.DrawingsMenu.ForceDrawings.FrocePath)
     {
         ParticleRemover.ChangedDrawingsVals["FrocePath"] = Core.Config._Menu.DrawingsMenu.ForceDrawings.FrocePath;
         ParticleRemover.ChangedDrawings["FrocePath"]     = true;
     }
     if (ParticleRemover.ChangedDrawingsVals["FroceRange"] != Core.Config._Menu.DrawingsMenu.ForceDrawings.FroceRange)
     {
         ParticleRemover.ChangedDrawingsVals["FroceRange"] = Core.Config._Menu.DrawingsMenu.ForceDrawings.FroceRange;
         ParticleRemover.ChangedDrawings["FroceRange"]     = true;
     }
     if (ParticleRemover.ChangedDrawings["LandBombRange"])
     {
         if (!ParticleRemover.ChangedDrawingsVals["LandBombRange"])
         {
             foreach (LandBomb landBomb in Core.Config._LandBombs)
             {
                 IParticleManager particleManager1 = Core.Config._ParticleManager;
                 uint             handle           = landBomb._Unit.Handle;
                 string           name1            = handle.ToString();
                 if (particleManager1.HasParticle(name1))
                 {
                     IParticleManager particleManager2 = Core.Config._ParticleManager;
                     handle = landBomb._Unit.Handle;
                     string name2 = handle.ToString();
                     particleManager2.Remove(name2);
                 }
             }
         }
         ParticleRemover.ChangedDrawings["LandBombRange"] = false;
     }
     if (ParticleRemover.ChangedDrawings["RemoteBombRange"])
     {
         if (!ParticleRemover.ChangedDrawingsVals["RemoteBombRange"])
         {
             foreach (RemoteBomb remoteBomb in Core.Config._RemoteBombs)
             {
                 IParticleManager particleManager1 = Core.Config._ParticleManager;
                 uint             handle           = remoteBomb._Unit.Handle;
                 string           name1            = handle.ToString();
                 if (particleManager1.HasParticle(name1))
                 {
                     IParticleManager particleManager2 = Core.Config._ParticleManager;
                     handle = remoteBomb._Unit.Handle;
                     string name2 = handle.ToString();
                     particleManager2.Remove(name2);
                 }
             }
         }
         ParticleRemover.ChangedDrawings["RemoteBombRange"] = false;
     }
     if (ParticleRemover.ChangedDrawings["StasisBombRange"])
     {
         if (!ParticleRemover.ChangedDrawingsVals["StasisBombRange"])
         {
             foreach (StasisBomb stasisBomb in Core.Config._StasisBombs)
             {
                 IParticleManager particleManager1 = Core.Config._ParticleManager;
                 uint             handle           = stasisBomb._Unit.Handle;
                 string           name1            = handle.ToString();
                 if (particleManager1.HasParticle(name1))
                 {
                     IParticleManager particleManager2 = Core.Config._ParticleManager;
                     handle = stasisBomb._Unit.Handle;
                     string name2 = handle.ToString();
                     particleManager2.Remove(name2);
                 }
             }
         }
         ParticleRemover.ChangedDrawings["StasisBombRange"] = false;
     }
     if (ParticleRemover.ChangedDrawings["StasisBombSubRange"])
     {
         if (!ParticleRemover.ChangedDrawingsVals["StasisBombSubRange"])
         {
             foreach (StasisBomb stasisBomb in Core.Config._StasisBombs)
             {
                 IParticleManager particleManager1 = Core.Config._ParticleManager;
                 string           str1             = "st";
                 uint             handle           = stasisBomb._Unit.Handle;
                 string           str2             = handle.ToString();
                 string           name1            = str1 + str2;
                 if (particleManager1.HasParticle(name1))
                 {
                     IParticleManager particleManager2 = Core.Config._ParticleManager;
                     string           str3             = "st";
                     handle = stasisBomb._Unit.Handle;
                     string str4  = handle.ToString();
                     string name2 = str3 + str4;
                     particleManager2.Remove(name2);
                 }
             }
         }
         ParticleRemover.ChangedDrawings["StasisBombSubRange"] = false;
     }
     if (ParticleRemover.ChangedDrawings["FrocePath"])
     {
         if (!ParticleRemover.ChangedDrawingsVals["FrocePath"])
         {
             foreach (Hero hero in EntityManager <Hero> .Entities.Where <Hero>((Func <Hero, bool>)(x =>
             {
                 if (x.Team != Core.Config._Hero.Team)
                 {
                     return(!x.IsIllusion);
                 }
                 return(false);
             })))
             {
                 if (Core.Config._ParticleManager.HasParticle(hero.Name + "force"))
                 {
                     Core.Config._ParticleManager.Remove(hero.Name + "force");
                 }
             }
         }
         ParticleRemover.ChangedDrawings["FrocePath"] = false;
     }
     if (!ParticleRemover.ChangedDrawings["FroceRange"])
     {
         return;
     }
     if (!ParticleRemover.ChangedDrawingsVals["FroceRange"] && Core.Config._ParticleManager.HasParticle("TR_ForceRange"))
     {
         Core.Config._ParticleManager.Remove("TR_ForceRange");
     }
     ParticleRemover.ChangedDrawings["FroceRange"] = false;
 }
示例#3
0
 protected override void OnDeactivate()
 {
     this._MenuManager.Value.DeregisterMenu((object)Core.Config._Menu, true);
     this._Input.MouseClick     -= new EventHandler <MouseEventArgs>(MouseRegionCatch.Input_MouseClick);
     Core.Config._Renderer.Draw -= new EventHandler(Drawings.BombStack.OnDraw);
     Core.Config._Renderer.Draw -= new EventHandler(Drawings.LandStack.OnDraw);
     Core.Config._Renderer.Draw -= new EventHandler(LandTimer.OnDraw);
     Core.Config._Renderer.Draw -= new EventHandler(Info.OnDraw);
     Core.Config._Renderer.Draw -= new EventHandler(Hello.OnDraw);
     UpdateManager.Unsubscribe(new Action(LandRunKillLogic.OnUpdate));
     UpdateManager.Unsubscribe(new Action(BombOnHitLogic.OnUpdate));
     UpdateManager.Unsubscribe(new Action(CreepDetonationLogic.OnUpdate));
     UpdateManager.Unsubscribe(new Action(ForceLogic.OnUpdate));
     UpdateManager.Unsubscribe(new Action(BombOnHitLogic.OnUpdate));
     UpdateManager.Unsubscribe(new Action(ModWatcherLogic.OnUpdate));
     UpdateManager.Unsubscribe(new Action(InvisibleDetonationLogic.OnUpdate));
     UpdateManager.Unsubscribe(new Action(Drawings.BombStack.OnUpdate));
     UpdateManager.Unsubscribe(new Action(Drawings.LandStack.OnUpdate));
     UpdateManager.Unsubscribe(new Action(Bombs.OnUpdate));
     UpdateManager.Unsubscribe(new Action(Force.OnUpdate));
     UpdateManager.Unsubscribe(new Action(EULCombo.OnUpdate));
     UpdateManager.Unsubscribe(new Action(ParticleRemover.OnUpdate));
     UpdateManager.Unsubscribe(new Action(EnemyUpdater.OnUpdate));
     this._InventoryManager.Detach((object)Core.Config._Items);
     Entity.OnAnimationChanged    -= new EntityAnimationChanged(TechiesRage.OnAnimationChanged);
     ObjectManager.OnAddEntity    -= new ObjectManagerAddEntity(BombManager.OnAddEntity);
     ObjectManager.OnRemoveEntity -= new ObjectManagerRemoveEntity(BombManager.OnRemoveEntity);
     Entity.OnInt32PropertyChange -= new EntityInt32PropertyChange(BombManager.OnInt32Change);
     foreach (Models.BombStack bombStack in Core.Config._BombStacks)
     {
         Core.Config._ParticleManager.Remove(bombStack.Id.ToString());
     }
     foreach (Models.LandStack landStack in Core.Config._LandStacks)
     {
         Core.Config._ParticleManager.Remove(landStack.Id.ToString());
     }
     foreach (LandBomb landBomb in Core.Config._LandBombs)
     {
         IParticleManager particleManager1 = Core.Config._ParticleManager;
         uint             handle           = landBomb._Unit.Handle;
         string           name1            = handle.ToString();
         if (particleManager1.HasParticle(name1))
         {
             IParticleManager particleManager2 = Core.Config._ParticleManager;
             handle = landBomb._Unit.Handle;
             string name2 = handle.ToString();
             particleManager2.Remove(name2);
         }
     }
     foreach (RemoteBomb remoteBomb in Core.Config._RemoteBombs)
     {
         IParticleManager particleManager1 = Core.Config._ParticleManager;
         uint             handle           = remoteBomb._Unit.Handle;
         string           name1            = handle.ToString();
         if (particleManager1.HasParticle(name1))
         {
             IParticleManager particleManager2 = Core.Config._ParticleManager;
             handle = remoteBomb._Unit.Handle;
             string name2 = handle.ToString();
             particleManager2.Remove(name2);
         }
     }
     foreach (StasisBomb stasisBomb in Core.Config._StasisBombs)
     {
         IParticleManager particleManager1 = Core.Config._ParticleManager;
         uint             handle           = stasisBomb._Unit.Handle;
         string           name1            = handle.ToString();
         if (particleManager1.HasParticle(name1))
         {
             IParticleManager particleManager2 = Core.Config._ParticleManager;
             handle = stasisBomb._Unit.Handle;
             string name2 = handle.ToString();
             particleManager2.Remove(name2);
         }
         IParticleManager particleManager3 = Core.Config._ParticleManager;
         handle = stasisBomb._Unit.Handle;
         string name3 = handle.ToString();
         if (particleManager3.HasParticle(name3))
         {
             Core.Config._ParticleManager.Remove("st" + (object)stasisBomb._Unit.Handle);
         }
     }
     this._InventoryManager.Detach((object)Core.Config._Items);
 }