Ejemplo n.º 1
0
        private void Init(DeckModel model)
        {
            this._clsDeckModel     = model;
            this._isInputPossible  = false;
            this._iSelectFormation = BattleFormationKinds1.TanJuu;
            this.panel.alpha       = 0f;
            this._clsBrightPoints.Init();
            HashSet <BattleFormationKinds1> hash = DeckUtil.GetSelectableFormations(this._clsDeckModel);
            BattleFormationKinds1           cnt  = BattleFormationKinds1.TanJuu;

            this._listLabelButton.ForEach(delegate(UILabelButton x)
            {
                x.Init((int)cnt, hash.Contains(cnt));
                x.isFocus      = false;
                x.toggle.group = 1;
                x.toggle.set_enabled(false);
                x.toggle.onDecide = delegate
                {
                    this.DecideFormation((BattleFormationKinds1)x.index);
                };
                x.toggle.onActive = Util.CreateEventDelegateList(this, "OnActive", cnt);
                if (x.index == 1)
                {
                    x.isFocus = (x.toggle.startsActive = true);
                }
                cnt++;
            });
        }
Ejemplo n.º 2
0
 public AllBattleFmt(BattleFormationKinds1 fFormation, BattleFormationKinds1 eFormation, BattleFormationKinds2 battleFormation)
     : this()
 {
     Formation[0]    = fFormation;
     Formation[1]    = eFormation;
     BattleFormation = battleFormation;
 }
Ejemplo n.º 3
0
 private void CallBackAction(UIBattleFormationSelector calledObject, BattleFormationKinds1 selectedFormation)
 {
     if (mUIBattleFormationSelectorAction != null)
     {
         mUIBattleFormationSelectorAction(this, selectedFormation);
     }
 }
 public void SetFormation(BattleFormationKinds1 iKind, bool isFriend)
 {
     this._uiLabel.mainTexture = Resources.Load <Texture2D>(string.Format("Textures/Battle/Shelling/FormationJudge/txt_{0}", iKind.ToString()));
     this._uiLabel.MakePixelPerfect();
     this._uiGrow.mainTexture = Resources.Load <Texture2D>(string.Format("Textures/Battle/Shelling/FormationJudge/txt_{0}_{1}", iKind.ToString(), (!isFriend) ? "r" : "g"));
     this._uiGrow.MakePixelPerfect();
 }
Ejemplo n.º 5
0
        private void OnFormationSelected(BattleFormationKinds1 iFormation)
        {
            SortieMapTaskManager.GetUIShipCharacter().Hide(null);
            SortieMapTaskManager.GetUIAreaMapFrame().Hide();
            ProdSortieTransitionToBattle prodSortieTransitionToBattle = SortieBattleTaskManager.GetSortieBattlePrefabFile().prodSortieTransitionToBattle;

            SortieBattleTaskManager.GetTransitionCamera().enabled = true;
            prodSortieTransitionToBattle.Play(delegate
            {
                Hashtable hashtable = new Hashtable();
                if (SortieBattleTaskManager.GetMapManager().GetType().Equals(typeof(RebellionMapManager)))
                {
                    hashtable.Add("rootType", Generics.BattleRootType.Rebellion);
                    hashtable.Add("rebellionMapManager", SortieBattleTaskManager.GetMapManager());
                }
                else
                {
                    hashtable.Add("rootType", Generics.BattleRootType.SortieMap);
                    hashtable.Add("sortieMapManager", SortieBattleTaskManager.GetMapManager());
                }
                hashtable.Add("formation", iFormation);
                RetentionData.SetData(hashtable);
                SortieBattleTaskManager.ReqMode(SortieBattleMode.Battle);
            });
        }
