Exemplo n.º 1
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);
        }
Exemplo n.º 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++;
            }
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
            }
        }
Exemplo n.º 5
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);
         }
     }
 }
Exemplo n.º 6
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);
 }
Exemplo n.º 7
0
 public unsafe static long $Invoke10(long instance, long *args)
 {
     ProjectileUtils.AddSpecialAttackProjectileAssets(Marshal.PtrToStringUni(*(IntPtr *)args), (List <IAssetVO>)GCHandledObjects.GCHandleToObject(args[1]), (IDataController)GCHandledObjects.GCHandleToObject(args[2]));
     return(-1L);
 }
Exemplo n.º 8
0
 public unsafe static long $Invoke9(long instance, long *args)
 {
     ProjectileUtils.AddSpecialAttackProjectileAssets((Dictionary <string, int>)GCHandledObjects.GCHandleToObject(*args), (List <IAssetVO>)GCHandledObjects.GCHandleToObject(args[1]), (IDataController)GCHandledObjects.GCHandleToObject(args[2]));
     return(-1L);
 }
Exemplo n.º 9
0
 public unsafe static long $Invoke8(long instance, long *args)
 {
     ProjectileUtils.AddSpecialAttackProjectileAssets((InventoryStorage)GCHandledObjects.GCHandleToObject(*args), (List <IAssetVO>)GCHandledObjects.GCHandleToObject(args[1]), (IDataController)GCHandledObjects.GCHandleToObject(args[2]));
     return(-1L);
 }