private void UpdateBestScore()
        {
            GameManager    instance       = MonoSingleton <GameManager> .Instance;
            TowerResuponse towerResuponse = instance.TowerResuponse;

            if (towerResuponse.speedRank != 0 && towerResuponse.techRank != 0)
            {
                this.SetText(this.BestTurn, towerResuponse.spd_score.ToString());
                this.SetText(this.BestDied, towerResuponse.tec_score.ToString());
                this.SetText(this.BestRetire, towerResuponse.ret_score.ToString());
                this.SetText(this.BestRecover, towerResuponse.rcv_score.ToString());
                this.SetRankIcon(this.TurnScore, instance.ConvertTowerScoreToRank(towerResuponse.spd_score, TOWER_SCORE_TYPE.TURN));
                this.SetRankIcon(this.DiedScore, instance.ConvertTowerScoreToRank(towerResuponse.tec_score, TOWER_SCORE_TYPE.DIED));
                this.SetRankIcon(this.RetireScore, instance.ConvertTowerScoreToRank(towerResuponse.ret_score, TOWER_SCORE_TYPE.RETIRE));
                this.SetRankIcon(this.RecoverScore, instance.ConvertTowerScoreToRank(towerResuponse.rcv_score, TOWER_SCORE_TYPE.RECOVER));
            }
            else
            {
                this.SetText(this.BestTurn, this.NotSocreText);
                this.SetText(this.BestDied, this.NotSocreText);
                this.SetText(this.BestRetire, this.NotSocreText);
                this.SetText(this.BestRecover, this.NotSocreText);
                this.SetDefault(this.TurnScore);
                this.SetDefault(this.DiedScore);
                this.SetDefault(this.RetireScore);
                this.SetDefault(this.RecoverScore);
            }
        }
        public override void OnSuccess(WWWResult www)
        {
            if (TowerErrorHandle.Error((FlowNode_Network)this))
            {
                return;
            }
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;

            WebAPI.JSON_BodyResponse <FlowNode_ReqTowerReset.Json_ReqTowerReset> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqTowerReset.Json_ReqTowerReset> >(www.text);
            DebugUtility.Assert(jsonObject != null, "res == null");
            Network.RemoveAPI();
            this.rtime = jsonObject.body.rtime;
            Json_PlayerData json = new Json_PlayerData();

            json.coin      = new Json_Coin();
            json.coin.free = jsonObject.body.coin.free;
            json.coin.paid = jsonObject.body.coin.paid;
            json.coin.com  = jsonObject.body.coin.com;
            this.round     = jsonObject.body.round;
            if (jsonObject.body.rank != null)
            {
                towerResuponse.speedRank = jsonObject.body.rank.spd_rank;
                towerResuponse.techRank  = jsonObject.body.rank.tec_rank;
                towerResuponse.spd_score = jsonObject.body.rank.spd_score;
                towerResuponse.tec_score = jsonObject.body.rank.tec_score;
                towerResuponse.ret_score = jsonObject.body.rank.ret_score;
                towerResuponse.rcv_score = jsonObject.body.rank.rcv_score;
            }
            MonoSingleton <GameManager> .Instance.Player.Deserialize(json, PlayerData.EDeserializeFlags.Coin);

            GameParameter.UpdateValuesOfType(GameParameter.ParameterTypes.GLOBAL_PLAYER_COIN);
            GlobalVars.SelectedQuestID = MonoSingleton <GameManager> .Instance.FindFirstTowerFloor(MonoSingleton <GameManager> .Instance.TowerResuponse.TowerID).iname;

            this.Success();
        }
Exemple #3
0
        private void Start()
        {
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;

            this.NowScore        = new int[4];
            this.NowScore[0]     = towerResuponse.turn_num;
            this.NowScore[1]     = towerResuponse.died_num;
            this.NowScore[2]     = towerResuponse.retire_num;
            this.NowScore[3]     = towerResuponse.recover_num;
            this.OldBestScore    = new int[4];
            this.OldBestScore[0] = towerResuponse.spd_score;
            this.OldBestScore[1] = towerResuponse.tec_score;
            this.OldBestScore[2] = towerResuponse.ret_score;
            this.OldBestScore[3] = towerResuponse.rcv_score;
            this.CountupIndex    = 0;
            if (Object.op_Inequality((Object)this.NextButton, (Object)null))
            {
                // ISSUE: method pointer
                ((UnityEvent)this.NextButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(OnClickNext)));
            }
            if (this.NowScore == null || this.ScoreContents == null || (this.ScoreObj == null || this.NewRecord == null))
            {
                DebugUtility.LogWarning("Error TowerClear Param Check!!!!");
            }
            this.Icons = AssetManager.Load <SpriteSheet>("UI/TowerRankIcon");
        }