Ejemplo n.º 6
0
        private void UIBattleFormationKindSelectManagerActionCallBack(UIBattleFormationKindSelectManager.ActionType actionType, UIBattleFormationKindSelectManager calledObject, UIBattleFormationKind centerView)
        {
            calledObject.OnReleaseKeyController();
            BattleFormationKinds1 iFormation = (actionType != 0) ? BattleFormationKinds1.TanJuu : centerView.Category;

            OnFormationSelected(iFormation);
        }
 public double GetFormationParamF2(FormationDatas.GetFormationKinds kind, BattleFormationKinds1 attacker, BattleFormationKinds1 defencer)
 {
     if (kind == FormationDatas.GetFormationKinds.HOUGEKI)
     {
         if (attacker == BattleFormationKinds1.FukuJuu && defencer == BattleFormationKinds1.TanOu)
         {
             return(1.2);
         }
         if (attacker == BattleFormationKinds1.Teikei && defencer == BattleFormationKinds1.TanJuu)
         {
             return(1.2);
         }
         if (attacker == BattleFormationKinds1.TanOu && defencer == BattleFormationKinds1.Teikei)
         {
             return(1.2);
         }
     }
     else if (kind == FormationDatas.GetFormationKinds.SUBMARINE)
     {
         if (attacker == BattleFormationKinds1.FukuJuu && defencer == BattleFormationKinds1.TanOu)
         {
             return(1.2);
         }
         if (attacker == BattleFormationKinds1.Teikei && defencer == BattleFormationKinds1.TanJuu)
         {
             return(1.2);
         }
         if (attacker == BattleFormationKinds1.TanOu && defencer == BattleFormationKinds1.Teikei)
         {
             return(1.2);
         }
     }
     return(this.paramF2.get_Item(kind).get_Item(attacker));
 }
Ejemplo n.º 8
0
        public IEnumerator StartAnimation(BattleFormationKinds1 iKind)
        {
            int nSelectNo = (int)(iKind - 1);

            Formations.ForEach(delegate(UISprite x)
            {
                iTween.Stop(x.gameObject);
            });
            yield return(null);

            for (int i = 0; i < Formations.Length; i++)
            {
                if (i != nSelectNo)
                {
                    Formations[i].transform.position = defaultPos[i];
                    iTween.MoveBy(Formations[i].gameObject, iTween.Hash("x", 2, "easeType", easeType, "time", duration + (float)i * delay));
                }
            }
            flash[nSelectNo].flash(4, 0.05f);
            yield return(new WaitForSeconds(delay * (float)Formations.Length));

            Formations[nSelectNo].transform.LTMoveLocalY(-288f, 0.5f).setEase(LeanTweenType.easeOutQuint);
            IconPanel.transform.LTMoveLocalX(190f, 0.5f).setEase(LeanTweenType.easeOutQuint);
            yield return(new WaitForSeconds(0.2f));

            BtlCut_Live2D live2D = BattleCutManager.GetLive2D();

            live2D.ShowLive2D();
            live2D.ChangeMotion(Live2DModel.MotionType.Battle).Play().PlayShipVoice(13);
            yield return(new WaitForSeconds(2f));
        }
Ejemplo n.º 9
0
        private static bool InitRebellionBattle()
        {
            BattleFormationKinds1 formation_id = (BattleFormationKinds1)(int)RetentionData.GetData()["formation"];

            _clsBattleManager = ((RebellionMapManager)SortieBattleTaskManager.GetMapManager()).BattleStart(formation_id);
            return(true);
        }
Ejemplo n.º 10
0
 private void OnActive(BattleFormationKinds1 iKind)
 {
     if (this._iSelectFormation != iKind)
     {
         this._iSelectFormation = iKind;
         this.ChangeFocus(this._iSelectFormation);
     }
 }
Ejemplo n.º 11
0
 private void OnActive(BattleFormationKinds1 iKind)
 {
     if (_iSelectFormation != iKind)
     {
         _iSelectFormation = iKind;
         ChangeFocus(_iSelectFormation);
     }
 }
