Beispiel #1
0
        public static List <IAssetVO> GetBattleProjectileAssets(Map map, BattleTypeVO battle, BattleDeploymentData defensiveWaveData, List <string> attackerWarBuffs, List <string> defenderWarBuffs, Dictionary <string, int> defenderSquadTroops, Dictionary <string, int> defenderChampions, List <string> attackerEquipment, List <string> defenderEquipment)
        {
            IDataController dc   = Service.Get <IDataController>();
            List <IAssetVO> list = new List <IAssetVO>();

            if (battle == null || !battle.OverridePlayerUnits)
            {
                Inventory inventory = Service.Get <CurrentPlayer>().Inventory;
                ProjectileUtils.AddTroopProjectileAssets(inventory.Troop, list, dc);
                ProjectileUtils.AddSpecialAttackProjectileAssets(inventory.SpecialAttack, list, dc);
                ProjectileUtils.AddTroopProjectileAssets(inventory.Hero, list, dc);
                ProjectileUtils.AddTroopProjectileAssets(inventory.Champion, list, dc);
            }
            List <SquadDonatedTroop> troops = Service.Get <SquadController>().StateManager.Troops;

            if (troops != null)
            {
                int i     = 0;
                int count = troops.Count;
                while (i < count)
                {
                    ProjectileUtils.AddTroopProjectileAssets(troops[i].TroopUid, list, dc);
                    i++;
                }
            }
            ProjectileUtils.AddTroopProjectileAssets(defenderSquadTroops, list, dc);
            ProjectileUtils.AddTroopProjectileAssets(defenderChampions, list, dc);
            ProjectileUtils.AddBattleProjectileAssets(map, battle, defensiveWaveData, attackerWarBuffs, defenderWarBuffs, attackerEquipment, defenderEquipment, list, dc);
            return(list);
        }
Beispiel #2
0
        private static void AddBuildingProjectileAssets(Map map, List <IAssetVO> assets, IDataController dc)
        {
            int i     = 0;
            int count = map.Buildings.Count;

            while (i < count)
            {
                BuildingTypeVO buildingTypeVO = dc.Get <BuildingTypeVO>(map.Buildings[i].Uid);
                if (!string.IsNullOrEmpty(buildingTypeVO.TurretUid))
                {
                    TurretTypeVO turretTypeVO = dc.Get <TurretTypeVO>(buildingTypeVO.TurretUid);
                    ProjectileUtils.AddProjectileAssets(turretTypeVO.ProjectileType, assets, dc);
                }
                if (buildingTypeVO.TrapUid != null)
                {
                    TrapTypeVO trapTypeVO = dc.Get <TrapTypeVO>(buildingTypeVO.TrapUid);
                    if (trapTypeVO.TurretTED != null && !string.IsNullOrEmpty(trapTypeVO.TurretTED.TurretUid))
                    {
                        TurretTypeVO turretTypeVO2 = dc.Get <TurretTypeVO>(trapTypeVO.TurretTED.TurretUid);
                        ProjectileUtils.AddProjectileAssets(turretTypeVO2.ProjectileType, assets, dc);
                    }
                    if (trapTypeVO.ShipTED != null && !string.IsNullOrEmpty(trapTypeVO.ShipTED.SpecialAttackName))
                    {
                        ProjectileUtils.AddSpecialAttackProjectileAssets(trapTypeVO.ShipTED.SpecialAttackName, assets, dc);
                    }
                }
                i++;
            }
        }
