Exemplo n.º 1
0
        private BtlCut_ResultShip VitualCtor(ShipModel_BattleResult model)
        {
            _clsShipModel = model;
            int texNum = (!model.DamagedFlgStart) ? 1 : 2;

            _uiBannerTexBefore.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(_clsShipModel.MstId, texNum);

            if (model.DmgStateStart == DamageState_Battle.Gekichin || model.IsEscape())
            {
                _uiBannerTexBefore.shader = SingletonMonoBehaviour <ResourceManager> .Instance.shader.shaderList[0];
            }
            if (model.DmgStateStart != 0)
            {
                DamageSmoke.spriteName = $"icon-ss_burned_{model.DmgStateStart.ToString()}";
                DamageSmoke.alpha      = 1f;
            }
            DamageIcon.spriteName = ((!model.IsEscape()) ? ("icon-ss_" + model.DmgStateStart.ToString()) : "icon-ss_taihi");
            DamageIcon.alpha      = (model.IsEscape() ? 1f : ((model.DmgStateStart == DamageState_Battle.Normal) ? 0f : 1f));
            Level.textInt         = model.Level;
            HPLabel.text          = $"{model.HpStart} / {model.MaxHp}";
            _uiHPSlider.value     = Mathe.Rate(0f, model.MaxHp, model.HpStart);
            _uiHPSlider.foregroundWidget.color = Util.HpGaugeColor2(model.MaxHp, model.HpStart);
            beforeHP           = model.HpStart;
            levelUpCount       = 0;
            _uiEXPSlider.value = Mathe.Rate(0f, 100f, model.ExpInfo.ExpRateBefore);
            return(this);
        }
        private BtlCut_ResultShip VitualCtor(ShipModel_BattleResult model)
        {
            this._clsShipModel = model;
            int texNum = (!model.DamagedFlgStart) ? 1 : 2;

            this._uiBannerTexBefore.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(this._clsShipModel.MstId, texNum);

            if (model.DmgStateStart == DamageState_Battle.Gekichin || model.IsEscape())
            {
                this._uiBannerTexBefore.shader = SingletonMonoBehaviour <ResourceManager> .Instance.shader.shaderList.get_Item(0);
            }
            if (model.DmgStateStart != DamageState_Battle.Normal)
            {
                this.DamageSmoke.spriteName = string.Format("icon-ss_burned_{0}", model.DmgStateStart.ToString());
                this.DamageSmoke.alpha      = 1f;
            }
            this.DamageIcon.spriteName = ((!model.IsEscape()) ? ("icon-ss_" + model.DmgStateStart.ToString()) : "icon-ss_taihi");
            this.DamageIcon.alpha      = ((!model.IsEscape()) ? ((model.DmgStateStart == DamageState_Battle.Normal) ? 0f : 1f) : 1f);
            this.Level.textInt         = model.Level;
            this.HPLabel.text          = string.Format("{0} / {1}", model.HpStart, model.MaxHp);
            this._uiHPSlider.value     = Mathe.Rate(0f, (float)model.MaxHp, (float)model.HpStart);
            this._uiHPSlider.foregroundWidget.color = Util.HpGaugeColor2(model.MaxHp, model.HpStart);
            this.beforeHP           = model.HpStart;
            this.levelUpCount       = 0;
            this._uiEXPSlider.value = Mathe.Rate(0f, 100f, (float)model.ExpInfo.ExpRateBefore);
            return(this);
        }
Exemplo n.º 3
0
 public virtual void SetShipData(ShipModel_BattleResult model)
 {
     _clsIShipModel = model;
     if (model != null)
     {
         _uiShipTex.mainTexture = ShipUtils.LoadBannerTexture(model);
         _uiShipTex.localSize   = ResourceManager.SHIP_TEXTURE_SIZE[(!model.IsDamaged()) ? 1 : 2];
         _uiShipTex.shader      = ((model.DmgStateEnd != DamageState_Battle.Gekichin && !model.IsEscape()) ? SingletonMonoBehaviour <ResourceManager> .Instance.shader.shaderList[1] : SingletonMonoBehaviour <ResourceManager> .Instance.shader.shaderList[0]);
         UpdateDamage(model.DmgStateEnd, model.IsEscape());
     }
 }