Ejemplo n.º 12
0
 private void ChangeFocus(BattleFormationKinds1 iKind)
 {
     this._listLabelButton.ForEach(delegate(UILabelButton x)
     {
         x.isFocus = (x.index == (int)iKind);
     });
     this._clsBrightPoints.ChangeFormation(iKind);
 }
        protected virtual int getRaigAttackValue(Mem_ship atk_ship, List <Mst_slotitem> atk_slot, Mem_ship def_ship)
        {
            int num = 150;
            BattleFormationKinds1 formation;
            BattleFormationKinds2 battleFormation;
            List <int>            list;

            if (!atk_ship.IsEnemy())
            {
                formation       = this.F_Data.Formation;
                battleFormation = this.F_Data.BattleFormation;
                list            = this.F_Data.SlotLevel.get_Item(this.F_SubInfo.get_Item(atk_ship.Rid).DeckIdx);
                BattleFormationKinds1 formation2 = this.E_Data.Formation;
            }
            else
            {
                formation       = this.E_Data.Formation;
                battleFormation = this.E_Data.BattleFormation;
                list            = this.E_Data.SlotLevel.get_Item(this.E_SubInfo.get_Item(atk_ship.Rid).DeckIdx);
                BattleFormationKinds1 formation2 = this.F_Data.Formation;
            }
            double num2 = 0.0;

            using (var enumerator = Enumerable.Select(atk_slot, (Mst_slotitem obj, int idx) => new
            {
                obj,
                idx
            }).GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    var current = enumerator.get_Current();
                    num2 += this.getSlotPlus_Attack(current.obj, list.get_Item(current.idx));
                }
            }
            double num3 = this.valance1 + (double)atk_ship.Raig + num2;
            double formationParamBattle = this.formationData.GetFormationParamBattle(FormationDatas.GetFormationKinds.RAIGEKI, battleFormation);
            double formationParamF      = this.formationData.GetFormationParamF1(FormationDatas.GetFormationKinds.RAIGEKI, formation);

            num3 = num3 * formationParamBattle * formationParamF;
            DamageState damageState = atk_ship.Get_DamageState();
            double      num4        = 1.0;

            if (damageState == DamageState.Tyuuha)
            {
                num4 = 0.8;
            }
            else if (damageState == DamageState.Taiha)
            {
                num4 = 0.0;
            }
            num3 *= num4;
            if (num3 > (double)num)
            {
                num3 = (double)num + Math.Sqrt(num3 - (double)num);
            }
            return((int)num3);
        }
Ejemplo n.º 14
0
        private static bool InitPracticeBattle()
        {
            int enemy_deck_id = (int)RetentionData.GetData()["deckID"];
            BattleFormationKinds1 formation_id    = (BattleFormationKinds1)(int)RetentionData.GetData()["formation"];
            PracticeManager       practiceManager = RetentionData.GetData()["practiceManager"] as PracticeManager;

            _clsBattleManager = practiceManager.StartBattlePractice(enemy_deck_id, formation_id);
            return(true);
        }
Ejemplo n.º 15
0
        protected virtual int getRaigAttackValue(Mem_ship atk_ship, List <Mst_slotitem> atk_slot, Mem_ship def_ship)
        {
            int num = 150;
            BattleFormationKinds1 formation;
            BattleFormationKinds2 battleFormation;
            List <int>            list;

            if (!atk_ship.IsEnemy())
            {
                formation       = F_Data.Formation;
                battleFormation = F_Data.BattleFormation;
                list            = F_Data.SlotLevel[F_SubInfo[atk_ship.Rid].DeckIdx];
                BattleFormationKinds1 formation2 = E_Data.Formation;
            }
            else
            {
                formation       = E_Data.Formation;
                battleFormation = E_Data.BattleFormation;
                list            = E_Data.SlotLevel[E_SubInfo[atk_ship.Rid].DeckIdx];
                BattleFormationKinds1 formation3 = F_Data.Formation;
            }
            double num2 = 0.0;

            foreach (var item in atk_slot.Select((Mst_slotitem obj, int idx) => new
            {
                obj,
                idx
            }))
            {
                num2 += getSlotPlus_Attack(item.obj, list[item.idx]);
            }
            double num3 = valance1 + (double)atk_ship.Raig + num2;
            double formationParamBattle = formationData.GetFormationParamBattle(FormationDatas.GetFormationKinds.RAIGEKI, battleFormation);
            double formationParamF      = formationData.GetFormationParamF1(FormationDatas.GetFormationKinds.RAIGEKI, formation);

            num3 = num3 * formationParamBattle * formationParamF;
            DamageState damageState = atk_ship.Get_DamageState();
            double      num4        = 1.0;

            switch (damageState)
            {
            case DamageState.Tyuuha:
                num4 = 0.8;
                break;

            case DamageState.Taiha:
                num4 = 0.0;
                break;
            }
            num3 *= num4;
            if (num3 > (double)num)
            {
                num3 = (double)num + Math.Sqrt(num3 - (double)num);
            }
            return((int)num3);
        }