Exemple #4
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 0)
            {
                return;
            }
            TowerRecoverData dataOfClass    = DataSource.FindDataOfClass <TowerRecoverData>(((Component)this).get_gameObject(), (TowerRecoverData)null);
            TowerResuponse   towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;

            if (Network.Mode != Network.EConnectMode.Online)
            {
                return;
            }
            if (dataOfClass != null)
            {
                byte floor = towerResuponse.GetCurrentFloor().floor;
                this.usedCoin = dataOfClass.useCoin;
                this.ExecRequest((WebAPI) new ReqTowerRecover(dataOfClass.towerID, dataOfClass.useCoin, (int)towerResuponse.round, floor, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                ((Behaviour)this).set_enabled(true);
            }
            else
            {
                ((Behaviour)this).set_enabled(false);
            }
        }
        private void CheckBattleResetButton()
        {
            TowerParam tower = MonoSingleton <GameManager> .Instance.FindTower(GlobalVars.SelectedTowerID);

            if (tower == null)
            {
                return;
            }
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;

            if (towerResuponse == null)
            {
                return;
            }
            TowerFloorParam currentFloor = towerResuponse.GetCurrentFloor();

            if (currentFloor == null)
            {
                return;
            }
            if (MonoSingleton <GameManager> .Instance.Player.Coin > (int)tower.floor_reset_coin && GlobalVars.SelectedQuestID == currentFloor.iname && towerResuponse.CheckEnemyDeck())
            {
                ((Selectable)this.BattleResetButton).set_interactable(true);
            }
            else
            {
                ((Selectable)this.BattleResetButton).set_interactable(false);
            }
        }
Exemple #6
0
        private void RefreshUI()
        {
            QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

            this.mRecoverTime = MonoSingleton <GameManager> .Instance.TowerResuponse.rtime;
            if (quest != null && Object.op_Inequality((Object)this.ChallengeButton, (Object)null))
            {
                DataSource.Bind <QuestParam>(((Component)this.ChallengeButton).get_gameObject(), quest);
                ((Selectable)this.ChallengeButton).set_interactable(quest.IsQuestCondition() && quest.state != QuestStates.Cleared);
                GameParameter.UpdateAll(((Component)this.ChallengeButton).get_gameObject());
            }
            if (Object.op_Inequality((Object)this.RecoverButton, (Object)null))
            {
                TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
                bool           flag           = towerResuponse.GetAvailableUnits().Count > 0 && towerResuponse.ExistDamagedUnit() || towerResuponse.GetDiedUnitNum() > 0;
                ((Selectable)this.RecoverButton).set_interactable(flag && !towerResuponse.is_reset);
                if (Object.op_Inequality((Object)this.RecoverTimer, (Object)null))
                {
                    this.RecoverTimer.SetActive(flag);
                }
            }
            if (Object.op_Inequality((Object)this.ResetButton, (Object)null))
            {
                TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
                ((Component)this.ResetButton).get_gameObject().SetActive(towerResuponse.is_reset);
                ((Component)this.ChallengeButton).get_gameObject().SetActive(!towerResuponse.is_reset);
                this.ResetText.set_text(towerResuponse.reset_cost.ToString());
                bool flag = (int)towerResuponse.reset_cost == 0;
                ((Component)this.ResetText).get_gameObject().SetActive(!flag);
                ((Component)this.ResetTextFree).get_gameObject().SetActive(flag);
            }
            this.SetAliveUnitsText();
            this.SetRecoverText();
        }
        private void UpdateNowScore()
        {
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;

            if (Object.op_Inequality((Object)this.NowTurn, (Object)null))
            {
                this.NowTurn.set_text(towerResuponse.turn_num.ToString());
            }
            if (Object.op_Inequality((Object)this.NowDied, (Object)null))
            {
                this.NowDied.set_text(towerResuponse.died_num.ToString());
            }
            if (Object.op_Inequality((Object)this.NowRetire, (Object)null))
            {
                this.NowRetire.set_text(towerResuponse.retire_num.ToString());
            }
            if (Object.op_Inequality((Object)this.NowRecover, (Object)null))
            {
                this.NowRecover.set_text(towerResuponse.recover_num.ToString());
            }
            if (Object.op_Inequality((Object)this.NowChallenge, (Object)null))
            {
                this.NowChallenge.set_text(towerResuponse.challenge_num.ToString());
            }
            if (Object.op_Inequality((Object)this.NowLose, (Object)null))
            {
                this.NowLose.set_text(towerResuponse.lose_num.ToString());
            }
            if (!Object.op_Inequality((Object)this.NowReset, (Object)null))
            {
                return;
            }
            this.NowReset.set_text(towerResuponse.reset_num.ToString());
        }
Exemple #8
0
 public void Refresh()
 {
     // ISSUE: object of a compiler-generated type is created
     // ISSUE: variable of a compiler-generated type
     TowerPartyHP.\u003CRefresh\u003Ec__AnonStorey273 refreshCAnonStorey273 = new TowerPartyHP.\u003CRefresh\u003Ec__AnonStorey273();
     if (Object.op_Equality((Object)this.mSlider, (Object)null))
     {
         return;
     }
     // ISSUE: reference to a compiler-generated field
     refreshCAnonStorey273.UnitData = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);
     // ISSUE: reference to a compiler-generated field
     if (refreshCAnonStorey273.UnitData == null)
     {
         ((Component)this.mSlider).get_gameObject().SetActive(false);
     }
     else
     {
         TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
         if (towerResuponse == null)
         {
             ((Component)this.mSlider).get_gameObject().SetActive(false);
         }
         else if (towerResuponse.pdeck == null)
         {
             ((Component)this.mSlider).get_gameObject().SetActive(true);
             // ISSUE: reference to a compiler-generated field
             int hp = (int)refreshCAnonStorey273.UnitData.Status.param.hp;
             this.SetSliderValue(hp, hp);
         }
         else
         {
             // ISSUE: reference to a compiler-generated method
             TowerResuponse.PlayerUnit playerUnit = towerResuponse.pdeck.Find(new Predicate <TowerResuponse.PlayerUnit>(refreshCAnonStorey273.\u003C\u003Em__2EF));
             if (playerUnit == null)
             {
                 ((Component)this.mSlider).get_gameObject().SetActive(true);
                 // ISSUE: reference to a compiler-generated field
                 int hp = (int)refreshCAnonStorey273.UnitData.Status.param.hp;
                 this.SetSliderValue(hp, hp);
             }
             else if (playerUnit.isDied)
             {
                 ((Component)this.mSlider).get_gameObject().SetActive(false);
             }
             else
             {
                 ((Component)this.mSlider).get_gameObject().SetActive(true);
                 // ISSUE: reference to a compiler-generated field
                 // ISSUE: reference to a compiler-generated field
                 this.SetSliderValue(Mathf.Max((int)refreshCAnonStorey273.UnitData.Status.param.hp - playerUnit.dmg, 1), (int)refreshCAnonStorey273.UnitData.Status.param.hp);
             }
         }
     }
 }
Exemple #9
0
        private void UpdateResultFlags()
        {
            if (this.mCurrentQuest == null)
            {
                return;
            }
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
            TowerParam     tower          = MonoSingleton <GameManager> .Instance.FindTower(MonoSingleton <GameManager> .Instance.FindTowerFloor(this.mQuestName).tower_id);

            if (this.m_QuestRecord.result == BattleCore.QuestResult.Win)
            {
                this.ResultFlags_SetOn(TowerQuestResult.eTowerResultFlags.Win);
            }
            else
            {
                this.ResultFlags_SetOn(TowerQuestResult.eTowerResultFlags.Lose);
            }
            if (this.mCurrentQuest.HasMission())
            {
                bool   flag      = true;
                bool[] flagArray = new bool[this.m_QuestRecord.bonusCount];
                for (int index = 0; index < this.m_QuestRecord.bonusCount; ++index)
                {
                    if ((this.m_QuestRecord.bonusFlags & 1 << index) != 0)
                    {
                        flagArray[index] = true;
                    }
                    if (this.mCurrentQuest.IsMissionClear(index))
                    {
                        flagArray[index] = true;
                    }
                    if (!flagArray[index])
                    {
                        flag = false;
                        break;
                    }
                }
                if (flag)
                {
                    this.ResultFlags_SetOn(TowerQuestResult.eTowerResultFlags.MissionComplete);
                }
                else
                {
                    this.ResultFlags_SetOn(TowerQuestResult.eTowerResultFlags.MissionFailure);
                }
            }
            if (towerResuponse.IsNotClear || towerResuponse.IsRoundClear || !tower.is_view_ranking)
            {
                this.ResultFlags_Set(TowerQuestResult.eTowerResultFlags.ShowRank, false);
            }
            else
            {
                this.ResultFlags_Set(TowerQuestResult.eTowerResultFlags.ShowRank, true);
            }
        }
Exemple #10
0
        private void SetAliveUnitsText()
        {
            if (Object.op_Equality((Object)this.AliveUnits, (Object)null))
            {
                return;
            }
            TowerResuponse  towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
            List <UnitData> availableUnits = towerResuponse.GetAvailableUnits();
            int             diedUnitNum    = towerResuponse.GetDiedUnitNum();

            this.AliveUnits.set_text(string.Format("{0}/{1}", (object)Mathf.Max(0, availableUnits.Count - diedUnitNum), (object)availableUnits.Count));
        }
