private Dictionary <int, DamageModelBase> _CreateRaigekiDamageModel(List <ShipModel_BattleAll> a_ships, List <ShipModel_BattleAll> d_ships, List <DamageModelBase> data, RaigekiInfo rInfo)
        {
            Dictionary <int, DamageModelBase> dictionary = new Dictionary <int, DamageModelBase>();

            for (int i = 0; i < d_ships.get_Count(); i++)
            {
                ShipModel_BattleAll shipModel_BattleAll = d_ships.get_Item(i);
                if (shipModel_BattleAll != null)
                {
                    data.Add(new RaigekiDamageModel(shipModel_BattleAll));
                }
                else
                {
                    data.Add(null);
                }
            }
            for (int j = 0; j < rInfo.Target.Length; j++)
            {
                int num = rInfo.Target[j];
                if (num != -1)
                {
                    ShipModel_BattleAll shipModel_BattleAll2 = a_ships.get_Item(j);
                    DamageModelBase     damageModelBase      = data.get_Item(num);
                    if (damageModelBase == null)
                    {
                        ShipModel_BattleAll defender = d_ships.get_Item(num);
                        damageModelBase = new RaigekiDamageModel(defender);
                        data.set_Item(num, damageModelBase);
                    }
                    ((RaigekiDamageModel)damageModelBase).__AddData__(shipModel_BattleAll2, rInfo.Damage[j], rInfo.Clitical[j], rInfo.DamageKind[j]);
                    dictionary.set_Item(shipModel_BattleAll2.TmpId, damageModelBase);
                }
            }
            return(dictionary);
        }
예제 #2
0
        public override string ToString()
        {
            string text = string.Empty;
            List <ShipModel_Defender> defenders = GetDefenders(is_friend: true, all: true);

            for (int i = 0; i < defenders.Count; i++)
            {
                ShipModel_Battle shipModel_Battle = defenders[i];
                if (shipModel_Battle != null)
                {
                    ShipModel_Defender attackTo = GetAttackTo(shipModel_Battle.TmpId);
                    if (attackTo != null)
                    {
                        RaigekiDamageModel attackDamage = GetAttackDamage(attackTo.TmpId);
                        text += string.Format("{0}({1}) から {2}({3}) へ雷撃 (ダメ\u30fcジ:{4}(c:{7}) {5}{6})\n", shipModel_Battle.Name, shipModel_Battle.Index, attackTo.Name, attackTo.Index, attackDamage.GetDamage(shipModel_Battle.TmpId), attackDamage.GetHitState(shipModel_Battle.TmpId), (!attackDamage.GetProtectEffect(shipModel_Battle.TmpId)) ? string.Empty : "[かばう]", attackDamage.__GetDamage__(shipModel_Battle.TmpId));
                    }
                }
            }
            defenders = GetDefenders(is_friend: false, all: true);
            for (int j = 0; j < defenders.Count; j++)
            {
                ShipModel_Battle shipModel_Battle2 = defenders[j];
                if (shipModel_Battle2 != null)
                {
                    ShipModel_Defender attackTo2 = GetAttackTo(shipModel_Battle2.TmpId);
                    if (attackTo2 != null)
                    {
                        RaigekiDamageModel attackDamage2 = GetAttackDamage(attackTo2.TmpId);
                        text += string.Format("{0}({1}) から {2}({3}) へ雷撃 (ダメ\u30fcジ:{4}(c:{7}) {5}{6})\n", shipModel_Battle2.Name, shipModel_Battle2.Index, attackTo2.Name, attackTo2.Index, attackDamage2.GetDamage(shipModel_Battle2.TmpId), attackDamage2.GetHitState(shipModel_Battle2.TmpId), (!attackDamage2.GetProtectEffect(shipModel_Battle2.TmpId)) ? string.Empty : "[かばう]", attackDamage2.__GetDamage__(shipModel_Battle2.TmpId));
                    }
                }
            }
            return(text);
        }