Exemplo n.º 4
0
 public virtual void SetShipData(ShipModel_BattleResult model)
 {
     this._clsIShipModel = model;
     if (model == null)
     {
         return;
     }
     this._uiShipTex.mainTexture = ShipUtils.LoadBannerTexture(model);
     this._uiShipTex.localSize   = ResourceManager.SHIP_TEXTURE_SIZE.get_Item((!model.IsDamaged()) ? 1 : 2);
     this._uiShipTex.shader      = ((model.DmgStateEnd != DamageState_Battle.Gekichin && !model.IsEscape()) ? SingletonMonoBehaviour <ResourceManager> .Instance.shader.shaderList.get_Item(1) : SingletonMonoBehaviour <ResourceManager> .Instance.shader.shaderList.get_Item(0));
     this.UpdateDamage(model.DmgStateEnd, model.IsEscape());
 }
Exemplo n.º 5
0
 protected virtual void SetShipTexture(ShipModel_BattleResult model)
 {
     this._clsIShipModel = model;
     if (model == null)
     {
         this._uiShipTex.mainTexture = null;
         this._uiShipTex.get_transform().get_localPosition().Zero();
         return;
     }
     this._uiShipTex.mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(model);
     this._uiShipTex.MakePixelPerfect();
 }
Exemplo n.º 6
0
 protected virtual void SetShipTexture(ShipModel_BattleResult model)
 {
     _clsIShipModel = model;
     if (model == null)
     {
         _uiShipTex.mainTexture = null;
         _uiShipTex.transform.localPosition.Zero();
     }
     else
     {
         _uiShipTex.mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(model);
         _uiShipTex.MakePixelPerfect();
     }
 }
Exemplo n.º 7
0
 private void setShipTexture()
 {
     if (_ship != null)
     {
         GameObject             gameObject = base.transform.FindChild("ShipObj").gameObject;
         ShipModel_BattleResult model      = (ShipModel_BattleResult)_ship;
         float lovScaleMagnification       = SortieBattleUtils.GetLovScaleMagnification(model);
         _uiShip.mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(_ship.GetGraphicsMstId(), isDamaged: false);
         _uiShip.MakePixelPerfect();
         _uiShip.transform.localPosition = Util.Poi2Vec(new ShipOffset(_ship.GetGraphicsMstId()).GetShipDisplayCenter(damaged: false));
         _uiShip.transform.localScale    = new Vector3(lovScaleMagnification, lovScaleMagnification, 1f);
         float num = (lovScaleMagnification - 1f) * 120f;
         gameObject.transform.localPosition = new Vector3(1f, 140f - num, 1f);
     }
 }
Exemplo n.º 8
0
        private void setShipTexture()
        {
            if (this._ship == null)
            {
                return;
            }
            GameObject             gameObject = base.get_transform().FindChild("ShipObj").get_gameObject();
            ShipModel_BattleResult model      = (ShipModel_BattleResult)this._ship;
            float lovScaleMagnification       = SortieBattleUtils.GetLovScaleMagnification(model);

            this._uiShip.mainTexture = KCV.Battle.Utils.ShipUtils.LoadTexture(this._ship.GetGraphicsMstId(), false);
            this._uiShip.MakePixelPerfect();
            this._uiShip.get_transform().set_localPosition(Util.Poi2Vec(new ShipOffset(this._ship.GetGraphicsMstId()).GetShipDisplayCenter(false)));
            this._uiShip.get_transform().set_localScale(new Vector3(lovScaleMagnification, lovScaleMagnification, 1f));
            float num = (lovScaleMagnification - 1f) * 120f;

            gameObject.get_transform().set_localPosition(new Vector3(1f, 140f - num, 1f));
        }