Exemple #11
0
        private void SetEnemies(JSON_MapEnemyUnit[] json)
        {
            for (int index = 0; index < this.UnknownEnemyList.Count; ++index)
            {
                ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false);
            }
            List <JSON_MapEnemyUnit> list = ((IEnumerable <JSON_MapEnemyUnit>)json).Where <JSON_MapEnemyUnit>((Func <JSON_MapEnemyUnit, bool>)(enemy =>
            {
                if (enemy.elem != 0)
                {
                    return(enemy.side == 1);
                }
                return(false);
            })).ToList <JSON_MapEnemyUnit>();
            TowerResuponse  towerResuponse  = MonoSingleton <GameManager> .Instance.TowerResuponse;
            TowerFloorParam towerFloorParam = (TowerFloorParam)null;

            if (towerResuponse != null)
            {
                towerFloorParam = towerResuponse.GetCurrentFloor();
            }
            this.EnemyUnits.Clear();
            for (int index = 0; index < list.Count; ++index)
            {
                TowerEnemyListItem towerEnemyListItem;
                if (this.EnemyList.Count <= index)
                {
                    towerEnemyListItem = (TowerEnemyListItem)((GameObject)Object.Instantiate <GameObject>((M0)this.EnemyTemplate)).GetComponent <TowerEnemyListItem>();
                    ((Component)towerEnemyListItem).get_transform().SetParent(this.EnemiesRoot.get_transform(), false);
                    this.EnemyList.Add(towerEnemyListItem);
                }
                else
                {
                    towerEnemyListItem = this.EnemyList[index];
                }
                NPCSetting npcSetting = new NPCSetting(list[index]);
                Unit       data       = new Unit();
                data.Setup((UnitData)null, (UnitSetting)npcSetting, (Unit.DropItem)null, (Unit.DropItem)null);
                DataSource.Bind <Unit>(((Component)towerEnemyListItem).get_gameObject(), data);
                this.EnemyUnits.Add(data);
            }
            if (towerFloorParam != null && towerFloorParam.iname == GlobalVars.SelectedQuestID)
            {
                MonoSingleton <GameManager> .Instance.TowerResuponse.CalcEnemyDamage(this.EnemyUnits);
            }
            for (int index = 0; index < this.EnemyList.Count; ++index)
            {
                bool flag = index < list.Count && index < 10;
                ((Component)this.EnemyList[index]).get_gameObject().SetActive(flag);
                this.EnemyList[index].UpdateValue();
            }
        }
Exemple #12
0
        private void SetEnemies(JSON_MapEnemyUnit[] json)
        {
            for (int index = 0; index < this.UnknownEnemyList.Count; ++index)
            {
                ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false);
            }
            List <JSON_MapEnemyUnit> list            = ((IEnumerable <JSON_MapEnemyUnit>)json).ToList <JSON_MapEnemyUnit>();
            TowerResuponse           towerResuponse  = MonoSingleton <GameManager> .Instance.TowerResuponse;
            TowerFloorParam          towerFloorParam = (TowerFloorParam)null;

            if (towerResuponse != null)
            {
                towerFloorParam = towerResuponse.GetCurrentFloor();
            }
            this.EnemyUnits.Clear();
            int index1 = 0;

            for (int index2 = 0; index2 < list.Count; ++index2)
            {
                NPCSetting npcSetting = new NPCSetting(list[index2]);
                Unit       data       = new Unit();
                data.Setup((UnitData)null, (UnitSetting)npcSetting, (Unit.DropItem)null, (Unit.DropItem)null);
                if (!data.IsGimmick)
                {
                    TowerEnemyListItem towerEnemyListItem;
                    if (this.EnemyList.Count <= index1)
                    {
                        towerEnemyListItem = (TowerEnemyListItem)((GameObject)Object.Instantiate <GameObject>((M0)this.EnemyTemplate)).GetComponent <TowerEnemyListItem>();
                        ((Component)towerEnemyListItem).get_transform().SetParent(this.EnemiesRoot.get_transform(), false);
                        this.EnemyList.Add(towerEnemyListItem);
                    }
                    else
                    {
                        towerEnemyListItem = this.EnemyList[index1];
                    }
                    if (towerFloorParam != null && towerFloorParam.iname == GlobalVars.SelectedQuestID && MonoSingleton <GameManager> .Instance.TowerEnemyUnit != null)
                    {
                        TowerResuponse.EnemyUnit enemyUnit = MonoSingleton <GameManager> .Instance.TowerEnemyUnit[index2];
                        data.Damage((int)data.MaximumStatus.param.hp - enemyUnit.hp, false);
                    }
                    DataSource.Bind <Unit>(((Component)towerEnemyListItem).get_gameObject(), data);
                    this.EnemyUnits.Add(data);
                    ++index1;
                }
            }
            for (int index2 = 0; index2 < this.EnemyList.Count; ++index2)
            {
                bool flag = index2 < list.Count && index2 < 10;
                ((Component)this.EnemyList[index2]).get_gameObject().SetActive(flag);
                this.EnemyList[index2].UpdateValue();
            }
        }
Exemple #13
0
        public override void OnSuccess(WWWResult www)
        {
            if (TowerErrorHandle.Error((FlowNode_Network)this))
            {
                return;
            }
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;

            WebAPI.JSON_BodyResponse <ReqTowerRank.JSON_TowerRankResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <ReqTowerRank.JSON_TowerRankResponse> >(www.text);
            DebugUtility.Assert(jsonObject != null, "res == null");
            Network.RemoveAPI();
            towerResuponse.Deserialize(jsonObject.body);
            this.Success();
        }
        public override List <TowerRewardItem> GetTowerRewardItem()
        {
            TowerResuponse         towerResuponse      = MonoSingleton <GameManager> .Instance.TowerResuponse;
            byte                   round               = towerResuponse.round;
            List <TowerRewardItem> towerRewardItemList = new List <TowerRewardItem>();

            for (int index = 0; index < this.mRoundList.Count; ++index)
            {
                if ((int)towerResuponse.round >= (int)round)
                {
                    towerRewardItemList.Add(this.mTowerRewardItems[index]);
                }
            }
            return(towerRewardItemList);
        }
