protected override bool UnInit()
 {
     base.UnInit();
     Mem.DelListSafe <IReward>(ref this._listRewardModels);
     this._clsBattleResult = null;
     return(true);
 }
 protected override bool Init()
 {
     _clsState         = new StatementMachine();
     _clsBattleResult  = BattleTaskManager.GetBattleManager().GetBattleResult();
     _listRewardModels = _clsBattleResult.GetRewardItems();
     if (_listRewardModels.Count > 0)
     {
         for (int i = 0; i < _listRewardModels.Count; i++)
         {
             if (_listRewardModels[i] is IReward_Ship)
             {
                 _clsState.AddState(_initShipGet, _updateShipGet);
             }
             if (_listRewardModels[i] is IReward_Slotitem)
             {
                 _clsState.AddState(_initSlotItemGet, _updateSlotItemGet);
             }
             if (_listRewardModels[i] is IReward_Useitem)
             {
                 _clsState.AddState(_initUseItemGet, _updateUseItemGet);
             }
         }
     }
     else
     {
         BattleTaskManager.ReqPhase(BattleUtils.NextPhase(BattlePhase.ClearReward));
         ImmediateTermination();
     }
     return(true);
 }
 protected override bool UnInit()
 {
     base.UnInit();
     this._prodVeteransReport = null;
     this._clsBattleResult    = null;
     return(true);
 }
Exemplo n.º 4
0
        public static ProdMapOpen Instantiate(ProdMapOpen prefab, BattleResultModel resultModel, Transform parent, KeyControl keyControl, MapManager mapManager, int nPanelDepth)
        {
            ProdMapOpen prodMapOpen = UnityEngine.Object.Instantiate(prefab);

            prodMapOpen.transform.parent        = parent;
            prodMapOpen.transform.localScale    = Vector3.one;
            prodMapOpen.transform.localPosition = Vector3.zero;
            prodMapOpen._init();
            prodMapOpen._keyControl  = keyControl;
            prodMapOpen._resultModel = resultModel;
            prodMapOpen._openMapIDs  = prodMapOpen._resultModel.NewOpenMapIDs;
            prodMapOpen._isOpenMap   = new bool[prodMapOpen._resultModel.NewOpenMapIDs.Length];
            for (int i = 0; i < prodMapOpen._resultModel.NewOpenMapIDs.Length; i++)
            {
                prodMapOpen._isOpenMap[i] = true;
            }
            for (int j = 0; j < prodMapOpen._resultModel.NewOpenMapIDs.Length; j++)
            {
                if (prodMapOpen._isOpenMap[j])
                {
                    prodMapOpen._isOpenMap[j] = false;
                    prodMapOpen.GetOpenIds(prodMapOpen._resultModel.NewOpenMapIDs[j]);
                    break;
                }
            }
            prodMapOpen.SetMapTexture();
            return(prodMapOpen);
        }
 protected override bool Init()
 {
     this._clsState         = new StatementMachine();
     this._clsBattleResult  = BattleTaskManager.GetBattleManager().GetBattleResult();
     this._listRewardModels = this._clsBattleResult.GetRewardItems();
     if (this._listRewardModels.get_Count() > 0)
     {
         for (int i = 0; i < this._listRewardModels.get_Count(); i++)
         {
             if (this._listRewardModels.get_Item(i) is IReward_Ship)
             {
                 this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this._initShipGet), new StatementMachine.StatementMachineUpdate(this._updateShipGet));
             }
             if (this._listRewardModels.get_Item(i) is IReward_Slotitem)
             {
                 this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this._initSlotItemGet), new StatementMachine.StatementMachineUpdate(this._updateSlotItemGet));
             }
             if (this._listRewardModels.get_Item(i) is IReward_Useitem)
             {
                 this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this._initUseItemGet), new StatementMachine.StatementMachineUpdate(this._updateUseItemGet));
             }
         }
     }
     else
     {
         BattleTaskManager.ReqPhase(BattleUtils.NextPhase(BattlePhase.ClearReward));
         base.ImmediateTermination();
     }
     return(true);
 }
        protected override bool Init()
        {
            BattleTaskManager.GetTorpedoHpGauges().SetDestroy();
            SingletonMonoBehaviour <FadeCamera> .Instance.SetActive(true);

            SingletonMonoBehaviour <FadeCamera> .Instance.FadeOut(0.2f, delegate
            {
                BattleTaskManager.GetBattleCameras().SetFieldCameraEnabled(false);
                KCV.Utils.SoundUtils.StopFadeBGM(0.25f, null);
                ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
                observerAction.Executions();
                BattleTaskManager.DestroyUnneccessaryObject2Result();
                Observable.FromCoroutine(new Func <IEnumerator>(BattleUtils.ClearMemory), false).Subscribe(delegate(Unit _)
                {
                    this._clsBattleResult = BattleTaskManager.GetBattleManager().GetBattleResult();
                    BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
                    cutInEffectCamera.glowEffect.set_enabled(false);
                    cutInEffectCamera.isCulling = true;
                    this._prodVeteransReport    = ProdVeteransReport.Instantiate(BattleTaskManager.GetPrefabFile().prefabProdVeteransReport.GetComponent <ProdVeteransReport>(), cutInEffectCamera.get_transform(), this._clsBattleResult);
                    this._clsState = new StatementMachine();
                    this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitProdVeteransReport), new StatementMachine.StatementMachineUpdate(this.UpdateProdVeteransReport));
                });
            });

            return(true);
        }