Exemplo n.º 9
0
        public void CreateInstance()
        {
            List <ShipModel_BattleResult> list = new List <ShipModel_BattleResult>((this._iType != FleetType.Friend) ? this._clsResultModel.Ships_e : this._clsResultModel.Ships_f);
            int num = 0;

            using (List <ShipModel_BattleResult> .Enumerator enumerator = list.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ShipModel_BattleResult current = enumerator.get_Current();
                    if (current != null)
                    {
                        this._listShipBanners.Add(UIVeteransReportShipBanner.Instantiate(this._prefabVeteransReportShipBanner.GetComponent <UIVeteransReportShipBanner>(), this._traShipBannerAnchor, Vector3.get_down() * this._fBannerVerticalOffs * (float)num, current));
                        num++;
                    }
                }
            }
        }
        private void _SetShipExp(DeckModel deck, ShipModel_BattleResult ship, Dictionary <int, int> exp_rates_before)
        {
            if (deck == null)
            {
                ship.__InitResultData__(0, null, 0, null);
                return;
            }
            ShipModel shipFromMemId   = deck.GetShipFromMemId(ship.TmpId);
            int       exp_rate_before = 0;

            exp_rates_before.TryGetValue(ship.TmpId, ref exp_rate_before);
            int exp = 0;

            this._fmt.GetShipExp.TryGetValue(ship.TmpId, out exp);
            List <int> levelup_info = null;

            this._fmt.LevelUpInfo.TryGetValue(ship.TmpId, out levelup_info);
            ship.__InitResultData__(exp_rate_before, shipFromMemId, exp, levelup_info);
        }
Exemplo n.º 11
0
        private void _SetShipExp(DeckModel deck, ShipModel_BattleResult ship, Dictionary <int, int> exp_rates_before)
        {
            if (deck == null)
            {
                ship.__InitResultData__(0, null, 0, null);
                return;
            }
            ShipModel shipFromMemId = deck.GetShipFromMemId(ship.TmpId);
            int       value         = 0;

            exp_rates_before.TryGetValue(ship.TmpId, out value);
            int value2 = 0;

            _fmt.GetShipExp.TryGetValue(ship.TmpId, out value2);
            List <int> value3 = null;

            _fmt.LevelUpInfo.TryGetValue(ship.TmpId, out value3);
            ship.__InitResultData__(value, shipFromMemId, value2, value3);
        }
Exemplo n.º 12
0
        protected List <ShipModel_BattleAll> _CreateShipData(BattleShipFmt[] ship_fmts, bool is_friend, bool practice, out int count)
        {
            count = 0;
            List <ShipModel_BattleAll> list = new List <ShipModel_BattleAll>();

            for (int i = 0; i < 6; i++)
            {
                BattleShipFmt battleShipFmt = ship_fmts[i];
                if (battleShipFmt == null)
                {
                    list.Add(null);
                    continue;
                }
                ShipModel_BattleAll item = new ShipModel_BattleResult(battleShipFmt, i, is_friend, practice);
                list.Add(item);
                count++;
            }
            return(list);
        }
        private void _Init(int deck_id, int enemy_deck_id, BattleManager bManager, BattleResultFmt fmt, List <ShipModel_BattleAll> ships_f, List <ShipModel_BattleAll> ships_e, Dictionary <int, int> exp_rates_before)
        {
            UserInfoModel userInfo = bManager.UserInfo;
            DeckModel     deck     = userInfo.GetDeck(deck_id);

            this._deck_name = deck.Name;
            this._user_name = userInfo.Name;
            this._fmt       = fmt;
            this._ships_f   = ships_f.ConvertAll <ShipModel_BattleResult>((ShipModel_BattleAll ship) => (ShipModel_BattleResult)ship);
            this._ships_e   = ships_e.ConvertAll <ShipModel_BattleResult>((ShipModel_BattleAll ship) => (ShipModel_BattleResult)ship);
            this._mvp_ship  = this._ships_f.Find((ShipModel_BattleResult ship) => ship != null && ship.TmpId == this._fmt.MvpShip);
            for (int i = 0; i < this.Ships_f.Length; i++)
            {
                ShipModel_BattleResult shipModel_BattleResult = this.Ships_f[i];
                if (shipModel_BattleResult != null)
                {
                    this._SetShipExp(deck, shipModel_BattleResult, exp_rates_before);
                    this._hp_start_f += shipModel_BattleResult.HpStart;
                    this._hp_end_f   += shipModel_BattleResult.HpEnd;
                }
            }
            DeckModel deck2 = userInfo.GetDeck(enemy_deck_id);

            for (int j = 0; j < this.Ships_e.Length; j++)
            {
                ShipModel_BattleResult shipModel_BattleResult2 = this.Ships_e[j];
                if (shipModel_BattleResult2 != null)
                {
                    this._SetShipExp(deck2, shipModel_BattleResult2, exp_rates_before);
                    this._hp_start_e += shipModel_BattleResult2.HpStart;
                    this._hp_end_e   += shipModel_BattleResult2.HpEnd;
                }
            }
            this._new_opened_map_ids = fmt.NewOpenMapId.GetRange(0, fmt.NewOpenMapId.get_Count());
            this._new_opened_map_ids.AddRange(fmt.ReOpenMapId);
            this._new_opened_area_ids = this._new_opened_map_ids.FindAll((int map_id) => map_id % 10 == 1);
            this._new_opened_area_ids = this._new_opened_area_ids.ConvertAll <int>((int map_id) => (int)Math.Floor((double)map_id / 10.0));
            this._first_area_clear    = fmt.FirstAreaComplete;
        }
        private bool Init()
        {
            this._uiEXPValue.textInt = this._clsResultModel.BaseExp;
            int num = 0;

            ShipModel_BattleResult[] ships_f = this._clsResultModel.Ships_f;
            for (int i = 0; i < ships_f.Length; i++)
            {
                ShipModel_BattleResult shipModel_BattleResult = ships_f[i];
                if (shipModel_BattleResult == null)
                {
                    this._listEXPs.get_Item(num).transform.SetActive(false);
                    num++;
                }
                else
                {
                    this._listEXPs.get_Item(num).SetEXP(shipModel_BattleResult);
                    num++;
                }
            }
            this._clsSpecialVeterans.Init();
            return(true);
        }