Beispiel #3
0
        public static List <IAssetVO> GetBattleRecordProjectileAssets(Map map, BattleRecord battleRecord, List <string> attackerWarBuffs, List <string> defenderWarBuffs, List <string> attackerEquipment, List <string> defenderEquipment)
        {
            IDataController      dc   = Service.Get <IDataController>();
            List <IAssetVO>      list = new List <IAssetVO>();
            BattleDeploymentData attackerDeploymentData = battleRecord.AttackerDeploymentData;

            if (attackerDeploymentData != null)
            {
                ProjectileUtils.AddTroopProjectileAssets(attackerDeploymentData.TroopData, list, dc);
                ProjectileUtils.AddSpecialAttackProjectileAssets(attackerDeploymentData.SpecialAttackData, list, dc);
                ProjectileUtils.AddTroopProjectileAssets(attackerDeploymentData.HeroData, list, dc);
                ProjectileUtils.AddTroopProjectileAssets(attackerDeploymentData.ChampionData, list, dc);
            }
            BattleDeploymentData defenderDeploymentData = battleRecord.DefenderDeploymentData;

            if (defenderDeploymentData != null)
            {
                ProjectileUtils.AddTroopProjectileAssets(defenderDeploymentData.TroopData, list, dc);
                ProjectileUtils.AddSpecialAttackProjectileAssets(defenderDeploymentData.SpecialAttackData, list, dc);
                ProjectileUtils.AddTroopProjectileAssets(defenderDeploymentData.HeroData, list, dc);
                ProjectileUtils.AddTroopProjectileAssets(defenderDeploymentData.ChampionData, list, dc);
            }
            Dictionary <string, int> attackerGuildTroops = battleRecord.AttackerGuildTroops;

            ProjectileUtils.AddTroopProjectileAssets(attackerGuildTroops, list, dc);
            Dictionary <string, int> defenderGuildTroops = battleRecord.DefenderGuildTroops;

            ProjectileUtils.AddTroopProjectileAssets(defenderGuildTroops, list, dc);
            Dictionary <string, int> defenderChampions = battleRecord.DefenderChampions;

            ProjectileUtils.AddTroopProjectileAssets(defenderChampions, list, dc);
            ProjectileUtils.AddBattleProjectileAssets(map, null, null, attackerWarBuffs, defenderWarBuffs, attackerEquipment, defenderEquipment, list, dc);
            return(list);
        }
Beispiel #4
0
 private static void AddEquipmentAssets(List <string> equipment, List <IAssetVO> assets, IDataController dc)
 {
     if (equipment != null)
     {
         int i     = 0;
         int count = equipment.Count;
         while (i < count)
         {
             EquipmentVO equipmentVO = dc.Get <EquipmentVO>(equipment[i]);
             string[]    effectUids  = equipmentVO.EffectUids;
             if (effectUids != null)
             {
                 int j   = 0;
                 int num = effectUids.Length;
                 while (j < num)
                 {
                     EquipmentEffectVO equipmentEffectVO = dc.Get <EquipmentEffectVO>(effectUids[j]);
                     string[]          buffUids          = equipmentEffectVO.BuffUids;
                     if (buffUids != null)
                     {
                         int k    = 0;
                         int num2 = buffUids.Length;
                         while (k < num2)
                         {
                             ProjectileUtils.AddBuffProjectileAssets(buffUids[k], assets, dc);
                             k++;
                         }
                     }
                     j++;
                 }
             }
             i++;
         }
     }
 }
Beispiel #5
0
 public static void AddProjectileAssets(ProjectileTypeVO ptVO, List <IAssetVO> assets, IDataController dc)
 {
     if (ptVO != null)
     {
         assets.Add(ptVO);
         ProjectileUtils.AddBuffProjectileAssets(ptVO.ApplyBuffs, assets, dc);
     }
 }
Beispiel #6
0
        private static void AddSpecialAttackProjectileAssets(InventoryStorage storage, List <IAssetVO> assets, IDataController dc)
        {
            Dictionary <string, InventoryEntry> internalStorage = storage.GetInternalStorage();

            foreach (KeyValuePair <string, InventoryEntry> current in internalStorage)
            {
                ProjectileUtils.AddSpecialAttackProjectileAssets(current.get_Key(), assets, dc);
            }
        }
Beispiel #7
0
        private static void AddSpecialAttackProjectileAssets(string specialAttackUid, List <IAssetVO> assets, IDataController dc)
        {
            SpecialAttackTypeVO specialAttackTypeVO = dc.Get <SpecialAttackTypeVO>(specialAttackUid);

            ProjectileUtils.AddProjectileAssets(specialAttackTypeVO.ProjectileType, assets, dc);
            if (!string.IsNullOrEmpty(specialAttackTypeVO.LinkedUnit))
            {
                ProjectileUtils.AddTroopProjectileAssets(specialAttackTypeVO.LinkedUnit, assets, dc);
            }
        }