Exemplo n.º 7
0
        protected override bool Init()
        {
            BattleTaskManager.GetTorpedoHpGauges().SetDestroy();
            SingletonMonoBehaviour <FadeCamera> .Instance.SetActive(isActive : true);

            SingletonMonoBehaviour <FadeCamera> .Instance.FadeOut(0.2f, delegate
            {
                BattleTaskManager.GetBattleCameras().SetFieldCameraEnabled(isEnabled: false);
                KCV.Utils.SoundUtils.StopFadeBGM(0.25f, null);
                ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
                observerAction.Executions();
                BattleTaskManager.DestroyUnneccessaryObject2Result();
                Observable.FromCoroutine(BattleUtils.ClearMemory).Subscribe(delegate
                {
                    _clsBattleResult = BattleTaskManager.GetBattleManager().GetBattleResult();
                    BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
                    cutInEffectCamera.glowEffect.enabled      = false;
                    cutInEffectCamera.isCulling = true;
                    _prodVeteransReport         = ProdVeteransReport.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdVeteransReport).GetComponent <ProdVeteransReport>(), cutInEffectCamera.transform, _clsBattleResult);
                    _clsState = new StatementMachine();
                    _clsState.AddState(InitProdVeteransReport, UpdateProdVeteransReport);
                });
            });

            return(true);
        }
Exemplo n.º 8
0
        public override BattleResultModel GetBattleResult()
        {
            BattleResultModel battleResult = base.GetBattleResult();

            DebugBattleMaker.SerializeBattleResult(_cache_result_fmt);
            return(battleResult);
        }
Exemplo n.º 9
0
 public override void Init()
 {
     _clsBattleResult = BattleCutManager.GetBattleManager().GetBattleResult();
     startHP          = GetStartHP(_clsBattleResult);
     isAnimEnd        = false;
     key = new KeyControl();
     SetResultShips();
     _clsMVPShip.Init(_clsBattleResult.MvpShip);
     _clsMVPShip.PlayMVPVoice(BattleUtils.IsPlayMVPVoice(_clsBattleResult.WinRank));
 }