Exemple #15
0
        public void Refresh()
        {
            TowerResuponse towerResuponse     = MonoSingleton <GameManager> .Instance.TowerResuponse;
            PlayerData     player             = MonoSingleton <GameManager> .Instance.Player;
            PartyData      partyOfType        = player.FindPartyOfType(PlayerPartyTypes.Tower);
            UnitData       unitDataByUniqueId = player.FindUnitDataByUniqueID(partyOfType.GetUnitUniqueID(partyOfType.LeaderIndex));

            if (unitDataByUniqueId != null)
            {
                DataSource.Bind <UnitData>(((Component)this).get_gameObject(), unitDataByUniqueId);
            }
            if (towerResuponse.arrived_num > 0)
            {
                if (this.TowerFloorParam != null)
                {
                    this.TowerName.set_text(LocalizedText.Get("sys.TOWER_CLEAR_DESC", (object)this.TowerFloorParam.title, (object)this.TowerFloorParam.floor));
                }
                string str = this.TowerResuponse.arrived_num.ToString();
                if (this.TowerResuponse.arrived_num > 99)
                {
                    if (Object.op_Inequality((Object)this.ArrivedNum, (Object)null))
                    {
                        ((Component)this.ArrivedNum).get_gameObject().SetActive(true);
                        this.ArrivedNum.set_text(str);
                    }
                }
                else if (Object.op_Inequality((Object)this.BigArrivedNum, (Object)null) && Object.op_Inequality((Object)this.BigArrivedNumEff, (Object)null))
                {
                    ((Component)this.BigArrivedNum).get_gameObject().SetActive(true);
                    ((Component)this.BigArrivedNumEff).get_gameObject().SetActive(true);
                    this.BigArrivedNum.set_text(str);
                    this.BigArrivedNumEff.set_text(str);
                }
                if (Object.op_Inequality((Object)this.ResultInfo, (Object)null))
                {
                    this.ResultInfo.get_gameObject().SetActive(false);
                }
                if (Object.op_Inequality((Object)this.BackButton, (Object)null))
                {
                    ((Component)this.BackButton).get_gameObject().SetActive(false);
                }
                this.Nowflow = TowerClear.CLEAR_FLOW.RANK_IN;
            }
            else
            {
                this.RefleshResult();
            }
        }
Exemple #16
0
        public void Refresh()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.mSlider, (UnityEngine.Object)null))
            {
                return;
            }
            UnitData UnitData = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);

            if (UnitData == null)
            {
                ((Component)this.mSlider).get_gameObject().SetActive(false);
            }
            else
            {
                TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
                if (towerResuponse == null)
                {
                    ((Component)this.mSlider).get_gameObject().SetActive(false);
                }
                else if (towerResuponse.pdeck == null)
                {
                    ((Component)this.mSlider).get_gameObject().SetActive(true);
                    int hp = (int)UnitData.Status.param.hp;
                    this.SetSliderValue(hp, hp);
                }
                else
                {
                    TowerResuponse.PlayerUnit playerUnit = towerResuponse.pdeck.Find((Predicate <TowerResuponse.PlayerUnit>)(x => x.unitname == UnitData.UnitParam.iname));
                    if (playerUnit == null)
                    {
                        ((Component)this.mSlider).get_gameObject().SetActive(true);
                        int hp = (int)UnitData.Status.param.hp;
                        this.SetSliderValue(hp, hp);
                    }
                    else if (playerUnit.isDied)
                    {
                        ((Component)this.mSlider).get_gameObject().SetActive(false);
                    }
                    else
                    {
                        ((Component)this.mSlider).get_gameObject().SetActive(true);
                        this.SetSliderValue(Mathf.Max((int)UnitData.Status.param.hp - playerUnit.dmg, 1), (int)UnitData.Status.param.hp);
                    }
                }
            }
        }
Exemple #17
0
        private int GetSameRank(int score, int rank)
        {
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;

            if (towerResuponse.SpdRank != null && towerResuponse.SpdRank.Length > 0 || towerResuponse.TecRank != null && towerResuponse.TecRank.Length > 0)
            {
                TowerResuponse.TowerRankParam[] towerRankParamArray = !this.IsSpeed ? towerResuponse.TecRank : towerResuponse.SpdRank;
                for (int index = 0; index < towerRankParamArray.Length; ++index)
                {
                    if (towerRankParamArray[index].score == score)
                    {
                        return(index + 1);
                    }
                }
            }
            return(rank);
        }
Exemple #18
0
        public void UpdateValue()
        {
            this.dead.SetActive(false);
            UnitData data = DataSource.FindDataOfClass <UnitData>(this.target, (UnitData)null);

            if (data == null)
            {
                return;
            }
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;

            if (towerResuponse.pdeck == null)
            {
                return;
            }
            TowerResuponse.PlayerUnit playerUnit = towerResuponse.pdeck.Find((Predicate <TowerResuponse.PlayerUnit>)(x => data.UnitParam.iname == x.unitname));
            this.dead.SetActive(playerUnit != null && playerUnit.isDied);
        }
        private void UpdateBestScore()
        {
            GameManager    instance       = MonoSingleton <GameManager> .Instance;
            TowerResuponse towerResuponse = instance.TowerResuponse;
            TowerParam     tower          = instance.FindTower(towerResuponse.TowerID);

            if (towerResuponse.spd_score != 0)
            {
                this.SetText(this.BestTurn, towerResuponse.spd_score.ToString());
                this.SetText(this.BestDied, towerResuponse.tec_score.ToString());
                this.SetText(this.BestRetire, towerResuponse.ret_score.ToString());
                this.SetText(this.BestRecover, towerResuponse.rcv_score.ToString());
                this.SetText(this.BestChallenge, towerResuponse.challenge_score.ToString());
                this.SetText(this.BestLose, towerResuponse.lose_score.ToString());
                this.SetText(this.BestReset, towerResuponse.reset_score.ToString());
                this.SetRankIcon(this.TurnScore, instance.ConvertTowerScoreToRank(tower, towerResuponse.spd_score, TOWER_SCORE_TYPE.TURN));
                this.SetRankIcon(this.DiedScore, instance.ConvertTowerScoreToRank(tower, towerResuponse.tec_score, TOWER_SCORE_TYPE.DIED));
                this.SetRankIcon(this.RetireScore, instance.ConvertTowerScoreToRank(tower, towerResuponse.ret_score, TOWER_SCORE_TYPE.RETIRE));
                this.SetRankIcon(this.RecoverScore, instance.ConvertTowerScoreToRank(tower, towerResuponse.rcv_score, TOWER_SCORE_TYPE.RECOVER));
                this.SetDefault(this.ChallengeScore);
                this.SetDefault(this.LoseScore);
                this.SetDefault(this.ResetScore);
            }
            else
            {
                this.SetText(this.BestTurn, this.NotSocreText);
                this.SetText(this.BestDied, this.NotSocreText);
                this.SetText(this.BestRetire, this.NotSocreText);
                this.SetText(this.BestRecover, this.NotSocreText);
                this.SetText(this.BestChallenge, this.NotSocreText);
                this.SetText(this.BestLose, this.NotSocreText);
                this.SetText(this.BestReset, this.NotSocreText);
                this.SetDefault(this.TurnScore);
                this.SetDefault(this.DiedScore);
                this.SetDefault(this.RetireScore);
                this.SetDefault(this.RecoverScore);
                this.SetDefault(this.ChallengeScore);
                this.SetDefault(this.LoseScore);
                this.SetDefault(this.ResetScore);
            }
        }