Beispiel #8
0
 private static void AddSpecialAttackProjectileAssets(Dictionary <string, int> specialAttacks, List <IAssetVO> assets, IDataController dc)
 {
     if (specialAttacks != null)
     {
         foreach (KeyValuePair <string, int> current in specialAttacks)
         {
             ProjectileUtils.AddSpecialAttackProjectileAssets(current.get_Key(), assets, dc);
         }
     }
 }
Beispiel #9
0
 private static void AddTroopProjectileAssets(Dictionary <string, int> troops, List <IAssetVO> assets, IDataController dc)
 {
     if (troops != null)
     {
         foreach (KeyValuePair <string, int> current in troops)
         {
             ProjectileUtils.AddTroopProjectileAssets(current.get_Key(), assets, dc);
         }
     }
 }
Beispiel #10
0
 private static void AddBuffProjectileAssets(string[] buffUids, List <IAssetVO> assets, IDataController dc)
 {
     if (buffUids != null)
     {
         int i   = 0;
         int num = buffUids.Length;
         while (i < num)
         {
             ProjectileUtils.AddBuffProjectileAssets(buffUids[i], assets, dc);
             i++;
         }
     }
 }
Beispiel #11
0
 private static void AddBattleProjectileAssets(Map map, BattleTypeVO battle, BattleDeploymentData defensiveWaveData, List <string> attackerWarBuffs, List <string> defenderWarBuffs, List <string> attackerEquipment, List <string> defenderEquipment, List <IAssetVO> assets, IDataController dc)
 {
     if (battle != null)
     {
         ProjectileUtils.AddTroopProjectileAssets(battle.TroopData, assets, dc);
         ProjectileUtils.AddSpecialAttackProjectileAssets(battle.SpecialAttackData, assets, dc);
         ProjectileUtils.AddTroopProjectileAssets(battle.HeroData, assets, dc);
         ProjectileUtils.AddTroopProjectileAssets(battle.ChampionData, assets, dc);
         if (!string.IsNullOrEmpty(battle.EncounterProfile))
         {
             EncounterProfileVO optional = dc.GetOptional <EncounterProfileVO>(battle.EncounterProfile);
             if (optional != null && !string.IsNullOrEmpty(optional.GroupString))
             {
                 string[] array = optional.GroupString.Split(new char[]
                 {
                     '|'
                 });
                 int i   = 0;
                 int num = array.Length;
                 while (i < num)
                 {
                     if (!string.IsNullOrEmpty(array[i]))
                     {
                         string[] array2 = array[i].Split(new char[]
                         {
                             ','
                         });
                         if (array2.Length > 2)
                         {
                             ProjectileUtils.AddTroopProjectileAssets(array2[2], assets, dc);
                         }
                     }
                     i++;
                 }
             }
         }
     }
     if (defensiveWaveData != null)
     {
         ProjectileUtils.AddTroopProjectileAssets(defensiveWaveData.TroopData, assets, dc);
         ProjectileUtils.AddSpecialAttackProjectileAssets(defensiveWaveData.SpecialAttackData, assets, dc);
         ProjectileUtils.AddTroopProjectileAssets(defensiveWaveData.HeroData, assets, dc);
         ProjectileUtils.AddTroopProjectileAssets(defensiveWaveData.ChampionData, assets, dc);
         ProjectileUtils.AddTroopProjectileAssets(defensiveWaveData.SquadData, assets, dc);
     }
     ProjectileUtils.AddWarBuffAssets(attackerWarBuffs, assets, dc);
     ProjectileUtils.AddWarBuffAssets(defenderWarBuffs, assets, dc);
     ProjectileUtils.AddEquipmentAssets(attackerEquipment, assets, dc);
     ProjectileUtils.AddEquipmentAssets(defenderEquipment, assets, dc);
     ProjectileUtils.AddBuildingProjectileAssets(map, assets, dc);
 }