Exemplo n.º 10
0
 public override void Init()
 {
     this._clsBattleResult = BattleCutManager.GetBattleManager().GetBattleResult();
     this.startHP          = this.GetStartHP(this._clsBattleResult);
     this.isAnimEnd        = false;
     this.key = new KeyControl(0, 0, 0.4f, 0.1f);
     this.SetResultShips();
     this._clsMVPShip.Init(this._clsBattleResult.MvpShip);
     this._clsMVPShip.PlayMVPVoice(BattleUtils.IsPlayMVPVoice(this._clsBattleResult.WinRank));
 }
 public override bool Terminate(object data)
 {
     this._clsResult       = null;
     this._prodReceiveShip = null;
     if (this._clsState != null)
     {
         this._clsState.Clear();
     }
     this._clsState = null;
     Mem.DelListSafe <Reward_Ship>(ref this._listRewardShips);
     Mem.DelListSafe <IReward>(ref this._listRewardModels);
     return(false);
 }
 public override bool Terminate(object data)
 {
     _clsResult       = null;
     _prodReceiveShip = null;
     if (_clsState != null)
     {
         _clsState.Clear();
     }
     _clsState = null;
     Mem.DelListSafe(ref _listRewardShips);
     Mem.DelListSafe(ref _listRewardModels);
     return(false);
 }
Exemplo n.º 13
0
 private void OnDestroy()
 {
     Mem.Del <UITexture>(ref this._uiMapImage);
     Mem.Del <UITexture>(ref this._uiMapOld);
     Mem.Del(ref this._uiMapIcon);
     Mem.Del <UITexture>(ref this._uiText);
     Mem.Del(ref this._uiLightPar);
     Mem.Del(ref this._uiBackLightPar);
     Mem.Del <Animation>(ref this._anime);
     Mem.Del <Animation>(ref this._gearAnime);
     Mem.Del <int[]>(ref this._openMapIDs);
     this._keyControl  = null;
     this._resultModel = null;
 }
Exemplo n.º 14
0
 protected override bool Init()
 {
     _clsResultModel = BattleTaskManager.GetBattleManager().GetBattleResult();
     _clsMapManager  = SortieBattleTaskManager.GetMapManager();
     _clsInput       = BattleTaskManager.GetKeyControl();
     _clsState       = new StatementMachine();
     if (BattleTaskManager.GetRootType() == Generics.BattleRootType.Rebellion)
     {
         if (_clsMapManager.IsNextFinal())
         {
             if (_clsResultModel.WinRank == BattleWinRankKinds.B || _clsResultModel.WinRank == BattleWinRankKinds.A || _clsResultModel.WinRank == BattleWinRankKinds.S)
             {
                 _clsState.AddState(_initThalassocracyProd, _updateThalassocracyProd);
             }
             else
             {
                 _clsState.AddState(_initChkNextCell, _updateChkNextCell);
             }
         }
         else
         {
             _clsState.AddState(_initChkNextCell, _updateChkNextCell);
         }
     }
     else if (_clsResultModel.FirstAreaClear && _clsResultModel.FirstClear)
     {
         _clsState.AddState(_initThalassocracyProd, _updateThalassocracyProd);
     }
     else if (!_clsResultModel.FirstAreaClear && _clsResultModel.FirstClear)
     {
         _clsState.AddState(_initMapClearProd, _updateMapClearProd);
     }
     else if (!_clsResultModel.FirstClear && _clsResultModel.NewOpenMapIDs.Length > 0)
     {
         _clsState.AddState(_initMapOpenProd, _updateMapOpenProd);
     }
     else if (_clsResultModel.SPoint > 0)
     {
         _clsState.AddState(_initStrategyPointProd, _updateStrategyPointProd);
     }
     else if (_clsResultModel.GetAreaRewardItems() != null)
     {
         _clsState.AddState(InitShortRewardGet, UpdateShortRewardGet);
     }
     else
     {
         _clsState.AddState(_initChkNextCell, _updateChkNextCell);
     }
     return(true);
 }
