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); }
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); }
private static void AddTroopProjectileAssets(InventoryStorage storage, List <IAssetVO> assets, IDataController dc) { Dictionary <string, InventoryEntry> internalStorage = storage.GetInternalStorage(); foreach (KeyValuePair <string, InventoryEntry> current in internalStorage) { ProjectileUtils.AddTroopProjectileAssets(current.get_Key(), assets, dc); } }
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); } }
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); } } }
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); }
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); }
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); }
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); }