Exemple #20
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 1)
            {
                return;
            }
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;

            if (towerResuponse == null)
            {
                return;
            }
            TowerFloorParam currentFloor = towerResuponse.GetCurrentFloor();

            if (currentFloor == null)
            {
                return;
            }
            ((Behaviour)this).set_enabled(true);
            this.ExecRequest((WebAPI) new ReqTowerFloorReset(GlobalVars.SelectedTowerID, currentFloor.iname, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
        }
Exemple #21
0
        public override void Activated(int pinID)
        {
            base.Activated(pinID);
            if (pinID != 11)
            {
                return;
            }
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
            TowerParam     tower          = MonoSingleton <GameManager> .Instance.FindTower(GlobalVars.SelectedTowerID);

            if (towerResuponse.clear == 0 || towerResuponse.clear == 1 && towerResuponse.arrived_num == 0 || !tower.is_view_ranking)
            {
                this.EndTowerClear();
            }
            else
            {
                this.Window.SetActive(false);
                this.TowerClear.Refresh();
                ((Component)this.TowerClear).get_gameObject().SetActive(true);
            }
        }
Exemple #22
0
        private void CreateQuestDetailWindow(UnityEngine.Object template)
        {
            QuestParam dataOfClass = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null);

            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.m_TowerQuestDetail, (UnityEngine.Object)null) && dataOfClass != null)
            {
                this.m_TowerQuestDetail = UnityEngine.Object.Instantiate(template) as GameObject;
                DataSource.Bind <QuestParam>(this.m_TowerQuestDetail, dataOfClass);
                QuestCampaignData[] questCampaigns = MonoSingleton <GameManager> .Instance.FindQuestCampaigns(dataOfClass);

                DataSource.Bind <QuestCampaignData[]>(this.m_TowerQuestDetail, questCampaigns.Length != 0 ? questCampaigns : (QuestCampaignData[])null);
                TowerResuponse towerResuponse      = MonoSingleton <GameManager> .Instance.TowerResuponse;
                TowerScore     componentInChildren = (TowerScore)this.m_TowerQuestDetail.GetComponentInChildren <TowerScore>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren, (UnityEngine.Object)null) && towerResuponse != null)
                {
                    componentInChildren.SetScoreTitleText(dataOfClass.name);
                    componentInChildren.Setup(towerResuponse.FloorScores, towerResuponse.FloorSpdRank, towerResuponse.FloorTecRank);
                }
                this.m_TowerQuestDetail.SetActive(true);
            }
            FlowNode_GameObject.ActivateOutputLinks((Component)this, 1200);
        }
        public void UpdateValue()
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            TowerUnitIsDead.\u003CUpdateValue\u003Ec__AnonStorey382 valueCAnonStorey382 = new TowerUnitIsDead.\u003CUpdateValue\u003Ec__AnonStorey382();
            this.dead.SetActive(false);
            // ISSUE: reference to a compiler-generated field
            valueCAnonStorey382.data = DataSource.FindDataOfClass <UnitData>(this.target, (UnitData)null);
            // ISSUE: reference to a compiler-generated field
            if (valueCAnonStorey382.data == null)
            {
                return;
            }
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;

            if (towerResuponse.pdeck == null)
            {
                return;
            }
            // ISSUE: reference to a compiler-generated method
            TowerResuponse.PlayerUnit playerUnit = towerResuponse.pdeck.Find(new Predicate <TowerResuponse.PlayerUnit>(valueCAnonStorey382.\u003C\u003Em__42D));
            this.dead.SetActive(playerUnit != null && playerUnit.isDied);
        }
Exemple #24
0
        public void OnClickDetail()
        {
            QuestParam dataOfClass = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null);

            if (!Object.op_Equality((Object)this.Detail, (Object)null) || dataOfClass == null)
            {
                return;
            }
            this.Detail = (GameObject)Object.Instantiate <GameObject>((M0)this.DetailtTmplate);
            DataSource.Bind <QuestParam>(this.Detail, dataOfClass);
            QuestCampaignData[] questCampaigns = MonoSingleton <GameManager> .Instance.FindQuestCampaigns(dataOfClass);

            DataSource.Bind <QuestCampaignData[]>(this.Detail, questCampaigns.Length != 0 ? questCampaigns : (QuestCampaignData[])null);
            TowerResuponse  towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
            TowerFloorParam data           = (TowerFloorParam)null;

            if (towerResuponse != null)
            {
                data = towerResuponse.GetCurrentFloor();
            }
            DataSource.Bind <TowerFloorParam>(this.Detail, data);
            this.Detail.SetActive(true);
        }
        private void Success()
        {
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;

            ((Behaviour)this).set_enabled(false);
            JSON_ReqTowerResuponse json = new JSON_ReqTowerResuponse();

            json.is_reset = (byte)0;
            json.round    = this.round;
            json.rank     = new JSON_ReqTowerResuponse.Json_RankStatus();
            if (json.rank != null)
            {
                json.rank.spd_rank  = towerResuponse.speedRank;
                json.rank.tec_rank  = towerResuponse.techRank;
                json.rank.spd_score = towerResuponse.spd_score;
                json.rank.tec_score = towerResuponse.tec_score;
                json.rank.ret_score = towerResuponse.ret_score;
                json.rank.rcv_score = towerResuponse.rcv_score;
            }
            MonoSingleton <GameManager> .Instance.Deserialize(json);

            MonoSingleton <GameManager> .Instance.TowerResuponse.rtime = this.rtime;
            this.ActivateOutputLinks(1);
        }