Exemplo n.º 15
0
 private new void OnDestroy()
 {
     Mem.Del(ref _uiMapImage);
     Mem.Del(ref _uiMapOld);
     Mem.Del(ref _uiMapIcon);
     Mem.Del(ref _uiText);
     Mem.Del(ref _uiLightPar);
     Mem.Del(ref _uiBackLightPar);
     Mem.Del(ref _anime);
     Mem.Del(ref _gearAnime);
     Mem.Del(ref _openMapIDs);
     _keyControl  = null;
     _resultModel = null;
 }
 public override bool Init(object data)
 {
     _clsState         = new StatementMachine();
     _clsResult        = BattleCutManager.GetBattleManager().GetBattleResult();
     _listRewardModels = new List <IReward>(_clsResult.GetRewardItems());
     if (_listRewardModels.Count > 0)
     {
         _clsState.AddState(InitShipGet, UpdateShipGet);
     }
     else
     {
         BattleCutManager.ReqPhase(BattleCutPhase.MapOpen);
     }
     return(false);
 }
 public override bool Init(object data)
 {
     this._clsState         = new StatementMachine();
     this._clsResult        = BattleCutManager.GetBattleManager().GetBattleResult();
     this._listRewardModels = new List <IReward>(this._clsResult.GetRewardItems());
     if (this._listRewardModels.get_Count() > 0)
     {
         this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitShipGet), new StatementMachine.StatementMachineUpdate(this.UpdateShipGet));
     }
     else
     {
         BattleCutManager.ReqPhase(BattleCutPhase.MapOpen);
     }
     return(false);
 }
Exemplo n.º 18
0
 private int[] GetStartHP(BattleResultModel model)
 {
     int[] array = new int[model.Ships_f.Length];
     for (int i = 0; i < array.Length; i++)
     {
         if (model.Ships_f[i] == null)
         {
             array[i] = 0;
         }
         else
         {
             array[i] = model.Ships_f[i].HpStart;
         }
     }
     return(array);
 }
 public override bool Init(object data)
 {
     _clsResultModel = BattleCutManager.GetBattleManager().GetBattleResult();
     _clsMapManger   = BattleCutManager.GetMapManager();
     _clsInput       = BattleCutManager.GetKeyControl();
     _clsState       = new StatementMachine();
     if (BattleCutManager.GetBattleType() == Generics.BattleRootType.Rebellion)
     {
         if (_clsMapManger.IsNextFinal())
         {
             if (_clsResultModel.WinRank == BattleWinRankKinds.B || _clsResultModel.WinRank == BattleWinRankKinds.A || _clsResultModel.WinRank == BattleWinRankKinds.S)
             {
                 _clsState.AddState(_initThalassocracyProd, _updateThalassocracyProd);
             }
             else
             {
                 ChkNextCell();
             }
         }
         else
         {
             ChkNextCell();
         }
     }
     else if (_clsResultModel.FirstAreaClear && _clsResultModel.FirstClear)
     {
         _clsState.AddState(_initThalassocracyProd, _updateThalassocracyProd);
     }
     else if (!_clsResultModel.FirstAreaClear && _clsResultModel.FirstClear)
     {
         _clsState.AddState(_initMapClearProd, _updateMapClearProd);
     }
     else if (!_clsResultModel.FirstClear && _clsResultModel.NewOpenMapIDs.Length > 0)
     {
         _clsState.AddState(InitMapOpen, UpdateMapOpen);
     }
     else if (_clsResultModel.GetAreaRewardItems() != null)
     {
         _clsState.AddState(InitShortRewardGet, UpdateShortRewardGet);
     }
     else
     {
         ChkNextCell();
     }
     return(false);
 }
Exemplo n.º 20
0
        public HttpResponseMessage battle(WeaponType weaponType, string gameType = "rock-paper-scissors")
        {
            System.Threading.Thread.Sleep(2000);
            var weaponTypeLength = Enum.GetNames(typeof(WeaponType)).Length;

            if ((int)weaponType > weaponTypeLength)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
            var randomWeapon = (WeaponType) new Random().Next(weaponTypeLength);
            var firstPlayer  = new Player
            {
                Weapon = new Weapon
                {
                    Type   = weaponType,
                    Damage = 1
                },
                Name     = "Visitor",
                Strength = 1
            };
            var secondPlayer = new Player
            {
                Weapon = new Weapon
                {
                    Type   = randomWeapon,
                    Damage = 1
                },
                Name     = "Chuck Norris",
                Strength = 1
            };

            try
            {
                var resultModel = new BattleResultModel()
                {
                    Result       = new BattleRoom(gameType).Battle(firstPlayer, secondPlayer),
                    EnemeyWeapon = randomWeapon
                };
                return(Request.CreateResponse(HttpStatusCode.OK, resultModel));
            }
            catch
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
        }