Ejemplo n.º 16
0
        public override Api_Result <AllBattleFmt> GetDayPreBattleInfo(BattleFormationKinds1 formationKind)
        {
            Api_Result <AllBattleFmt> dayPreBattleInfo = base.GetDayPreBattleInfo(formationKind);

            if (dayPreBattleInfo.state != Api_Result_State.Parameter_Error)
            {
                dayPreBattleInfo.data.DayBattle.Header.E_DeckShip1.Deck_Id = this.deckRidEnemy;
            }
            return(dayPreBattleInfo);
        }
Ejemplo n.º 17
0
            public void ChangeFormation(BattleFormationKinds1 iKind)
            {
                int cnt = 0;

                this._clsFormationPos[iKind - BattleFormationKinds1.TanJuu].IconPos.ForEach(delegate(Vector3 x)
                {
                    this._listBrightPoint.get_Item(cnt).get_transform().LTMoveLocal(x, 0.3f).setEase(LeanTweenType.easeOutExpo);
                    cnt++;
                });
            }
Ejemplo n.º 18
0
        private void PreparaNext(bool isForward)
        {
            BattleFormationKinds1 iSelectFormation = this._iSelectFormation;

            this._iSelectFormation = (BattleFormationKinds1)Mathe.NextElement((int)this._iSelectFormation, 1, 5, isForward, (int x) => this._listLabelButton.Find((UILabelButton y) => y.index == x).isValid);
            if (iSelectFormation != this._iSelectFormation)
            {
                this.ChangeFocus(this._iSelectFormation);
            }
        }
Ejemplo n.º 19
0
            public void ChangeFormation(BattleFormationKinds1 iKind)
            {
                int cnt = 0;

                _clsFormationPos[(int)(iKind - 1)].IconPos.ForEach(delegate(Vector3 x)
                {
                    _listBrightPoint[cnt].transform.LTMoveLocal(x, 0.3f).setEase(LeanTweenType.easeOutExpo);
                    cnt++;
                });
            }