Beispiel #12
0
        public static List <string> GetAssetNames(IAssetVO asset)
        {
            List <string> list = new List <string>();

            if (asset is ProjectileTypeVO)
            {
                ProjectileUtils.AddProjectileAssetNames((ProjectileTypeVO)asset, list);
            }
            else if (asset is BuffTypeVO)
            {
                ProjectileUtils.AddBuffProjectileAssetNames((BuffTypeVO)asset, list);
            }
            return(list);
        }
Beispiel #13
0
 private static void AddWarBuffAssets(List <string> warBuffs, List <IAssetVO> assets, IDataController dc)
 {
     if (warBuffs != null)
     {
         int i     = 0;
         int count = warBuffs.Count;
         while (i < count)
         {
             WarBuffVO warBuffVO = dc.Get <WarBuffVO>(warBuffs[i]);
             ProjectileUtils.AddBuffProjectileAssets(warBuffVO.TroopBuffUid, assets, dc);
             ProjectileUtils.AddBuffProjectileAssets(warBuffVO.BuildingBuffUid, assets, dc);
             i++;
         }
     }
 }
Beispiel #14
0
        public static void AddTroopProjectileAssets(string troopUid, List <IAssetVO> assets, IDataController dc)
        {
            TroopTypeVO      troopTypeVO    = dc.Get <TroopTypeVO>(troopUid);
            ProjectileTypeVO projectileType = troopTypeVO.ProjectileType;
            ActiveArmory     activeArmory   = Service.Get <CurrentPlayer>().ActiveArmory;

            if (activeArmory != null)
            {
                SkinTypeVO applicableSkin = Service.Get <SkinController>().GetApplicableSkin(troopTypeVO, activeArmory.Equipment);
                if (applicableSkin != null && applicableSkin.Override != null && applicableSkin.Override.ProjectileType != null)
                {
                    projectileType = applicableSkin.Override.ProjectileType;
                }
            }
            ProjectileUtils.AddProjectileAssets(projectileType, assets, dc);
            ProjectileUtils.AddProjectileAssets(troopTypeVO.DeathProjectileType, assets, dc);
            ProjectileUtils.AddBuffProjectileAssets(troopTypeVO.SpawnApplyBuffs, assets, dc);
            if (!string.IsNullOrEmpty(troopTypeVO.Ability))
            {
                TroopAbilityVO troopAbilityVO = dc.Get <TroopAbilityVO>(troopTypeVO.Ability);
                ProjectileUtils.AddProjectileAssets(troopAbilityVO.ProjectileType, assets, dc);
                ProjectileUtils.AddBuffProjectileAssets(troopAbilityVO.SelfBuff, assets, dc);
            }
        }
Beispiel #15
0
 public unsafe static long $Invoke3(long instance, long *args)
 {
     ProjectileUtils.AddBuffProjectileAssets((string[])GCHandledObjects.GCHandleToPinnedArrayObject(*args), (List <IAssetVO>)GCHandledObjects.GCHandleToObject(args[1]), (IDataController)GCHandledObjects.GCHandleToObject(args[2]));
     return(-1L);
 }
Beispiel #16
0
 public unsafe static long $Invoke18(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ProjectileUtils.GetBattleRecordProjectileAssets((Map)GCHandledObjects.GCHandleToObject(*args), (BattleRecord)GCHandledObjects.GCHandleToObject(args[1]), (List <string>)GCHandledObjects.GCHandleToObject(args[2]), (List <string>)GCHandledObjects.GCHandleToObject(args[3]), (List <string>)GCHandledObjects.GCHandleToObject(args[4]), (List <string>)GCHandledObjects.GCHandleToObject(args[5]))));
 }