Exemplo n.º 21
0
        public HttpResponseMessage battle(WeaponType weaponType, string playerName, string gameType = "rock-paper-scissors")
        {
            var weaponTypeLength = Enum.GetNames(typeof(WeaponType)).Length;

            if ((int)weaponType > weaponTypeLength)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
            var randomGenerator = new Random();
            var randomWeapon    = (WeaponType)randomGenerator.Next(weaponTypeLength);
            var firstPlayer     = new Player
            {
                Weapon = new Weapon
                {
                    Type   = weaponType,
                    Damage = randomGenerator.Next(5) + 1
                },
                Name     = string.IsNullOrEmpty(playerName) ? "John Doe" : playerName,
                Strength = randomGenerator.Next(5) + 5
            };
            var secondPlayer = new Player
            {
                Weapon = new Weapon
                {
                    Type   = randomWeapon,
                    Damage = randomGenerator.Next(5) + 1
                },
                Name     = "AI Bot",
                Strength = randomGenerator.Next(5) + 5
            };

            try
            {
                var resultModel = new BattleResultModel()
                {
                    Result       = new BattleRoom(gameType).Battle(firstPlayer, secondPlayer, true),
                    EnemeyWeapon = randomWeapon
                };
                return(Request.CreateResponse(HttpStatusCode.OK, resultModel));
            }
            catch
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }
        }
Exemplo n.º 22
0
 private bool Init(BattleResultModel model, bool isBattleCut)
 {
     this._clsResult              = model;
     this._isBattleCut            = isBattleCut;
     this.winRank                 = model.WinRank;
     this._nFriendFleetStartHP    = -1;
     this._nFriendFleetEndHP      = -1;
     this._uiCongratulation.alpha = 0f;
     this.InitHPGauge(this._listHPGauges.get_Item(0), new List <ShipModel_BattleResult>(this._clsResult.Ships_f));
     this.InitHPGauge(this._listHPGauges.get_Item(1), new List <ShipModel_BattleResult>(this._clsResult.Ships_e));
     this._listHPGauges.ForEach(delegate(BtlCut_UICircleHPGauge x)
     {
         x.panel.alpha = 0f;
         x.get_transform().localScaleOne();
     });
     this._uiJudgeLabel.text = ((this._clsResult.WinRank != BattleWinRankKinds.S) ? BattleDefines.RESULT_WINRUNK_JUDGE_TEXT.get_Item((int)this._iWinRank) : BattleDefines.RESULT_WINRUNK_JUDGE_TEXT.get_Item((int)(this._iWinRank + ((!this.isPerfect) ? 0 : 1))));
     this._uiBackground.Init();
     return(true);
 }