Exemplo n.º 15
0
            public bool Init(ShipModel_BattleResult model)
            {
                this._clsShipModel = model;
                this.panel.alpha   = 0f;
                if (model == null)
                {
                    return(false);
                }
                this.index = model.Index;
                Texture2D texture2D   = ShipUtils.LoadTexture(model);
                UITexture arg_47_0    = this._uiShipTexture;
                Texture   mainTexture = texture2D;

                this._uiShipShadow.mainTexture = mainTexture;
                arg_47_0.mainTexture           = mainTexture;
                this._uiShipTexture.MakePixelPerfect();
                this._uiShipShadow.MakePixelPerfect();
                Vector3 vpos = Util.Poi2Vec(model.Offsets.GetShipDisplayCenter(model.IsDamaged())) + Vector3.get_down() * 10f;

                this._uiShipTexture.get_transform().set_localScale(Vector3.get_one() * 1.1f);
                this._uiShipTexture.get_transform().AddLocalPosition(vpos);
                this._uiShipShadow.get_transform().AddLocalPosition(vpos);
                return(true);
            }
Exemplo n.º 16
0
            public bool Init(ShipModel_BattleResult model)
            {
                _clsShipModel = model;
                panel.alpha   = 0f;
                if (model == null)
                {
                    return(false);
                }
                index = model.Index;
                Texture2D texture2D     = ShipUtils.LoadTexture(model);
                UITexture uiShipTexture = _uiShipTexture;
                Texture   mainTexture   = texture2D;

                _uiShipShadow.mainTexture = mainTexture;
                uiShipTexture.mainTexture = mainTexture;
                _uiShipTexture.MakePixelPerfect();
                _uiShipShadow.MakePixelPerfect();
                Vector3 vpos = Util.Poi2Vec(model.Offsets.GetShipDisplayCenter(model.IsDamaged())) + Vector3.down * 10f;

                _uiShipTexture.transform.localScale = Vector3.one * 1.1f;
                _uiShipTexture.transform.AddLocalPosition(vpos);
                _uiShipShadow.transform.AddLocalPosition(vpos);
                return(true);
            }