Beispiel #17
0
 public unsafe static long $Invoke17(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ProjectileUtils.GetBattleProjectileAssets((Map)GCHandledObjects.GCHandleToObject(*args), (BattleTypeVO)GCHandledObjects.GCHandleToObject(args[1]), (BattleDeploymentData)GCHandledObjects.GCHandleToObject(args[2]), (List <string>)GCHandledObjects.GCHandleToObject(args[3]), (List <string>)GCHandledObjects.GCHandleToObject(args[4]), (Dictionary <string, int>)GCHandledObjects.GCHandleToObject(args[5]), (Dictionary <string, int>)GCHandledObjects.GCHandleToObject(args[6]), (List <string>)GCHandledObjects.GCHandleToObject(args[7]), (List <string>)GCHandledObjects.GCHandleToObject(args[8]))));
 }
Beispiel #18
0
 public unsafe static long $Invoke16(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ProjectileUtils.GetAssetNames((IAssetVO)GCHandledObjects.GCHandleToObject(*args))));
 }
Beispiel #19
0
 public unsafe static long $Invoke15(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ProjectileUtils.AreAllBulletAssetsLoaded((Bullet)GCHandledObjects.GCHandleToObject(*args), (HashSet <IAssetVO>)GCHandledObjects.GCHandleToObject(args[1]))));
 }
Beispiel #20
0
 public unsafe static long $Invoke13(long instance, long *args)
 {
     ProjectileUtils.AddTroopProjectileAssets((Dictionary <string, int>)GCHandledObjects.GCHandleToObject(*args), (List <IAssetVO>)GCHandledObjects.GCHandleToObject(args[1]), (IDataController)GCHandledObjects.GCHandleToObject(args[2]));
     return(-1L);
 }
Beispiel #21
0
 public unsafe static long $Invoke14(long instance, long *args)
 {
     ProjectileUtils.AddWarBuffAssets((List <string>)GCHandledObjects.GCHandleToObject(*args), (List <IAssetVO>)GCHandledObjects.GCHandleToObject(args[1]), (IDataController)GCHandledObjects.GCHandleToObject(args[2]));
     return(-1L);
 }
Beispiel #22
0
 public unsafe static long $Invoke12(long instance, long *args)
 {
     ProjectileUtils.AddTroopProjectileAssets((InventoryStorage)GCHandledObjects.GCHandleToObject(*args), (List <IAssetVO>)GCHandledObjects.GCHandleToObject(args[1]), (IDataController)GCHandledObjects.GCHandleToObject(args[2]));
     return(-1L);
 }
Beispiel #23
0
 public unsafe static long $Invoke11(long instance, long *args)
 {
     ProjectileUtils.AddTroopProjectileAssets(Marshal.PtrToStringUni(*(IntPtr *)args), (List <IAssetVO>)GCHandledObjects.GCHandleToObject(args[1]), (IDataController)GCHandledObjects.GCHandleToObject(args[2]));
     return(-1L);
 }
Beispiel #24
0
 public unsafe static long $Invoke7(long instance, long *args)
 {
     ProjectileUtils.AddProjectileAssets((ProjectileTypeVO)GCHandledObjects.GCHandleToObject(*args), (List <IAssetVO>)GCHandledObjects.GCHandleToObject(args[1]), (IDataController)GCHandledObjects.GCHandleToObject(args[2]));
     return(-1L);
 }
Beispiel #25
0
 public unsafe static long $Invoke6(long instance, long *args)
 {
     ProjectileUtils.AddProjectileAssetNames((ProjectileTypeVO)GCHandledObjects.GCHandleToObject(*args), (List <string>)GCHandledObjects.GCHandleToObject(args[1]));
     return(-1L);
 }
Beispiel #26
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     ProjectileUtils.AddBattleProjectileAssets((Map)GCHandledObjects.GCHandleToObject(*args), (BattleTypeVO)GCHandledObjects.GCHandleToObject(args[1]), (BattleDeploymentData)GCHandledObjects.GCHandleToObject(args[2]), (List <string>)GCHandledObjects.GCHandleToObject(args[3]), (List <string>)GCHandledObjects.GCHandleToObject(args[4]), (List <string>)GCHandledObjects.GCHandleToObject(args[5]), (List <string>)GCHandledObjects.GCHandleToObject(args[6]), (List <IAssetVO>)GCHandledObjects.GCHandleToObject(args[7]), (IDataController)GCHandledObjects.GCHandleToObject(args[8]));
     return(-1L);
 }