Exemplo n.º 23
0
 private bool Init(BattleResultModel model, bool isBattleCut)
 {
     _clsResult              = model;
     _isBattleCut            = isBattleCut;
     winRank                 = model.WinRank;
     _nFriendFleetStartHP    = -1;
     _nFriendFleetEndHP      = -1;
     _uiCongratulation.alpha = 0f;
     InitHPGauge(_listHPGauges[0], new List <ShipModel_BattleResult>(_clsResult.Ships_f));
     InitHPGauge(_listHPGauges[1], new List <ShipModel_BattleResult>(_clsResult.Ships_e));
     _listHPGauges.ForEach(delegate(BtlCut_UICircleHPGauge x)
     {
         x.panel.alpha = 0f;
         x.transform.localScaleOne();
     });
     _uiJudgeLabel.text = ((_clsResult.WinRank != BattleWinRankKinds.S) ? BattleDefines.RESULT_WINRUNK_JUDGE_TEXT[(int)_iWinRank] : BattleDefines.RESULT_WINRUNK_JUDGE_TEXT[(int)(_iWinRank + (isPerfect ? 1 : 0))]);
     _uiBackground.Init();
     return(true);
 }
        public override BattleResultModel GetBattleResult()
        {
            if (this._cache_result != null)
            {
                return(this._cache_result);
            }
            Dictionary <int, int> exp_rates_before = new Dictionary <int, int>();
            DeckModel             deck             = base.UserInfo.GetDeck(base.DeckId);

            deck.__CreateShipExpRatesDictionary__(ref exp_rates_before);
            deck = base.UserInfo.GetDeck(base.EnemyDeckId);
            deck.__CreateShipExpRatesDictionary__(ref exp_rates_before);
            BattleResultFmt battleResultFmt = this._GetBattleResult();

            if (battleResultFmt == null)
            {
                return(null);
            }
            this._cache_result = new BattleResultModel(base.DeckId, base.EnemyDeckId, this, battleResultFmt, this._ships_f, this._ships_e, exp_rates_before);
            return(this._cache_result);
        }
Exemplo n.º 25
0
        public override BattleResultModel GetBattleResult()
        {
            if (_cache_result != null)
            {
                return(_cache_result);
            }
            Dictionary <int, int> dic  = new Dictionary <int, int>();
            DeckModel             deck = base.UserInfo.GetDeck(base.DeckId);

            deck.__CreateShipExpRatesDictionary__(ref dic);
            deck = base.UserInfo.GetDeck(base.EnemyDeckId);
            deck.__CreateShipExpRatesDictionary__(ref dic);
            BattleResultFmt battleResultFmt = _GetBattleResult();

            if (battleResultFmt == null)
            {
                return(null);
            }
            _cache_result = new BattleResultModel(base.DeckId, base.EnemyDeckId, this, battleResultFmt, _ships_f, _ships_e, dic);
            return(_cache_result);
        }
Exemplo n.º 26
0
        public static Hashtable GetRetentionDataMapOpen(MapManager manager, BattleResultModel model)
        {
            Hashtable hashtable = new Hashtable();

            if (manager is SortieMapManager)
            {
                SortieMapManager value = manager as SortieMapManager;
                hashtable.Add("sortieMapManager", value);
                hashtable.Add("newOpenAreaIDs", model.NewOpenAreaIDs);
                hashtable.Add("newOpenMapIDs", model.NewOpenMapIDs);
                hashtable.Add("rootType", 1);
            }
            else if (manager is RebellionMapManager)
            {
                RebellionMapManager value2 = manager as RebellionMapManager;
                hashtable.Add("rebellionMapManager", value2);
                hashtable.Add("newOpenAreaIDs", model.NewOpenAreaIDs);
                hashtable.Add("newOpenMapIDs", model.NewOpenMapIDs);
                hashtable.Add("rootType", 2);
            }
            return(hashtable);
        }
        private void testShipView()
        {
            BattleResultModel battleResult = BattleTaskManager.GetBattleManager().GetBattleResult();

            ShipModel_BattleAll[] ships_f = BattleTaskManager.GetBattleManager().Ships_f;
            int arg_35_0 = (battleResult.MvpShip.MstId != ships_f[0].MstId) ? 2 : 1;

            if (Mst_DataManager.Instance.Mst_shipgraph.ContainsKey(this.index))
            {
                this._uiShip[0].SetActive(true);
                this._uiShip[0].mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(this.index, this._isDebugDamage);
                this._uiShip[0].MakePixelPerfect();
                this._uiShip[0].get_transform().set_localPosition(Util.Poi2Vec(new ShipOffset(this.index).GetShipDisplayCenter(this._isDebugDamage)));
                for (int i = 1; i < 6; i++)
                {
                    ShipModelMst shipModelMst = new ShipModelMst(1);
                    this._uiShip[i].SetActive(true);
                    this._uiShip[i].mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(this.index, this._isDebugDamage);
                    this._uiShip[i].MakePixelPerfect();
                    this._uiShip[i].get_transform().set_localPosition(Util.Poi2Vec(new ShipOffset(this.index).GetFace(this._isDebugDamage)));
                }
            }
        }