예제 #3
0
        public List <ShipModel_Attacker> GetAttackers(bool is_friend)
        {
            List <ShipModel_Attacker> list    = new List <ShipModel_Attacker>();
            HashSet <int>             hashSet = new HashSet <int>();
            List <DamageModelBase>    list2   = (!is_friend) ? _data_f : _data_e;

            for (int i = 0; i < list2.Count; i++)
            {
                RaigekiDamageModel raigekiDamageModel = (RaigekiDamageModel)list2[i];
                if (raigekiDamageModel == null)
                {
                    continue;
                }
                for (int j = 0; j < raigekiDamageModel.Attackers.Count; j++)
                {
                    ShipModel_Attacker shipModel_Attacker = raigekiDamageModel.Attackers[j];
                    if (!hashSet.Contains(shipModel_Attacker.TmpId))
                    {
                        hashSet.Add(shipModel_Attacker.TmpId);
                        list.Add(shipModel_Attacker);
                    }
                }
            }
            return(list);
        }
        public override string ToString()
        {
            string text = string.Empty;
            List <ShipModel_Defender> defenders = this.GetDefenders(true, true);

            for (int i = 0; i < defenders.get_Count(); i++)
            {
                ShipModel_Battle shipModel_Battle = defenders.get_Item(i);
                if (shipModel_Battle != null)
                {
                    ShipModel_Defender attackTo = this.GetAttackTo(shipModel_Battle.TmpId);
                    if (attackTo != null)
                    {
                        RaigekiDamageModel attackDamage = this.GetAttackDamage(attackTo.TmpId);
                        text += string.Format("{0}({1}) から {2}({3}) へ雷撃 (ダメージ:{4}(c:{7}) {5}{6})\n", new object[]
                        {
                            shipModel_Battle.Name,
                            shipModel_Battle.Index,
                            attackTo.Name,
                            attackTo.Index,
                            attackDamage.GetDamage(shipModel_Battle.TmpId),
                            attackDamage.GetHitState(shipModel_Battle.TmpId),
                            (!attackDamage.GetProtectEffect(shipModel_Battle.TmpId)) ? string.Empty : "[かばう]",
                            attackDamage.__GetDamage__(shipModel_Battle.TmpId)
                        });
                    }
                }
            }
            defenders = this.GetDefenders(false, true);
            for (int j = 0; j < defenders.get_Count(); j++)
            {
                ShipModel_Battle shipModel_Battle2 = defenders.get_Item(j);
                if (shipModel_Battle2 != null)
                {
                    ShipModel_Defender attackTo2 = this.GetAttackTo(shipModel_Battle2.TmpId);
                    if (attackTo2 != null)
                    {
                        RaigekiDamageModel attackDamage2 = this.GetAttackDamage(attackTo2.TmpId);
                        text += string.Format("{0}({1}) から {2}({3}) へ雷撃 (ダメージ:{4}(c:{7}) {5}{6})\n", new object[]
                        {
                            shipModel_Battle2.Name,
                            shipModel_Battle2.Index,
                            attackTo2.Name,
                            attackTo2.Index,
                            attackDamage2.GetDamage(shipModel_Battle2.TmpId),
                            attackDamage2.GetHitState(shipModel_Battle2.TmpId),
                            (!attackDamage2.GetProtectEffect(shipModel_Battle2.TmpId)) ? string.Empty : "[かばう]",
                            attackDamage2.__GetDamage__(shipModel_Battle2.TmpId)
                        });
                    }
                }
            }
            return(text);
        }
        public RaigekiDamageModel GetAttackDamage(int defender_tmp_id)
        {
            List <RaigekiDamageModel> list = this._data_f.ConvertAll <RaigekiDamageModel>((DamageModelBase item) => (RaigekiDamageModel)item);
            RaigekiDamageModel        raigekiDamageModel = list.Find((RaigekiDamageModel r) => r != null && r.Defender.TmpId == defender_tmp_id);

            if (raigekiDamageModel != null && raigekiDamageModel.Attackers.get_Count() > 0)
            {
                return(raigekiDamageModel);
            }
            List <RaigekiDamageModel> list2 = this._data_e.ConvertAll <RaigekiDamageModel>((DamageModelBase item) => (RaigekiDamageModel)item);

            raigekiDamageModel = list2.Find((RaigekiDamageModel r) => r != null && r.Defender.TmpId == defender_tmp_id);
            if (raigekiDamageModel != null && raigekiDamageModel.Attackers.get_Count() > 0)
            {
                return(raigekiDamageModel);
            }
            return(null);
        }
        public List <ShipModel_Attacker> GetAttackers(bool is_friend)
        {
            List <ShipModel_Attacker> list    = new List <ShipModel_Attacker>();
            HashSet <int>             hashSet = new HashSet <int>();
            List <DamageModelBase>    list2   = (!is_friend) ? this._data_f : this._data_e;

            for (int i = 0; i < list2.get_Count(); i++)
            {
                RaigekiDamageModel raigekiDamageModel = (RaigekiDamageModel)list2.get_Item(i);
                if (raigekiDamageModel != null)
                {
                    for (int j = 0; j < raigekiDamageModel.Attackers.get_Count(); j++)
                    {
                        ShipModel_Attacker shipModel_Attacker = raigekiDamageModel.Attackers.get_Item(j);
                        if (!hashSet.Contains(shipModel_Attacker.TmpId))
                        {
                            hashSet.Add(shipModel_Attacker.TmpId);
                            list.Add(shipModel_Attacker);
                        }
                    }
                }
            }
            return(list);
        }