Exemple #1
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 #2
0
        public override void AddExpPlayer()
        {
            Transform transform = !Object.op_Inequality((Object)this.UnitList, (Object)null) ? this.UnitListItem.get_transform().get_parent() : this.UnitList.get_transform();

            for (int index = 0; index < this.mUnits.Count; ++index)
            {
                GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.UnitListItem);
                gameObject.get_transform().SetParent(transform, false);
                this.canvas_group.Add((TowerUnitIsDead)gameObject.GetComponentInChildren <TowerUnitIsDead>());
                this.mUnitListItems.Add(gameObject);
                if (this.mCurrentQuest.type == QuestTypes.Tower)
                {
                    this.mHpBar.Add((HpBarSlider)gameObject.GetComponentInChildren <HpBarSlider>());
                }
                DataSource.Bind <UnitData>(gameObject, this.mUnits[index]);
                gameObject.SetActive(true);
            }
            if (this.mCurrentQuest.type != QuestTypes.Tower)
            {
                return;
            }
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            TowerQuestResult.\u003CAddExpPlayer\u003Ec__AnonStorey276 playerCAnonStorey276 = new TowerQuestResult.\u003CAddExpPlayer\u003Ec__AnonStorey276();
            // ISSUE: reference to a compiler-generated field
            playerCAnonStorey276.\u003C\u003Ef__this = this;
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            for (playerCAnonStorey276.i = 0; playerCAnonStorey276.i < this.mHpBar.Count; ++playerCAnonStorey276.i)
            {
                // ISSUE: reference to a compiler-generated method
                Unit unit = SceneBattle.Instance.Battle.Player.Find(new Predicate <Unit>(playerCAnonStorey276.\u003C\u003Em__2F7));
                if (unit != null && MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID(unit.UnitData.UniqueID) != null)
                {
                    // ISSUE: reference to a compiler-generated field
                    this.mHpBar[playerCAnonStorey276.i].slider.set_maxValue((float)unit.TowerStartHP);
                    // ISSUE: reference to a compiler-generated field
                    this.mHpBar[playerCAnonStorey276.i].slider.set_minValue(0.0f);
                    // ISSUE: reference to a compiler-generated field
                    this.mHpBar[playerCAnonStorey276.i].slider.set_value((float)(int)unit.CurrentStatus.param.hp);
                    // ISSUE: reference to a compiler-generated field
                    TowerResuponse.PlayerUnit playerUnit = MonoSingleton <GameManager> .Instance.TowerResuponse.FindPlayerUnit(this.mUnits[playerCAnonStorey276.i]);

                    if (playerUnit != null && playerUnit.isDied)
                    {
                        // ISSUE: reference to a compiler-generated field
                        ((CanvasGroup)((Component)this.mUnitListItems[playerCAnonStorey276.i].get_transform().GetChild(0)).get_gameObject().GetComponent <CanvasGroup>()).set_alpha(this.DeadAlpha);
                    }
                    // ISSUE: reference to a compiler-generated field
                    GameParameter.UpdateAll(this.mUnitListItems[playerCAnonStorey276.i]);
                }
            }
        }
 public int GetUnitDamage(UnitData unit_data)
 {
     if (this.pdeck == null)
     {
         return(0);
     }
     TowerResuponse.PlayerUnit playerUnit = this.FindPlayerUnit(unit_data);
     if (playerUnit == null)
     {
         return(0);
     }
     return(playerUnit.dmg);
 }
        public int GetPlayerUnitHP(UnitData data)
        {
            if (this.pdeck == null)
            {
                return((int)data.Status.param.hp);
            }
            TowerResuponse.PlayerUnit playerUnit = this.FindPlayerUnit(data);
            if (playerUnit == null)
            {
                return((int)data.Status.param.hp);
            }
            int num = Mathf.Min(playerUnit.dmg, (int)data.Status.param.hp - 1);

            return((int)data.Status.param.hp - num);
        }
Exemple #5
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 #6
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);
        }
Exemple #7
0
        public override void AddExpPlayer()
        {
            Transform transform = !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.UnitList, (UnityEngine.Object)null) ? this.UnitListItem.get_transform().get_parent() : this.UnitList.get_transform();

            for (int index = 0; index < this.mUnits.Count; ++index)
            {
                GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.UnitListItem);
                gameObject.get_transform().SetParent(transform, false);
                this.canvas_group.Add((TowerUnitIsDead)gameObject.GetComponentInChildren <TowerUnitIsDead>());
                this.mUnitListItems.Add(gameObject);
                if (this.mCurrentQuest.type == QuestTypes.Tower)
                {
                    this.mHpBar.Add((HpBarSlider)gameObject.GetComponentInChildren <HpBarSlider>());
                }
                DataSource.Bind <UnitData>(gameObject, this.mUnits[index]);
                gameObject.SetActive(true);
            }
            if (this.mCurrentQuest.type != QuestTypes.Tower)
            {
                return;
            }
            for (int i = 0; i < this.mHpBar.Count; ++i)
            {
                Unit unit = SceneBattle.Instance.Battle.Player.Find((Predicate <Unit>)(x => x.UnitData.UniqueID == this.mUnits[i].UniqueID));
                if (unit != null && MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID(unit.UnitData.UniqueID) != null)
                {
                    this.mHpBar[i].slider.set_maxValue((float)unit.TowerStartHP);
                    this.mHpBar[i].slider.set_minValue(0.0f);
                    this.mHpBar[i].slider.set_value((float)(int)unit.CurrentStatus.param.hp);
                    TowerResuponse.PlayerUnit playerUnit = MonoSingleton <GameManager> .Instance.TowerResuponse.FindPlayerUnit(this.mUnits[i]);

                    if (playerUnit != null && playerUnit.isDied)
                    {
                        ((CanvasGroup)((Component)this.mUnitListItems[i].get_transform().GetChild(0)).get_gameObject().GetComponent <CanvasGroup>()).set_alpha(this.DeadAlpha);
                    }
                    GameParameter.UpdateAll(this.mUnitListItems[i]);
                }
            }
        }
        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);
        }