Exemple #26
0
        public void Refresh()
        {
            TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(GlobalVars.SelectedQuestID);

            if (towerFloor == null)
            {
                return;
            }
            QuestParam questParam = towerFloor.GetQuestParam();

            DataSource.Bind <QuestParam>(((Component)this).get_gameObject(), questParam);
            this.SetRecommendText((int)towerFloor.lv, (int)towerFloor.joblv);
            int             downloadAssetNum = ((FlowNode_DownloadTowerMapSets)((Component)this).GetComponentInParent <FlowNode_DownloadTowerMapSets>()).DownloadAssetNum;
            TowerFloorParam currentFloor     = MonoSingleton <GameManager> .Instance.TowerResuponse.GetCurrentFloor();

            if (currentFloor == null)
            {
                return;
            }
            if ((int)towerFloor.FloorIndex < (int)currentFloor.FloorIndex + downloadAssetNum)
            {
                if (questParam.state == QuestStates.Cleared)
                {
                    GameUtility.SetGameObjectActive(this.UnkownIcon, false);
                    GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                    GameUtility.SetGameObjectActive(this.ClearIcon, true);
                    this.HideAllEnemyIcon();
                    this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
                }
                else
                {
                    string path = AssetPath.LocalMap(towerFloor.map[0].mapSetName);
                    string src  = AssetManager.LoadTextData(path);
                    if (string.IsNullOrEmpty(src))
                    {
                        DebugUtility.LogError("配置ファイルがありません : QuestIname = " + towerFloor.iname + ",SetFilePath = " + path);
                        return;
                    }
                    JSON_MapUnit jsonObject = JSONParser.parseJSONObject <JSON_MapUnit>(src);
                    GameUtility.SetGameObjectActive(this.UnkownIcon, false);
                    GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                    GameUtility.SetGameObjectActive(this.ClearIcon, false);
                    TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
                    this.HideAllEnemyIcon();
                    if (jsonObject.enemy != null)
                    {
                        TowerFloorParam towerFloorParam = (TowerFloorParam)null;
                        if (MonoSingleton <GameManager> .Instance.TowerResuponse != null)
                        {
                            towerFloorParam = MonoSingleton <GameManager> .Instance.TowerResuponse.GetCurrentFloor();
                        }
                        bool flag1 = towerResuponse.lot_enemies != null && towerResuponse.lot_enemies.Length > 0;
                        bool flag2 = towerFloor.iname == currentFloor.iname;
                        if (flag1 && flag2)
                        {
                            jsonObject.enemy = jsonObject.ReplacedRandEnemy(towerResuponse.lot_enemies, false);
                        }
                        List <TowerQuestInfo.EnemyIconData> enemyIconDataList1 = new List <TowerQuestInfo.EnemyIconData>();
                        for (int i = 0; i < jsonObject.enemy.Length; ++i)
                        {
                            bool flag3 = false;
                            if (jsonObject.enemy[i].IsRandSymbol)
                            {
                                flag3 = true;
                            }
                            if (flag1 && flag2)
                            {
                                flag3 = Array.Find <RandDeckResult>(towerResuponse.lot_enemies, (Predicate <RandDeckResult>)(lot => lot.set_id == i)) != null;
                            }
                            Unit unit = (Unit)null;
                            if (!jsonObject.enemy[i].IsRandSymbol)
                            {
                                NPCSetting npcSetting = new NPCSetting(jsonObject.enemy[i]);
                                unit = new Unit();
                                unit.Setup((UnitData)null, (UnitSetting)npcSetting, (Unit.DropItem)null, (Unit.DropItem)null);
                            }
                            enemyIconDataList1.Add(new TowerQuestInfo.EnemyIconData()
                            {
                                unit    = unit,
                                enemy   = jsonObject.enemy[i],
                                is_rand = flag3
                            });
                        }
                        List <TowerQuestInfo.EnemyIconData> enemyIconDataList2 = new List <TowerQuestInfo.EnemyIconData>();
                        for (int index = 0; index < enemyIconDataList1.Count; ++index)
                        {
                            if (!enemyIconDataList1[index].enemy.IsRandSymbol && !enemyIconDataList1[index].unit.IsGimmick)
                            {
                                enemyIconDataList2.Add(enemyIconDataList1[index]);
                            }
                        }
                        List <TowerQuestInfo.EnemyIconData> enemyIconDataList3 = new List <TowerQuestInfo.EnemyIconData>((IEnumerable <TowerQuestInfo.EnemyIconData>)enemyIconDataList2);
                        if (towerFloorParam != null && towerFloorParam.iname == GlobalVars.SelectedQuestID && MonoSingleton <GameManager> .Instance.TowerEnemyUnit != null)
                        {
                            for (int index = 0; index < enemyIconDataList3.Count; ++index)
                            {
                                if (enemyIconDataList3[index].unit != null)
                                {
                                    int num = (int)enemyIconDataList3[index].unit.MaximumStatus.param.hp - MonoSingleton <GameManager> .Instance.TowerEnemyUnit[index].hp;
                                    enemyIconDataList3[index].unit.Damage(num, false);
                                }
                            }
                        }
                        List <TowerQuestInfo.EnemyIconData> icon_datas         = new List <TowerQuestInfo.EnemyIconData>();
                        List <TowerQuestInfo.EnemyIconData> enemyIconDataList4 = new List <TowerQuestInfo.EnemyIconData>();
                        List <TowerQuestInfo.EnemyIconData> enemyIconDataList5 = new List <TowerQuestInfo.EnemyIconData>();
                        for (int index = 0; index < enemyIconDataList3.Count; ++index)
                        {
                            if (!enemyIconDataList3[index].is_rand)
                            {
                                enemyIconDataList4.Add(enemyIconDataList3[index]);
                            }
                        }
                        if (towerResuponse.lot_enemies == null || (int)towerFloor.FloorIndex > (int)currentFloor.FloorIndex)
                        {
                            if (jsonObject.deck != null && jsonObject.deck.Length > 0 && (jsonObject.rand_tag != null && jsonObject.rand_tag.Length > 0))
                            {
                                int num = 0;
                                for (int index = 0; index < jsonObject.rand_tag.Length; ++index)
                                {
                                    num += jsonObject.rand_tag[index].spawn;
                                }
                                for (int index = 0; index < num; ++index)
                                {
                                    TowerQuestInfo.EnemyIconData enemyIconData = new TowerQuestInfo.EnemyIconData();
                                    enemyIconDataList5.Add(enemyIconData);
                                }
                            }
                        }
                        else
                        {
                            for (int index = 0; index < enemyIconDataList3.Count; ++index)
                            {
                                if (enemyIconDataList3[index].is_rand)
                                {
                                    enemyIconDataList5.Add(enemyIconDataList3[index]);
                                }
                            }
                        }
                        icon_datas.AddRange((IEnumerable <TowerQuestInfo.EnemyIconData>)enemyIconDataList4);
                        icon_datas.AddRange((IEnumerable <TowerQuestInfo.EnemyIconData>)enemyIconDataList5);
                        this.SetIcon(icon_datas);
                    }
                    this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
                }
            }
            else
            {
                GameUtility.SetGameObjectActive(this.UnkownIcon, true);
                GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                GameUtility.SetGameObjectActive(this.ClearIcon, false);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.UnkownIcon, (UnityEngine.Object)null))
                {
                    Text component = (Text)this.UnkownIcon.GetComponent <Text>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                    {
                        component.set_text(LocalizedText.Get("sys.TOWER_UNKNOWN_TEXT", new object[1]
                        {
                            (object)((int)towerFloor.FloorIndex - downloadAssetNum + 1)
                        }));
                    }
                }
                this.HideAllEnemyIcon();
                this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_BattleResetCost, (UnityEngine.Object)null))
            {
                this.m_BattleResetCost.set_text(MonoSingleton <GameManager> .Instance.FindTower(towerFloor.tower_id).floor_reset_coin.ToString());
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            this.FloorID = GlobalVars.SelectedQuestID;
        }