Ejemplo n.º 20
0
        public new RebellionBattleManager BattleStart(BattleFormationKinds1 formation_id)
        {
            Api_req_SortieBattle reqBattle = new Api_req_SortieBattle(_req_map);
            bool   isBoss = base.NextCategory == enumMapEventType.War_Boss;
            string nextCellEnemyFleetName = GetNextCellEnemyFleetName();
            RebellionBattleManager rebellionBattleManager = new RebellionBattleManager(nextCellEnemyFleetName);

            rebellionBattleManager.__Init__(reqBattle, base.NextEventType, formation_id, _map, IsNextFinal(), isBoss, _deck == _subDeck);
            return(rebellionBattleManager);
        }
 private void Start()
 {
     BattleFormationKinds1[] obj = new BattleFormationKinds1[4]
     {
         BattleFormationKinds1.FukuJuu,
         BattleFormationKinds1.Rinkei,
         BattleFormationKinds1.TanJuu,
         BattleFormationKinds1.TanOu
     };
 }
        public virtual SortieBattleManager BattleStart(BattleFormationKinds1 formationId)
        {
            Api_req_SortieBattle reqBattle = new Api_req_SortieBattle(this._req_map);
            bool   isBoss = base.NextCategory == enumMapEventType.War_Boss;
            string nextCellEnemyFleetName           = base.GetNextCellEnemyFleetName();
            SortieBattleManager sortieBattleManager = new SortieBattleManager(nextCellEnemyFleetName);

            sortieBattleManager.__Init__(reqBattle, base.NextEventType, formationId, this._map, this._maps, base.IsNextFinal(), isBoss);
            return(sortieBattleManager);
        }
        public SortieBattleManager BattleStart_Write(BattleFormationKinds1 formationId)
        {
            DebugBattleMaker.SerializeBattleStart();
            Api_req_SortieBattle reqBattle = new Api_req_SortieBattle(this._req_map);
            bool   isBoss = base.NextCategory == enumMapEventType.War_Boss;
            string nextCellEnemyFleetName = base.GetNextCellEnemyFleetName();
            SortieBattleManager_Write sortieBattleManager_Write = new SortieBattleManager_Write(nextCellEnemyFleetName);

            sortieBattleManager_Write.__Init__(reqBattle, base.NextEventType, formationId, this._map, this._maps, base.IsNextFinal(), isBoss);
            return(sortieBattleManager_Write);
        }
Ejemplo n.º 24
0
        private float CalcCircleSize(int nVessels, BattleFormationKinds1 iKind)
        {
            if (nVessels <= 3)
            {
                return(150f);
            }
            switch (iKind)
            {
            case BattleFormationKinds1.TanJuu:
            case BattleFormationKinds1.TanOu:
                if (nVessels == 4)
                {
                    return(190f);
                }
                if (nVessels == 5)
                {
                    return(230f);
                }
                if (nVessels == 6)
                {
                    return(256f);
                }
                break;

            case BattleFormationKinds1.Rinkei:
                if (nVessels == 4 || nVessels == 5)
                {
                    return(150f);
                }
                if (nVessels == 6)
                {
                    return(190f);
                }
                break;

            case BattleFormationKinds1.Teikei:
                if (nVessels == 4)
                {
                    return(150f);
                }
                if (nVessels == 5)
                {
                    return(200f);
                }
                if (nVessels == 6)
                {
                    return(230f);
                }
                break;
            }
            return(150f);
        }
Ejemplo n.º 25
0
        public PracticeBattleManager_Read(int deck_id, int enemy_deck_id, BattleFormationKinds1 formation_id)
        {
            _enemy_deck_id = enemy_deck_id;
            _war_type      = enumMapWarType.Normal;
            _is_boss       = false;
            DebugBattleMaker.LoadBattleData(out _tmp_day, out _tmp_night, out _tmp_result);
            _phase      = CombatPhase.DAY;
            _battleData = _tmp_day;
            BattleHeader header = _battleData.DayBattle.Header;

            _ships_f = _CreateShipData_f(header, practice: false);
            _ships_e = _CreateShipData_e(header, practice: false);
        }
Ejemplo n.º 26
0
        private float CalcCircleSize(int nVessels, BattleFormationKinds1 iKind)
        {
            if (nVessels <= 3)
            {
                return(150f);
            }
            switch (iKind)
            {
            case BattleFormationKinds1.TanJuu:
            case BattleFormationKinds1.TanOu:
                switch (nVessels)
                {
                case 4:
                    return(190f);

                case 5:
                    return(230f);

                case 6:
                    return(256f);
                }
                break;

            case BattleFormationKinds1.Rinkei:
                switch (nVessels)
                {
                case 4:
                case 5:
                    return(150f);

                case 6:
                    return(190f);
                }
                break;

            case BattleFormationKinds1.Teikei:
                switch (nVessels)
                {
                case 4:
                    return(150f);

                case 5:
                    return(200f);

                case 6:
                    return(230f);
                }
                break;
            }
            return(150f);
        }