Exemplo n.º 28
0
        public override BattleResultModel GetBattleResult()
        {
            if (this._cache_result != null)
            {
                return(this._cache_result);
            }
            DeckModel             deck             = base.UserInfo.GetDeck(base.DeckId);
            Dictionary <int, int> exp_rates_before = new Dictionary <int, int>();

            deck.__CreateShipExpRatesDictionary__(ref exp_rates_before);
            BattleResultFmt battleResultFmt = this._GetBattleResult();

            if (battleResultFmt == null)
            {
                return(null);
            }
            this._cache_result = new BattleResultModel(base.DeckId, this, battleResultFmt, this._ships_f, this._ships_e, this._map, exp_rates_before);
            if (this._cache_result.WinRank == BattleWinRankKinds.S)
            {
                Comm_UserDatas.Instance.User_trophy.Win_S_count++;
            }
            List <int> reOpenMapIDs = this._cache_result.ReOpenMapIDs;

            if (reOpenMapIDs != null && reOpenMapIDs.get_Count() > 0)
            {
                for (int i = 0; i < reOpenMapIDs.get_Count(); i++)
                {
                    int num  = (int)Math.Floor((double)reOpenMapIDs.get_Item(i) / 10.0);
                    int num2 = reOpenMapIDs.get_Item(i) % 10;
                    if (base.Map.AreaId != num && num2 == 1)
                    {
                        TrophyUtil.__tmp_area_reopen__ = true;
                    }
                }
            }
            return(this._cache_result);
        }
        public static UIVeteransReportBonus Instantiate(UIVeteransReportBonus prefab, Transform parent, Vector3 pos, BattleResultModel model, bool isPractice)
        {
            UIVeteransReportBonus uIVeteransReportBonus = Object.Instantiate <UIVeteransReportBonus>(prefab);

            uIVeteransReportBonus.get_transform().set_parent(parent);
            uIVeteransReportBonus.get_transform().set_localPosition(pos);
            uIVeteransReportBonus.get_transform().localScaleOne();
            uIVeteransReportBonus._clsResultModel            = model;
            uIVeteransReportBonus._uiBaseEXPLabel.spriteName = ((!isPractice) ? "exp_txt2" : "exp_txt3");
            uIVeteransReportBonus.Init();
            return(uIVeteransReportBonus);
        }