Exemple #27
0
        public void Refresh()
        {
            TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(GlobalVars.SelectedQuestID);

            if (towerFloor == null)
            {
                return;
            }
            QuestParam questParam = towerFloor.GetQuestParam();

            DataSource.Bind <QuestParam>(((Component)this).get_gameObject(), questParam);
            this.SetRecommendText((int)towerFloor.lv, (int)towerFloor.joblv);
            int             downloadAssetNum = ((FlowNode_DownloadTowerMapSets)((Component)this).GetComponentInParent <FlowNode_DownloadTowerMapSets>()).DownloadAssetNum;
            TowerFloorParam currentFloor     = MonoSingleton <GameManager> .Instance.TowerResuponse.GetCurrentFloor();

            if (currentFloor == null)
            {
                return;
            }
            if ((int)towerFloor.FloorIndex < (int)currentFloor.FloorIndex + downloadAssetNum)
            {
                if (questParam.state == QuestStates.Cleared)
                {
                    GameUtility.SetGameObjectActive(this.UnkownIcon, false);
                    GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                    GameUtility.SetGameObjectActive(this.ClearIcon, true);
                    for (int index = 0; index < this.EnemyList.Count; ++index)
                    {
                        ((Component)this.EnemyList[index]).get_gameObject().SetActive(false);
                    }
                    for (int index = 0; index < this.UnknownEnemyList.Count; ++index)
                    {
                        ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false);
                    }
                    this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
                }
                else
                {
                    string path = AssetPath.LocalMap(towerFloor.map[0].mapSetName);
                    string src  = AssetManager.LoadTextData(path);
                    if (string.IsNullOrEmpty(src))
                    {
                        DebugUtility.LogError("配置ファイルがありません : QuestIname = " + towerFloor.iname + ",SetFilePath = " + path);
                        return;
                    }
                    JSON_MapUnit jsonObject = JSONParser.parseJSONObject <JSON_MapUnit>(src);
                    GameUtility.SetGameObjectActive(this.UnkownIcon, false);
                    GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                    GameUtility.SetGameObjectActive(this.ClearIcon, false);
                    TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
                    if ((int)jsonObject.is_rand > 0)
                    {
                        if (towerResuponse.lot_enemies == null || (int)towerFloor.FloorIndex > (int)currentFloor.FloorIndex)
                        {
                            for (int index = 0; index < this.EnemyList.Count; ++index)
                            {
                                ((Component)this.EnemyList[index]).get_gameObject().SetActive(false);
                            }
                            this.EnemyTemplateUnKnown.SetActive(true);
                            int num = 0;
                            for (int index = 0; index < towerFloor.rand_tag.Length; ++index)
                            {
                                num += (int)towerFloor.rand_tag[index];
                            }
                            for (int index = 0; index < num; ++index)
                            {
                                if (index >= this.UnknownEnemyList.Count)
                                {
                                    TowerEnemyListItem component = (TowerEnemyListItem)((GameObject)Object.Instantiate <GameObject>((M0)this.EnemyTemplateUnKnown)).GetComponent <TowerEnemyListItem>();
                                    ((Component)component).get_transform().SetParent(this.EnemiesRoot.get_transform(), false);
                                    this.UnknownEnemyList.Add(component);
                                }
                                ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(true);
                            }
                            for (int index = num; index < this.UnknownEnemyList.Count; ++index)
                            {
                                ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false);
                            }
                            this.EnemyTemplateUnKnown.SetActive(false);
                        }
                        else
                        {
                            List <JSON_MapEnemyUnit> randFixedUnit = jsonObject.GetRandFixedUnit();
                            jsonObject.enemy = new JSON_MapEnemyUnit[towerResuponse.lot_enemies.Length];
                            for (int index = 0; index < jsonObject.enemy.Length; ++index)
                            {
                                jsonObject.enemy[index] = jsonObject.deck[(int)towerResuponse.lot_enemies[index]];
                            }
                            List <JSON_MapEnemyUnit> jsonMapEnemyUnitList = new List <JSON_MapEnemyUnit>((IEnumerable <JSON_MapEnemyUnit>)jsonObject.enemy);
                            jsonMapEnemyUnitList.AddRange((IEnumerable <JSON_MapEnemyUnit>)randFixedUnit);
                            jsonObject.enemy = jsonMapEnemyUnitList.ToArray();
                            this.SetEnemies(jsonObject.enemy);
                        }
                    }
                    else if (jsonObject.enemy != null)
                    {
                        this.SetEnemies(jsonObject.enemy);
                    }
                    this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
                }
            }
            else
            {
                GameUtility.SetGameObjectActive(this.UnkownIcon, true);
                GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                GameUtility.SetGameObjectActive(this.ClearIcon, false);
                if (Object.op_Inequality((Object)this.UnkownIcon, (Object)null))
                {
                    Text component = (Text)this.UnkownIcon.GetComponent <Text>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        component.set_text(LocalizedText.Get("sys.TOWER_UNKNOWN_TEXT", new object[1]
                        {
                            (object)((int)towerFloor.FloorIndex - downloadAssetNum + 1)
                        }));
                    }
                }
                for (int index = 0; index < this.EnemyList.Count; ++index)
                {
                    ((Component)this.EnemyList[index]).get_gameObject().SetActive(false);
                }
                for (int index = 0; index < this.UnknownEnemyList.Count; ++index)
                {
                    ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false);
                }
                this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            this.FloorID = GlobalVars.SelectedQuestID;
        }
        private void UpdateTotalScore()
        {
            GameManager    instance       = MonoSingleton <GameManager> .Instance;
            TowerResuponse towerResuponse = instance.TowerResuponse;

            if (towerResuponse.speedRank != 0 && towerResuponse.techRank != 0)
            {
                if (Object.op_Inequality((Object)this.SpdRank, (Object)null))
                {
                    this.SpdRank.set_text(towerResuponse.speedRank.ToString());
                }
                if (Object.op_Inequality((Object)this.TecRank, (Object)null))
                {
                    this.TecRank.set_text(towerResuponse.techRank.ToString());
                }
                string str = instance.CalcTowerRank(true).ToString();
                if (Object.op_Inequality((Object)this.TotalScore, (Object)null))
                {
                    string name      = str.Replace("_PLUS", string.Empty).Replace("_MINUS", string.Empty);
                    Image  component = (Image)this.TotalScore.GetComponent <Image>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        component.set_sprite(this.Icons.GetSprite(name));
                    }
                }
                if (str.IndexOf("_PLUS") != -1)
                {
                    if (!Object.op_Inequality((Object)this.PlusObj, (Object)null))
                    {
                        return;
                    }
                    this.PlusObj.get_gameObject().SetActive(true);
                }
                else
                {
                    if (str.IndexOf("_MINUS") == -1 || !Object.op_Inequality((Object)this.MinusObj, (Object)null))
                    {
                        return;
                    }
                    this.MinusObj.get_gameObject().SetActive(true);
                }
            }
            else
            {
                if (Object.op_Inequality((Object)this.SpdRank, (Object)null))
                {
                    ((Component)this.SpdRank).get_gameObject().SetActive(false);
                }
                if (Object.op_Inequality((Object)this.TecRank, (Object)null))
                {
                    ((Component)this.TecRank).get_gameObject().SetActive(false);
                }
                if (Object.op_Inequality((Object)this.TotalScore, (Object)null))
                {
                    this.TotalScore.get_gameObject().SetActive(false);
                }
                if (Object.op_Inequality((Object)this.PlusObj, (Object)null))
                {
                    this.PlusObj.get_gameObject().SetActive(false);
                }
                if (!Object.op_Inequality((Object)this.MinusObj, (Object)null))
                {
                    return;
                }
                this.MinusObj.get_gameObject().SetActive(false);
            }
        }
