Exemplo n.º 1
0
        public void DBG_damage()
        {
            if (this._debug_shipping)
            {
                return;
            }
            this._debug_shipping = true;
            UserInfoModel    userInfo  = this.rep.now_clsRepair().UserInfo;
            List <ShipModel> all_ships = userInfo.__GetShipList__();
            List <ShipModel> list      = this.rep.now_clsRepair().GetAreaShips(this.rep.NowArea(), all_ships);

            if (this.rep.NowArea() == 1)
            {
                list.AddRange(this.rep.now_clsRepair().GetDepotShips(all_ships));
            }
            list = DeckUtil.GetSortedList(list, SortKey.DAMAGE);
            using (List <ShipModel> .Enumerator enumerator = list.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ShipModel current = enumerator.get_Current();
                    int       subvalue;
                    switch (this.damage_flag)
                    {
                    case 0:
                        subvalue = (int)Math.Ceiling((double)((float)current.MaxHp * 0.25f));
                        break;

                    case 1:
                        subvalue = (int)Math.Ceiling((double)((float)current.MaxHp * 0.25f));
                        break;

                    case 2:
                        subvalue = current.NowHp - 1;
                        break;

                    case 3:
                        goto IL_F9;

                    default:
                        goto IL_F9;
                    }
IL_115:
                    Debug_Mod.SubHp(current.MemId, subvalue);
                    continue;
IL_F9:
                    subvalue         = current.NowHp - current.MaxHp;
                    this.damage_flag = -1;
                    goto IL_115;
                }
            }
            this.damage_flag++;
            Mem.DelList <ShipModel>(ref all_ships);
            Mem.DelList <ShipModel>(ref list);
            CommonPopupDialog.Instance.StartPopup("DBG: 母港へ行きます。");
            SingletonMonoBehaviour <PortObjectManager> .Instance.BackToActiveScene();

            this._debug_shipping = false;
        }
Exemplo n.º 2
0
        public void DBG_damage()
        {
            if (!_debug_shipping)
            {
                _debug_shipping = true;
                UserInfoModel    userInfo  = rep.now_clsRepair().UserInfo;
                List <ShipModel> p         = userInfo.__GetShipList__();
                List <ShipModel> areaShips = rep.now_clsRepair().GetAreaShips(rep.NowArea(), p);
                if (rep.NowArea() == 1)
                {
                    areaShips.AddRange(rep.now_clsRepair().GetDepotShips(p));
                }
                areaShips = DeckUtil.GetSortedList(areaShips, SortKey.DAMAGE);
                foreach (ShipModel item in areaShips)
                {
                    int subvalue;
                    switch (damage_flag)
                    {
                    case 0:
                        subvalue = (int)Math.Ceiling((float)item.MaxHp * 0.25f);
                        break;

                    case 1:
                        subvalue = (int)Math.Ceiling((float)item.MaxHp * 0.25f);
                        break;

                    case 2:
                        subvalue = item.NowHp - 1;
                        break;

                    default:
                        subvalue    = item.NowHp - item.MaxHp;
                        damage_flag = -1;
                        break;
                    }
                    Debug_Mod.SubHp(item.MemId, subvalue);
                }
                damage_flag++;
                Mem.DelList(ref p);
                Mem.DelList(ref areaShips);
                CommonPopupDialog.Instance.StartPopup("DBG: 母港へ行きます。");
                SingletonMonoBehaviour <PortObjectManager> .Instance.BackToActiveScene();

                _debug_shipping = false;
            }
        }