Exemplo n.º 17
0
        public static BtlCut_ResultShip Instantiate(BtlCut_ResultShip prefab, Transform parent, Vector3 pos, ShipModel_BattleResult model)
        {
            BtlCut_ResultShip btlCut_ResultShip = UnityEngine.Object.Instantiate(prefab);

            btlCut_ResultShip.transform.parent        = parent;
            btlCut_ResultShip.transform.localPosition = pos;
            btlCut_ResultShip.transform.localScaleOne();
            return(btlCut_ResultShip.VitualCtor(model));
        }
        public static BtlCut_ResultShip Instantiate(BtlCut_ResultShip prefab, Transform parent, Vector3 pos, ShipModel_BattleResult model)
        {
            BtlCut_ResultShip btlCut_ResultShip = Object.Instantiate <BtlCut_ResultShip>(prefab);

            btlCut_ResultShip.get_transform().set_parent(parent);
            btlCut_ResultShip.get_transform().set_localPosition(pos);
            btlCut_ResultShip.get_transform().localScaleOne();
            return(btlCut_ResultShip.VitualCtor(model));
        }
Exemplo n.º 19
0
        public static Texture2D LoadBannerTexture(ShipModel_BattleResult model)
        {
            bool isDamaged = model.IsFriend() && model.IsDamaged();

            return(LoadBannerTexture(model, isDamaged));
        }
 public void SetEXP(ShipModel_BattleResult model)
 {
     this._uiEXPVal.textInt = this._nEXP;
     this._nEXP             = model.ExpFromBattle;
 }
Exemplo n.º 21
0
 public static Texture2D LoadBannerTextureInVeteransReport(ShipModel_BattleResult model)
 {
     return(LoadBannerTextureInTacticalSituation(model));
 }
Exemplo n.º 22
0
 public static Texture2D LoadTexture(ShipModel_BattleResult model)
 {
     return(LoadTexture(model.GetGraphicsMstId(), model.IsDamaged()));
 }