Exemple #29
0
        private void UpdateOwnValue()
        {
            GameManager    instance       = MonoSingleton <GameManager> .Instance;
            TowerResuponse towerResuponse = instance.TowerResuponse;
            TowerParam     tower          = instance.FindTower(towerResuponse.TowerID);

            if (towerResuponse != null)
            {
                bool flag = towerResuponse.speedRank != 0 && towerResuponse.techRank != 0;
                if (Object.op_Inequality((Object)this.ClearPage, (Object)null))
                {
                    this.ClearPage.get_gameObject().SetActive(flag);
                }
                if (Object.op_Inequality((Object)this.NotClearPage, (Object)null))
                {
                    this.NotClearPage.get_gameObject().SetActive(!flag);
                }
            }
            int rank     = !this.IsSpeed ? towerResuponse.techRank : towerResuponse.speedRank;
            int sameRank = this.GetSameRank(!this.IsSpeed ? towerResuponse.tec_score : towerResuponse.spd_score, rank);

            if (Object.op_Inequality((Object)this.OwnIcon, (Object)null))
            {
                if (sameRank <= this.SHOW_VIP_RANK)
                {
                    this.OwnIcon.set_sprite(this.mSheet.GetSprite((sameRank - 1).ToString()));
                }
                else
                {
                    this.OwnIcon.set_sprite(this.mSheet.GetSprite("normal"));
                }
            }
            if (Object.op_Inequality((Object)this.Ranking, (Object)null))
            {
                ((Component)this.Ranking).get_gameObject().SetActive(sameRank > this.SHOW_VIP_RANK);
                this.Ranking.set_text(sameRank.ToString() + LocalizedText.Get("sys.TOWER_RANK_LABEL"));
            }
            if (Object.op_Inequality((Object)this.OwnObj, (Object)null))
            {
                PlayerData player       = instance.Player;
                long       unitUniqueId = player.Partys[6].GetUnitUniqueID(0);
                DataSource.Bind <UnitData>(this.OwnObj, player.FindUnitDataByUniqueID(unitUniqueId));
            }
            if (Object.op_Inequality((Object)this.OwnSpeedObj, (Object)null))
            {
                this.OwnSpeedObj.get_gameObject().SetActive(this.IsSpeed);
            }
            if (Object.op_Inequality((Object)this.OwnTechObj, (Object)null))
            {
                this.OwnTechObj.get_gameObject().SetActive(!this.IsSpeed);
            }
            if (this.IsSpeed)
            {
                if (Object.op_Inequality((Object)this.OwnSpeedScore, (Object)null))
                {
                    this.OwnSpeedScore.set_text(towerResuponse.spd_score.ToString());
                }
            }
            else if (Object.op_Inequality((Object)this.OwnSpeedScore, (Object)null))
            {
                this.OwnTechScore.set_text(towerResuponse.tec_score.ToString());
            }
            if (!Object.op_Inequality((Object)this.OwnTotalScore, (Object)null))
            {
                return;
            }
            string empty = string.Empty;

            this.OwnTotalScore.set_sprite(this.mSheet.GetSprite(!this.IsSpeed ? instance.ConvertTowerScoreToRank(tower, towerResuponse.tec_score, TOWER_SCORE_TYPE.DIED) : instance.ConvertTowerScoreToRank(tower, towerResuponse.spd_score, TOWER_SCORE_TYPE.TURN)));
        }
Exemple #30
0
        private void UpdateValue(ListItemEvents obj, int num, TowerResuponse.TowerRankParam param, bool isSpeed)
        {
            if (Object.op_Equality((Object)this.mSheet, (Object)null))
            {
                return;
            }
            GameManager    instance       = MonoSingleton <GameManager> .Instance;
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
            TowerParam     tower          = instance.FindTower(towerResuponse.TowerID);

            DataSource.Bind <TowerResuponse.TowerRankParam>(((Component)obj).get_gameObject(), param);
            Transform child1 = ((Component)obj).get_transform().FindChild("body");

            if (!Object.op_Inequality((Object)child1, (Object)null))
            {
                return;
            }
            Transform child2 = ((Component)child1).get_transform().FindChild("ranking");

            if (Object.op_Inequality((Object)child2, (Object)null))
            {
                Image component = (Image)((Component)child2).GetComponent <Image>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    if (num < this.SHOW_VIP_RANK)
                    {
                        component.set_sprite(this.mSheet.GetSprite(num.ToString()));
                    }
                    else
                    {
                        component.set_sprite(this.mSheet.GetSprite("normal"));
                    }
                }
            }
            Transform child3 = ((Component)child1).get_transform().FindChild("rank");

            if (Object.op_Inequality((Object)child3, (Object)null))
            {
                Text component = (Text)((Component)child3).GetComponent <Text>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    if (num < this.SHOW_VIP_RANK)
                    {
                        component.set_text(string.Empty);
                    }
                    else
                    {
                        component.set_text((num + 1).ToString() + LocalizedText.Get("sys.TOWER_RANK_LABEL"));
                    }
                }
            }
            Transform child4 = ((Component)child1).get_transform().FindChild("Text_player");

            if (Object.op_Inequality((Object)child4, (Object)null))
            {
                Text component = (Text)((Component)child4).GetComponent <Text>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    component.set_text(param.name);
                }
            }
            Transform child5 = ((Component)child1).get_transform().FindChild("player_level");

            if (Object.op_Inequality((Object)child5, (Object)null))
            {
                Text component = (Text)((Component)child5).GetComponent <Text>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    component.set_text(LocalizedText.Get("sys.TOWER_RANK_LBL_LV") + param.lv.ToString());
                }
            }
            if (isSpeed)
            {
                Transform child6 = ((Component)child1).get_transform().FindChild("speed");
                if (Object.op_Inequality((Object)child6, (Object)null))
                {
                    Transform child7 = ((Component)child6).get_transform().FindChild("speed_cnt");
                    if (Object.op_Inequality((Object)child7, (Object)null))
                    {
                        Text component = (Text)((Component)child7).GetComponent <Text>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            component.set_text(param.score.ToString());
                        }
                    }
                    ((Component)child6).get_gameObject().SetActive(true);
                }
                string    rank   = instance.ConvertTowerScoreToRank(tower, param.score, TOWER_SCORE_TYPE.TURN);
                Transform child8 = ((Component)child1).get_transform().FindChild("score_img");
                if (!Object.op_Inequality((Object)child8, (Object)null))
                {
                    return;
                }
                Image component1 = (Image)((Component)child8).GetComponent <Image>();
                if (!Object.op_Inequality((Object)component1, (Object)null))
                {
                    return;
                }
                component1.set_sprite(this.mSheet.GetSprite(rank));
            }
            else
            {
                Transform child6 = ((Component)child1).get_transform().FindChild("tech");
                if (Object.op_Inequality((Object)child6, (Object)null))
                {
                    Transform child7 = ((Component)child6).get_transform().FindChild("tech_cnt");
                    if (Object.op_Inequality((Object)child7, (Object)null))
                    {
                        Text component = (Text)((Component)child7).GetComponent <Text>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            component.set_text(param.score.ToString());
                        }
                    }
                    ((Component)child6).get_gameObject().SetActive(true);
                }
                string    rank   = instance.ConvertTowerScoreToRank(tower, param.score, TOWER_SCORE_TYPE.DIED);
                Transform child8 = ((Component)child1).get_transform().FindChild("score_img");
                if (!Object.op_Inequality((Object)child8, (Object)null))
                {
                    return;
                }
                Image component1 = (Image)((Component)child8).GetComponent <Image>();
                if (!Object.op_Inequality((Object)component1, (Object)null))
                {
                    return;
                }
                component1.set_sprite(this.mSheet.GetSprite(rank));
            }
        }