Beispiel #1
0
        public static List <BloonToSimulation> GetBloonSims(this BloonModel bloonModel)
        {
            Il2CppSystem.Collections.Generic.List <BloonToSimulation> bloonSims = InGame.instance?.GetUnityToSimulation()?.GetAllBloons();
            if (bloonSims is null || !bloonSims.Any())
            {
                return(null);
            }

            List <BloonToSimulation> results = bloonSims.Where(b => b.GetBaseModel().IsEqual(bloonModel)).ToList();

            return(results);
        }
        /// <summary>
        /// Get the all AbilityToSimulation with this AbilityModel
        /// </summary>
        /// <param name="abiltyModel"></param>
        /// <returns></returns>
        public static List <AbilityToSimulation> GetAbilitySims(this AbilityModel abiltyModel)
        {
            Il2CppSystem.Collections.Generic.List <AbilityToSimulation> abilitySims = InGame.instance?.bridge?.GetAllAbilities(true);
            if (abilitySims is null || !abilitySims.Any())
            {
                return(null);
            }

            List <AbilityToSimulation> results = abilitySims.Where(ability => ability.ability.abilityModel.IsEqual(abiltyModel)).ToSystemList();

            return(results);
        }
Beispiel #3
0
        /// <summary>
        /// Get all TowerToSimulations with this TowerModel
        /// </summary>
        public static List <TowerToSimulation> GetTowerSims(this TowerModel towerModel)
        {
            Il2CppSystem.Collections.Generic.List <TowerToSimulation> towers = InGame.instance?.bridge?.GetAllTowers();
            if (towers is null || !towers.Any())
            {
                return(null);
            }

            List <TowerToSimulation> desiredTowers = towers.Where(towerSim => towerSim.tower.towerModel.name == towerModel.name).ToSystemList();

            return(desiredTowers);
        }
        /// <summary>
        /// Get all Projectile Simulations that have this ProjectileModel
        /// </summary>
        public static List <Projectile> GetProjectileSims(this ProjectileModel projectileModel)
        {
            Il2CppSystem.Collections.Generic.List <Projectile> projectileSims =
                InGame.instance?.bridge?.GetAllProjectiles();
            if (projectileSims is null || !projectileSims.Any())
            {
                return(null);
            }

            List <Projectile> results = projectileSims
                                        .Where(projectile => projectile.projectileModel.name == projectileModel.name).ToSystemList();

            return(results);
        }
 /// <summary>
 /// Get all ShopTowerDetailModels
 /// </summary>
 public static Il2CppSystem.Collections.Generic.List <ShopTowerDetailsModel> GetAllShopTowerDetails(this GameModel model)
 {
     Il2CppSystem.Collections.Generic.List <TowerDetailsModel> towerDetails = model.GetAllTowerDetails();
     Il2CppSystem.Collections.Generic.List <TowerDetailsModel> results      = towerDetails.Where(detail => detail.GetShopTowerDetails() != null);
     return(results.DuplicateAs <TowerDetailsModel, ShopTowerDetailsModel>());
 }
Beispiel #6
0
 internal static void Postfix(ref Il2CppSystem.Collections.Generic.List <AbilityToSimulation> __result)
 {
     __result = __result.Where(a2s =>
                               !(Main.CurrentTowerIDs.Contains(a2s.Tower.Id) && a2s.model.displayName == "Overclock" || a2s.model.displayName == "Ultraboost"));
 }