Exemplo n.º 23
0
        public override string ToString()
        {
            string str = "-- BattleResultDTO --\n";

            str += $"勝利ランク:{WinRank}   提督名:{UserName}   戦闘後の提督レベル:{UserLevel}\n";
            str += $"海域名:{MapName} 味方艦隊名:{DeckName}  敵艦隊名:{EnemyName}   海域基本経験値:{BaseExp}\n";
            for (int i = 0; i < Ships_f.Length; i++)
            {
                ShipModel_BattleResult shipModel_BattleResult = Ships_f[i];
                if (shipModel_BattleResult != null)
                {
                    str += string.Format("[{0}] ID:({1}) {2} 状態:{3} {4} {5}\n", i, shipModel_BattleResult.MstId, shipModel_BattleResult.Name, shipModel_BattleResult.DmgStateEnd, shipModel_BattleResult.ExpInfo, (shipModel_BattleResult != MvpShip) ? string.Empty : "[MVP]");
                }
            }
            for (int j = 0; j < Ships_e.Length; j++)
            {
                ShipModel_BattleResult shipModel_BattleResult2 = Ships_e[j];
                if (shipModel_BattleResult2 != null)
                {
                    str += $"[{j}] ID:({shipModel_BattleResult2.MstId}) {shipModel_BattleResult2.Name} 状態:{shipModel_BattleResult2.DmgStateEnd}  種類(読み): {shipModel_BattleResult2.Yomi} {shipModel_BattleResult2.ExpInfo}\n";
                }
            }
            str += $"自分側HP {HPStart_f}->{HPEnd_f}\n";
            str += $"相手側HP {HPStart_e}->{HPEnd_e}\n";
            List <IReward> rewardItems = GetRewardItems();

            if (rewardItems.Count > 0)
            {
                str += "《ドロップあり》\n";
                for (int k = 0; k < rewardItems.Count; k++)
                {
                    str += $"{rewardItems[k]}\n";
                }
            }
            else
            {
                str += "《ドロップなし》\n";
            }
            rewardItems = GetAreaRewardItems();
            if (rewardItems != null && rewardItems.Count > 0)
            {
                str += "《海域クリア報酬あり》\n";
                for (int l = 0; l < rewardItems.Count; l++)
                {
                    str += $"{rewardItems[l]}\n";
                }
            }
            else
            {
                str += "《海域クリア報酬なし》\n";
            }
            if (FirstClear || FirstAreaClear)
            {
                if (FirstClear)
                {
                    str += $"[初回マップクリア]";
                }
                if (FirstAreaClear)
                {
                    str += $"[初回海域クリア]";
                }
                str += $"\n";
            }
            str += $"-新開放海域-\n";
            for (int m = 0; m < _new_opened_area_ids.Count; m++)
            {
                str += $"{_new_opened_area_ids[m]}\n";
            }
            str += $"-新開放マップ-\n";
            for (int n = 0; n < _new_opened_map_ids.Count; n++)
            {
                str += $"{_new_opened_map_ids[n]}\n";
            }
            str += $"-獲得戦略ポイント:{SPoint}\n";
            return(str + "---------------------");
        }
        public override string ToString()
        {
            string text = "-- BattleResultDTO --\n";

            text += string.Format("勝利ランク:{0}   提督名:{1}   戦闘後の提督レベル:{2}\n", this.WinRank, this.UserName, this.UserLevel);
            text += string.Format("海域名:{0} 味方艦隊名:{1}  敵艦隊名:{2}   海域基本経験値:{3}\n", new object[]
            {
                this.MapName,
                this.DeckName,
                this.EnemyName,
                this.BaseExp
            });
            for (int i = 0; i < this.Ships_f.Length; i++)
            {
                ShipModel_BattleResult shipModel_BattleResult = this.Ships_f[i];
                if (shipModel_BattleResult != null)
                {
                    text += string.Format("[{0}] ID:({1}) {2} 状態:{3} {4} {5}\n", new object[]
                    {
                        i,
                        shipModel_BattleResult.MstId,
                        shipModel_BattleResult.Name,
                        shipModel_BattleResult.DmgStateEnd,
                        shipModel_BattleResult.ExpInfo,
                        (shipModel_BattleResult != this.MvpShip) ? string.Empty : "[MVP]"
                    });
                }
            }
            for (int j = 0; j < this.Ships_e.Length; j++)
            {
                ShipModel_BattleResult shipModel_BattleResult2 = this.Ships_e[j];
                if (shipModel_BattleResult2 != null)
                {
                    text += string.Format("[{0}] ID:({1}) {2} 状態:{3}  種類(読み): {4} {5}\n", new object[]
                    {
                        j,
                        shipModel_BattleResult2.MstId,
                        shipModel_BattleResult2.Name,
                        shipModel_BattleResult2.DmgStateEnd,
                        shipModel_BattleResult2.Yomi,
                        shipModel_BattleResult2.ExpInfo
                    });
                }
            }
            text += string.Format("自分側HP {0}->{1}\n", this.HPStart_f, this.HPEnd_f);
            text += string.Format("相手側HP {0}->{1}\n", this.HPStart_e, this.HPEnd_e);
            List <IReward> list = this.GetRewardItems();

            if (list.get_Count() > 0)
            {
                text += "《ドロップあり》\n";
                for (int k = 0; k < list.get_Count(); k++)
                {
                    text += string.Format("{0}\n", list.get_Item(k));
                }
            }
            else
            {
                text += "《ドロップなし》\n";
            }
            list = this.GetAreaRewardItems();
            if (list != null && list.get_Count() > 0)
            {
                text += "《海域クリア報酬あり》\n";
                for (int l = 0; l < list.get_Count(); l++)
                {
                    text += string.Format("{0}\n", list.get_Item(l));
                }
            }
            else
            {
                text += "《海域クリア報酬なし》\n";
            }
            if (this.FirstClear || this.FirstAreaClear)
            {
                if (this.FirstClear)
                {
                    text += string.Format("[初回マップクリア]", new object[0]);
                }
                if (this.FirstAreaClear)
                {
                    text += string.Format("[初回海域クリア]", new object[0]);
                }
                text += string.Format("\n", new object[0]);
            }
            text += string.Format("-新開放海域-\n", new object[0]);
            for (int m = 0; m < this._new_opened_area_ids.get_Count(); m++)
            {
                text += string.Format("{0}\n", this._new_opened_area_ids.get_Item(m));
            }
            text += string.Format("-新開放マップ-\n", new object[0]);
            for (int n = 0; n < this._new_opened_map_ids.get_Count(); n++)
            {
                text += string.Format("{0}\n", this._new_opened_map_ids.get_Item(n));
            }
            text += string.Format("-獲得戦略ポイント:{0}\n", this.SPoint);
            return(text + "---------------------");
        }