Ejemplo n.º 27
0
        protected int getBattleAvo(FormationDatas.GetFormationKinds battleState, Mem_ship targetShip)
        {
            double num = (double)targetShip.Kaihi + Math.Sqrt(targetShip.GetBattleBaseParam().Luck * 2);
            BattleFormationKinds1 formation;

            if (!targetShip.IsEnemy())
            {
                formation = F_Data.Formation;
                BattleFormationKinds2 battleFormation = F_Data.BattleFormation;
                BattleFormationKinds1 formation2      = E_Data.Formation;
            }
            else
            {
                formation = E_Data.Formation;
                BattleFormationKinds2 battleFormation2 = E_Data.BattleFormation;
                BattleFormationKinds1 formation3       = F_Data.Formation;
            }
            num *= formationData.GetFormationParamF3(battleState, formation);
            double num2 = (int)num;

            if (num2 >= 65.0)
            {
                double num3 = 55.0 + Math.Sqrt(num2 - 65.0) * 2.0;
                num2 = (int)num3;
            }
            else if (num2 >= 40.0)
            {
                double num4 = 40.0 + Math.Sqrt(num2 - 40.0) * 3.0;
                num2 = (int)num4;
            }
            num2 += getAvoHosei(targetShip);
            if (!targetShip.IsEnemy() && commandParams != null)
            {
                double num5 = (double)commandParams.Rspp / 100.0;
                double num6 = num2 * num5;
                num2 += num6;
            }
            int    num7 = 100;
            double num8 = Mst_DataManager.Instance.Mst_ship[targetShip.Ship_id].Fuel_max;

            if (num8 != 0.0)
            {
                num7 = (int)((double)targetShip.Fuel / num8 * 100.0);
            }
            if (num7 < 75)
            {
                num2 -= (double)(75 - num7);
            }
            return((int)num2);
        }
Ejemplo n.º 28
0
        private void PreparaNext(bool isForward)
        {
            BattleFormationKinds1 iSelectFormation = _iSelectFormation;

            _iSelectFormation = (BattleFormationKinds1)Mathe.NextElement((int)_iSelectFormation, 1, 5, isForward, delegate(int x)
            {
                ProdFormationSelect prodFormationSelect = this;
                return(_listLabelButton.Find((UILabelButton y) => y.index == x).isValid);
            });
            if (iSelectFormation != _iSelectFormation)
            {
                ChangeFocus(_iSelectFormation);
            }
        }
        public PracticeBattleManager StartBattlePractice_Write(int enemy_deck_id, BattleFormationKinds1 formation_id)
        {
            if (!this.IsValidBattlePractice())
            {
                return(null);
            }
            if (this._rival_decks.Find((DeckModel d) => d.Id == enemy_deck_id) == null)
            {
                return(null);
            }
            PracticeBattleManager practiceBattleManager = new PracticeBattleManager_Write();

            practiceBattleManager.__Init__(this._current_deck.Id, enemy_deck_id, formation_id);
            return(practiceBattleManager);
        }
Ejemplo n.º 30
0
        public virtual void __Init__(int deck_id, int enemy_deck_id, BattleFormationKinds1 formation_id)
        {
            _recovery_item_use_count_at_start = Comm_UserDatas.Instance.User_trophy.Use_recovery_item_count;
            _enemy_deck_id = enemy_deck_id;
            _war_type      = enumMapWarType.Normal;
            _is_boss       = false;
            _last_cell     = true;
            _reqBattle     = new Api_req_PracticeBattle(deck_id, enemy_deck_id);
            _battleData    = _reqBattle.GetDayPreBattleInfo(formation_id).data;
            _phase         = CombatPhase.DAY;
            BattleHeader header = _battleData.DayBattle.Header;

            _ships_f = _CreateShipData_f(header, practice: true);
            _ships_e = _CreateShipData_e(header, practice: true);
            __createCacheDataBeforeCommand__();
        }