Exemplo n.º 30
0
        static void Main(string[] args)
        {
            AppInitializeManager.Awake();
            App.InitSystems(); // 26 fuso

            // var bgm = Mst_DataManager.Instance.GetMstBgm();
            // var cabinet = Mst_DataManager.Instance.GetMstCabinet();
            // var payitem = Mst_DataManager.Instance.GetPayitem();
            // var furnitureText = Mst_DataManager.Instance.GetFurnitureText();


            Debug_Mod  debug_Mod = new Debug_Mod();
            List <int> list      = new List <int>();

            Debug.Log("ADD SHIP");
            debug_Mod.Add_Ship(list);
            list.Add(330); // Akizuki Kai
            list.Add(24);  // Ooi
            list.Add(175); // Z3
            list.Add(117); // Zuihou Kai
            list.Add(75);  // Hiyou
            list.Add(321); // Ooyodo Kai
            list.Add(182); // Akashi
            for (int i = 100; i < 110; i++)
            {
                // 100 Tama
                // 101 Kiso
                // 102 Chitose
                // 103 Chiyoda
                // 104 Chitose Kai
                // 105 Chiyoda Kai
                // 106 Chitose A
                // 107 Chiyoda A
                // 108 Chitose-Kou
                // 109 Chiyoda-Kou
                list.Add(i);
            }
            debug_Mod.Add_Ship(list);

            var userData = Comm_UserDatas.Instance;



            // var ui = (new LocalManager()).UserInfo;
            // LocalManager localManager = new LocalManager();

            OrganizeManager organizeManager = new OrganizeManager(1);

            debug_Mod.Add_Deck(2);
            debug_Mod.Add_Deck(3);
            debug_Mod.Add_Deck(4);
            debug_Mod.Add_Deck(5);
            debug_Mod.Add_Deck(6);


            ManagerBase.initialize();
            organizeManager.ChangeOrganize(1, 2, 2);
            organizeManager.ChangeOrganize(1, 3, 3);

            Dictionary <int, int> dictionary = new Dictionary <int, int>();

            for (int j = 0; j < 100; j++)
            {
                if ((1 <= j && j <= 3) || (10 <= j && j <= 12) || (49 <= j && j <= 59))
                {
                    dictionary[j] = 1;
                }
                dictionary[54] = 0;
                dictionary[59] = 10;
            }
            debug_Mod.Add_UseItem(dictionary);



            debug_Mod.Add_Materials(enumMaterialCategory.Fuel, 2000);
            debug_Mod.Add_Materials(enumMaterialCategory.Bull, 2000);
            debug_Mod.Add_Materials(enumMaterialCategory.Steel, 2000);
            debug_Mod.Add_Materials(enumMaterialCategory.Bauxite, 2000);
            debug_Mod.Add_Materials(enumMaterialCategory.Repair_Kit, 2000);
            debug_Mod.Add_Materials(enumMaterialCategory.Dev_Kit, 2000);
            debug_Mod.Add_Materials(enumMaterialCategory.Revamp_Kit, 2000);
            debug_Mod.Add_Materials(enumMaterialCategory.Build_Kit, 2000);
            debug_Mod.Add_Coin(80000);
            List <int> list2 = new List <int>();

            list2.Add(1);
            list2.Add(1);
            list2.Add(1);
            list2.Add(1);
            list2.Add(1);
            list2.Add(1);
            for (int k = 0; k < 30; k++)
            {
                list2.Add(14);
            }
            for (int l = 1; l < 100; l++)
            {
                list2.Add(l);
            }
            for (int m = 0; m < 30; m++)
            {
                list2.Add(25);
            }
            for (int n = 0; n < 6; n++)
            {
                list2.Add(42);
            }
            for (int num = 1; num < 100; num++)
            {
                Debug_Mod.ChangeSlotLevel(list2[num], 9);
            }
            debug_Mod.Add_SlotItem(list2);
            DebugUtils.SLog("DEBUG_MOD OK");


            StrategyTopTaskManager top = new StrategyTopTaskManager();
            // top.Awake2();

            StrategyMapManager strategyMapManager = new StrategyMapManager();
            SortieManager      sortieManager      = strategyMapManager.SelectArea(1);
            SortieMapManager   sortieMapManager   = sortieManager.GoSortie(1, 11);

            SortieBattleManager sortieBattleManager = sortieMapManager.BattleStart(BattleFormationKinds1.TanJuu);
            BattleResultModel   battleResultModel   = sortieBattleManager.GetBattleResult();


            //SortieMapManager _clsSortieMapManager = sortieManager.GoSortie(1, 11);
            //SortieMapManager _clsSortieMapManager = sortieManager.GoSortie(1, 14);
            //SortieBattleManager _clsSortieBattleManager = _clsSortieMapManager.BattleStart(BattleFormationKinds1.TanJuu);
            // var a = KCV.BattleCut.BattleCutPhase.Command;
            // CommandPhaseModel _clscommandPhaseModel = _clsSortieBattleManager.GetCommandPhaseModel();
            // var a = Server_Controllers.BattleLogic.ExecBattleKinds.DayToNight;
            // _clsSortieBattleManager.StartDayToNightBattle();
            //BattleResultModel res = _clsSortieBattleManager.GetBattleResult();

            Console.WriteLine("hajimarimasu");
        }